What if I am setting the user flag with something like this: 

for (const auto &cell : triangulation.active_cell_iterators())
for (const unsigned int face : cell->face_indices())
if ((cell->face(face)->center is between x1 and x2 )
cell->face(face)->set_user_flag();

I set the flag when I create the mesh, then I loop on the faces inside a 
mesh worker mesh loop and do something special at a flagged face.
This has been working without any issues for sometime now. Is this error 
prone?  
 
On Thursday, April 27, 2023 at 11:29:34 PM UTC+2 Timo Heister wrote:

> I would suggest that you use MeshWorker::mesh_loop() to do this (or
> look at the complicated implementation of it).
>
> On Thu, Apr 27, 2023 at 11:18 AM Bruno Turcksin
> <[email protected]> wrote:
> >
> > Right, it won't clear it everywhere. You would need to use MPI to clear 
> the flag on the other processor. If you would do that you would create a 
> huge amount of messages and your code would be extremely slow. Best, Bruno 
> ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍
> > ZjQcmQRYFpfptBannerStart
> > This Message Is From an External Sender
> > Use caution when opening links or attachments if you do not recognize 
> the sender.
> >
> > ZjQcmQRYFpfptBannerEnd
> > Right, it won't clear it everywhere. You would need to use MPI to clear 
> the flag on the other processor. If you would do that you would create a 
> huge amount of messages and your code would be extremely slow.
> >
> > Best,
> >
> > Bruno
> >
> > Le jeu. 27 avr. 2023 à 10:09, Abbas Ballout <[email protected]> a 
> écrit :
> >>
> >> This works!! Thanks.
> >> I am guessing something like:
> >>
> >> if(cell_neighbour->is_ghost()==true)
> >> cell->face(neighbour_face_number)->clear_user_flag();
> >>
> >> won't clear the user flag everywhere either, because that didn't work.
> >> Right?
> >>
> >> On Thursday, April 27, 2023 at 2:48:23 PM UTC+2 [email protected] 
> wrote:
> >>>
> >>> Hello,
> >>>
> >>> On Thursday, April 27, 2023 at 7:56:50 AM UTC-4 [email protected] 
> wrote:
> >>>
> >>> This works with a single MPI but not for more. Is it because the 
> cell->face(face)->clear_user_flag()
> >>> doesn't clear the user flag in the other distributed meshes?
> >>>
> >>>
> >>> That's correct. The flag is only cleared locally not on the other 
> processor.
> >>>
> >>> I can't directly loop over faces because there is no 
> "face->is_locally_owned()"
> >>> I know that meshworker is an option. Is it the only option?
> >>>
> >>> You can check if the cell that shares the face (use this) is a ghost 
> cell (use this). If that's the case, you can ask for the subdomain id of 
> the locally owned cell and the ghost cell (use this). Now you can decide 
> that only the processor with the lower rank can "touch" the face and the 
> other processor should just skip it.
> >>>
> >>> Best,
> >>>
> >>> Bruno
> >>>
> >>
> >> --
> >> 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 a topic in the 
> Google Groups "deal.II User Group" group.
> >> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/dealii/s07h9mCZhq4/unsubscribe.
> >> To unsubscribe from this group and all its topics, send an email to 
> [email protected].
> >> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/d7b3b433-e421-4b2c-a837-add3bd1d6f2en%40googlegroups.com
> .
> >
> > --
> > 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 [email protected].
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/CAGVt9ePNjo-9oOPy5YdfZ-RntzJDe7eu5Zdeyy6vFL8W9Jod_A%40mail.gmail.com
> .
>
>
>
> -- 
> Timo Heister
> http://www.math.clemson.edu/~heister/
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/7d0c1908-a484-4c2c-868f-abb0138fcc76n%40googlegroups.com.

Reply via email to