Hi Currently, I am just trying to replace the mesh management in an existing code using DMPlex. So I am distributing the DMPlex and then passing the mesh information and translating the PetscSF information off into the existing MPI solver. So I think using the cone and support should be fine. It does happen repeatedly during the run time but with a different distribution each time so I think GetAdjacency will cover my use case.
Thank you for the clarification Sincerely Nicholas On Fri, Dec 2, 2022 at 6:49 AM Matthew Knepley <[email protected]> wrote: > On Fri, Dec 2, 2022 at 5:16 AM Nicholas Arnold-Medabalimi < > [email protected]> 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/> > -- Nicholas Arnold-Medabalimi Ph.D. Candidate Computational Aeroscience Lab University of Michigan
