Dear Toddy,

This is a link to the documentation, where this function (a class constructor) 
is explained in more detail
https://dealii.org/current/doxygen/deal.II/classDoFAccessor.html#a8d14894a737bb1edf3719e4de058a284
 
<https://dealii.org/current/doxygen/deal.II/classDoFAccessor.html#a8d14894a737bb1edf3719e4de058a284>
I can’t see that you’re misusing it in any way. The order of the arguments that 
you’ve provided to it look correct to me.

Regarding the two approaches that you outlined a couple of posts earlier, I 
think that the intention is to use it in the way that you first proposed. 
Iterating over the triangulation, selecting a particular cell to perform and 
action on, and then converting that Tria cell iterator to the two DoFHandler 
cell iterators seems meaningful. The second approach is probably less 
meaningful - if you want the iterators outside of the loop, then you may as 
well have started with the first active iterator retrieved straight from the 
individual DoFHandlers in the first place. 

Best,
Jean-Paul


> On 23. Nov 2021, at 07:57, Toddy Liu <toddyliu2...@gmail.com> wrote:
> 
> 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 
> <applewebdata://087813D9-29E8-43E6-B06D-F865F7436818> 
> www: http://www.math.colostate.edu/~bangerth/ 
> <http://www.math.colostate.edu/~bangerth/> 
> 
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <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 
> <mailto: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
>  
> <https://groups.google.com/d/msgid/dealii/6130a9a6-1918-49d2-95fd-3d8bfc72ffa3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/A2FBE629-2F9B-44DC-95BE-425FB010100E%40gmail.com.

Reply via email to