[petsc-users] PetscSF leaf ordering behaviour

Matthew Knepley knepley at gmail.com
Thu Aug 11 06:49:22 CDT 2022


On Wed, Aug 10, 2022 at 10:00 PM Nicholas Arnold-Medabalimi <
narnoldm at umich.edu> wrote:

> Hi
>
> I have been working on writing an output of a DMPlex object to interface
> with an existing code that has some strict requirements. I need each
> process to output its partition vertices and cell map but also note the
> point number of the cell on the adjacent processor for the boundary faces.
>
> I have two different setups I'm pursuing with different challenges.
>
> 1) The DMPlex is distributed with an overlap of 0. This makes the vertex
> output trivial as only I don't need to worry about the halo vertices.
> However, to get the cell from the other processor, I have to check the star
> forest on both processors, figure out the face on the sending processor,
> then grab its support cell and trade it with the host processor.
>
> *If I continue on this path I'd say the question would be, is there an
> easier way to get the support cell from the adjacent processor when you
> don't have an overlap?*
>
> Right now, what I am doing is getting the RootRanks of the DM SF and the
> inverse of this SF. I do this because with an overlap of 0, the root
> dependency only goes one way on the boundaries, and I need to have the
> cells on each side sent to the opposite processor.
>

YOu end up doing 90% of the work we do for overlap here. I cannot see an
easier way right now.


> 2) The DMPlex has an overlap of 1. This makes grabbing the neighboring
> cell local point value trivial roots using the support of the faces
> combined with the SF. But the issue is now outputting only the vertices of
> the process without messing up the cell maps.
>
> *The question here is how are the vertices in the DMPlex organized by
> default?* I have noticed that the leaf vertices are always at the end of
> the DMPlex stratum.* Is this a guaranteed behavior and then within the
> leaf cells when there is an overlap are they organized in any set way?*
>

No, I do not guarantee that leaf vertices are at the end, or leaf cells.
You can always use DMPlexPermute() to get that behavior if you want. It
sounds
like you want to do that. I know Firedrake does a similar thing. Let me
know if this does not work for you.

  Thanks,

     Matt


> I'm hoping that for each layer of overlap those leaves are appended. That
> way I can just take the vertices up until the first halo of vertices.
> Otherwise, I would search through the list to check if they are in the core
> partition and output them, and then account for any removed vertex in the
> cell maps.
>
> I appreciate the input and help.
>
> Sincerely
> Nicholas
>
>
>
> --
> Nicholas Arnold-Medabalimi
>
> Ph.D. Candidate
> Computational Aeroscience Lab
> University of Michigan
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220811/c310d600/attachment.html>


More information about the petsc-users mailing list