Differences between cell_iterators() and mg_cell_iterators()

37 views
Skip to first unread message

yy.wayne

unread,
Jan 1, 2023, 8:29:03 AM1/1/23
to deal.II User Group
I'm a bit confused on the effect of cell_iterators (similar ones are cell_iterators_on_level and dof_handler.begin()) and mg_cell_iterators. In step16, begin_mg() is used when assembling multigrid, while in step56 we use cell_iterators rather than mg_cell_iterators. I think they both loop through all cells, active or not. In documentation the difference is mg_cell_iterators "return an iterator in their level-cell form".  May some expert explain this a little further?

Timo Heister

unread,
Jan 3, 2023, 2:32:48 PM1/3/23
to dea...@googlegroups.com
This is not documented well and the doxygen types shown are not very
helpful. In the end it boils down to the following:
*_mg_* functions return level or multigrid iterators that have an
accessor (that is inside the iterator) with the template argument
level_dof_access = true. The only difference, if I remember correctly,
is that get_active_or_mg_dof_indices() will return the result of
get_mg_dof_indices() instead of get_dof_indices(). So, if you use
level iterators, you can use get_active_or_mg_dof_indices() in your
assembly and it will automatically do the right thing. This means you
can use the same assembler for active and mg levels.

See https://www.dealii.org/developer/doxygen/deal.II/classDoFCellAccessor.html#a15ef35e919b1005dc6050f9bca96956d

On Sun, Jan 1, 2023 at 8:45 AM 'yy.wayne' via deal.II User Group
<dea...@googlegroups.com> wrote:
>
> I'm a bit confused on the effect of cell_iterators (similar ones are cell_iterators_on_level and dof_handler. begin()) and mg_cell_iterators. In step16, begin_mg() is used when assembling multigrid, while in step56 we use cell_iterators rather
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> Use caution when opening links or attachments if you do not recognize the sender.
>
> ZjQcmQRYFpfptBannerEnd
> I'm a bit confused on the effect of cell_iterators (similar ones are cell_iterators_on_level and dof_handler.begin()) and mg_cell_iterators. In step16, begin_mg() is used when assembling multigrid, while in step56 we use cell_iterators rather than mg_cell_iterators. I think they both loop through all cells, active or not. In documentation the difference is mg_cell_iterators "return an iterator in their level-cell form". May some expert explain this a little further?
>
> --
> 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+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/a52ed968-d0d3-4cf9-be1a-ccd96de3e5f4n%40googlegroups.com.



--
Timo Heister
http://www.math.clemson.edu/~heister/

yy.wayne

unread,
Jan 4, 2023, 12:38:45 AM1/4/23
to deal.II User Group
That's great. Thank you.
Reply all
Reply to author
Forward
0 new messages