On Tue, Aug 27, 2019 at 4:07 AM Edoardo alinovi via petsc-users < petsc-users@mcs.anl.gov> wrote:
> Hello PETSc users and developers, > I hope you are doing well! Today I have a general question about DMplex to > see if it can be usefull to me or not. > > I have my fancy finite volume solver (cell centered, incompressible NS) > which uses petsc as linear solver engine. Thanks to your suggestions so far > it is now running well :) > > I would like to see if I can do another step incapsulatng in petsc also > the mesh managment part. I think that Dmplex is the way to go since my code > is fully unstructured. > > I have red some papers and lectures by Matt around the web, but still I > have not found an answer to this question: > Can dmplex dial with cell centered data arrangement and provide some > support for basic operation (e. g. interpolation between partitions, face > value calculation etc)? > 1) Cell centered data Definitely yes. This is the same data layout as P0 finite elements. You just assign the PetscSection k dofs per cell. 2) Interpolation between partitions I assume you mean ghost values from other parallel partitions. You can do this by using overlap=1 in DMPlexDisrtibute(). 3) Face value calculation You can do Riemann solves by looping over faces, grabbing values from the neighboring cells, doing the calculation, and updating cell values. We carry out this kind of computation in TS ex11. That example attempts to do everything, so it is messy, but we can help you understand what it is doing in any part that is unclear. 4) FV boundary conditions You can use DMPlexConstructGhostCells() to put artificial cells around the boundary that you use to prescribe fluxes. Thanks, Matt > Thank you very much! > > Edo > -- 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/>