I also think there may be a small typo in the documentation
<https://www.dealii.org/current/doxygen/deal.II/group__MeshWorker.html#ga76ec61fbd188fb320fe8ca166a79b322>
;

"If the flag AssembleFlags::assemble_own_cells is passed, then the default
behavior is to first loop over faces and do the work there, and then
compute the actual work on the cell. It is possible to perform the
integration on the cells after working on faces, by adding the flag
AssembleFlags::cells_after_faces."

to my eye, in both cases, the work on the face is done, followed by the
work on the cell. I think, however, the default behavior is to work on the
cells first, followed by work on the faces.

On Mon, Apr 3, 2023 at 6:35 PM Corbin Foucart <corbin.fouc...@gmail.com>
wrote:

> Hello everyone,
>
> I'm solving a 1D explicit DG-FEM problem and I've encountered behavior
> that I don't understand using MeshWorker::mesh_loop.
>
>    - I'm using the MeshWorker::assemble_own_interior_faces_both flag
>    since I want to do work on each face corresponding to the same cell 
> interior
>    - If the grid is created using typical GridGenerator calls, the order
>    is exactly as I'd expect: first, work is done on the cell, then the faces
>    (boundary or interior), followed by the next cell (further, all mass
>    matrices are the same)
>    - However, if I manually adapt the mesh by refining some cells, the
>    order seems to change; the face work is done without respect to the cell
>    interior last worked on
>
> I've attached a stripped-down program that illustrates this behavior on a
> toy mesh in 1D, as well as the output.
>
>    - Ultimately, my goal is to assemble an inverse mass matrix on each
>    cell, and apply it to a residual vector containing interior and face
>    contributions (which can be done element-wise since the elements are
>    FE_DGQ)
>    - I was attempting to store the inverse via CopyData and then apply it
>    in the copy worker.
>    - However, I'm finding that due to the order of execution, I can't
>    rely on the face work being done immediately after the cell work, and the
>    inverse mass matrix stored to CopyData is often from another cell than the
>    faces being worked on.
>    - I could do the assembly and application of the inverse mass matrices
>    separately, or store the inverse mass matrices in a map to the cell
>    iterators, but I'm curious why this ordering occurs.
>
> Am I misunderstanding how mesh_loop is supposed to work? Any guidance
> would be appreciated!
>
> Corbin
>
> --
> 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/ac4d4550-b014-4440-b2c2-227dba71fffen%40googlegroups.com
> <https://groups.google.com/d/msgid/dealii/ac4d4550-b014-4440-b2c2-227dba71fffen%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/CAE%2BMPodXQ5tZWiOkhq1j-p4uuvQiWOg3n57R2z7cWCKMz1pKFQ%40mail.gmail.com.

Reply via email to