Professor Wolfgang, Thanks for your advice and I will try my best to do what you told me. I asked the problem about the transform between dofhandler iterator and triangulation iterator because I have never used this function. Except this function, I 'm familiar with the other functions used in other parts of my code. So I'm not sure whether the transform is right or not. Of course, if I got the right way to do the transformation, I can make sure that the bad results do not result from this part and I can focus on other parts of my code.
Thank you again. And I learned a lot from your excellent lecture videos, including debugging my code using eclipse, that help me find and solve many problems. Best, Toddy 在2021年11月23日星期二 UTC+8 上午11:53:44<Wolfgang Bangerth> 写道: > On 11/22/21 6:55 PM, Toddy Liu wrote: > > > > I used the method that you taught me. but unfortunately the results > seems bad. > > And I'm not sure where the problem is including the transform between > > dofhandler iterator and triangulation iterator. So please take a look at > my > > codes(two pieces of codes shown in the following figures) and tell me > which > > one will be the right one. > > Toddy -- for both this post and the other one you sent earlier, you need > to > learn techniques to debug your codes. This typically starts with asking > the > right questions. So when you say above "the results seems bad", you should > ask > what specifically is wrong? Does the solution look right in the interior > but > is wrong at the boundary? Or the other way around? Does it work on a > single > processor, and is only wrong when run in parallel? What happens for cases > where you set the right hand side function to zero? > > All of these questions help you *observe* what specifically is wrong, and > helps you formulate *hypotheses* where the bug may lie. When you have a > hypothesis, you can star to test it, play with variations that allow you > to > identify whether your guess that the problem is, for example, at the > boundary, > and narrow the places where the bug might be. > > In the codes you show, I believe that they should be identical. Both codes > should work the same. If you get different results, then that would be > strange, but you could in that case test *why* the results are different > -- > for example by outputting the cell matrices and vectors. > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bang...@colostate.edu > www: http://www.math.colostate.edu/~bangerth/ > > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/6130a9a6-1918-49d2-95fd-3d8bfc72ffa3n%40googlegroups.com.