MeshWorker and assembly on periodic faces

26 views
Skip to first unread message

Praveen C

unread,
Mar 3, 2026, 6:09:43 AM (2 days ago) Mar 3
to Deal.II Googlegroup
Dear all

Suppose I have a 2d square domain with periodicity in both directions.

I loop over faces with MeshWorker::mesh_loop, specify assemble_flags as below

    auto assemble_flags = MeshWorker::assemble_own_cells;
      assemble_flags |= MeshWorker::assemble_own_interior_faces_once;
      assemble_flags |= MeshWorker::assemble_ghost_faces_once;

Suppose face1 and face2 are periodic pairs of faces. Will the above mesh_loop ensure that only one of face1 or face2 is visited during assembly ?

Or will it visit both periodic face pairs ?

thanks
praveen

Wolfgang Bangerth

unread,
Mar 3, 2026, 2:33:34 PM (2 days ago) Mar 3
to dea...@googlegroups.com
On 3/3/26 03:09, Praveen C wrote:
>
> I loop over faces with MeshWorker::mesh_loop, specify assemble_flags as below
>
>     auto assemble_flags = MeshWorker::assemble_own_cells;
>       assemble_flags |= MeshWorker::assemble_own_interior_faces_once;
>       assemble_flags |= MeshWorker::assemble_ghost_faces_once;
>
> Suppose face1 and face2 are periodic pairs of faces. Will the above mesh_loop
> ensure that only one of face1 or face2 is visited during assembly ?
>
> Or will it visit both periodic face pairs ?

Praveen:
I'm not sure whether anyone knows for certain what the answer to your question
is. But why not write a small program to find out and, if possible, update the
documentation with your findings?

Best
W.

Luca Heltai

unread,
Mar 3, 2026, 3:49:36 PM (2 days ago) Mar 3
to Deal.II Users
Dear Praveen,

to add to what Wolfgang said: I implemented the first version of MeshWorker::mesh_loop function, and at the time periodicity was not supported. Unless someone else implemented the logic for periodic faces later on, I would assume that they are treated as boundary faces.

We’d of course be very happy to review a patch that adds the correct behaviour for periodic faces!

:)

L
> --
> 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 visit https://groups.google.com/d/msgid/dealii/CAEvUdMKpZWWcgiwrwZdF8XJs7xTaywvBbHvFv4Dv3AmGa2Z2bg%40mail.gmail.com.

Praveen C

unread,
Mar 3, 2026, 9:10:06 PM (2 days ago) Mar 3
to Deal. II Googlegroup
Thank you both for the suggestions.

Periodic faces should be treated as interior faces and then the flag MeshWorker::assemble_own_interior_faces_once should apply and only one of the periodic face pairs should be used for assembly, even though physically they are different faces.

I want to make sure this is happening, and will write some small test code.

The code of mesh_loop is checking about periodicity, but the logic is not clear to me from reading the code.

I have used these features in a DG code (and I am sure many others also) and it seems to work as expected. But I do observe some issues on gmsh grids when I use periodicity, but maybe it is not related to MeshWorker. I will post a separate issue on this.

best
praveen
> To view this discussion visit https://groups.google.com/d/msgid/dealii/C2CDF68B-358A-4E19-B3C5-FD763D93D7BF%40gmail.com.

Praveen C

unread,
Mar 4, 2026, 3:59:56 AM (yesterday) Mar 4
to Deal. II Googlegroup
I made a small example to test this


and explain the output in the readme.

The conclusion is that periodic faces are treated as interior faces. So if the flag

MeshWorker::assemble_own_interior_faces_once

is given, then among a periodic face pair, only one of them is visited by mesh_loop, which is what we want.

In the documentation on AssembleFlags


the behaviour of periodic faces can be mentioned, that they are treated as interior faces for assembly.

thanks
praveen

Reply all
Reply to author
Forward
0 new messages