[petsc-users] DMPlex Traversal
Matthew Knepley
knepley at gmail.com
Fri Dec 2 05:48:53 CST 2022
On Fri, Dec 2, 2022 at 5:16 AM Nicholas Arnold-Medabalimi <
narnoldm at umich.edu> wrote:
> Hi Petsc Users
>
> I have become familiar with usage of DMPlexGet(Restore)TransitiveClosure
> as well as general traversal of the graph using DMPlexGetCone and
> GetSupport.
>
> I was wondering if there is a more trivial way to get access to adjacent
> points of the same Stratum.
>
> For example, I have an 2D mesh. I have identified the point value of a
> cell of interest and I would like to get the point value of the surrounding
> cells. So far the way I get that is I descend a level using GetCone and
> then for each constituent point (face in this case) call GetSupport (which
> yields the adjacent cell and the original cell) and discard the original
> cell.
>
> Is there a direct function call that achieves this? I've looked a bit into
> the Adjacency commands but they seem to be more for variable influence (FV
> or FE) and using them seems to throw an error.
>
It is important to lay out why you want to do this, because it influences
the choice of implementation.
If you just want to discover topology, then doing it using Cone and Support
is fine. This is what GetAdjacency is doing underneath.
However, if you want to repeatedly do this, which most people do for
dof traversal, then you should make an index. There are two cases
of this in Plexx right now, but we could easily have more. GetAdjacency is
used to construct the sparsity pattern for the Jacobian, which
serves as an index. Also GetClosure is used to construct the closure index
which we use when setting values since this is a common
operation in FE.
What do you want to do with this?
Thanks,
Matt
> 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/20221202/db3f7a26/attachment.html>
More information about the petsc-users
mailing list