[petsc-users] Is it possible to keep track of original elements # after a call to DMPlexDistribute ?
Matthew Knepley
knepley at gmail.com
Thu Nov 11 06:59:25 CST 2021
On Wed, Nov 10, 2021 at 11:45 PM Eric Chamberland <
Eric.Chamberland at giref.ulaval.ca> wrote:
> Hi Matthew,
>
> I have joined the ex44.c example so you can see that we see.
>
> The problem is about the "f" field number which I can't see any clue in
> the documentation to what to put there... We are missing some information
> maybe written elsewhere?
>
> I have tried 3 different calls (lines 180-182) with comments aside:
>
> //ierr = DMSetBasicAdjacency(ddm, PETSC_TRUE, PETSC_FALSE);
> CHKERRQ(ierr); //This works: it give only 2 cells for the overlap //ierr
> = DMSetAdjacency(ddm, 0, PETSC_TRUE, PETSC_FALSE); CHKERRQ(ierr); //This
> works too, but why do I have to use field #0 ??? Is it a convention?
> ierr = DMSetAdjacency(ddm, PETSC_DEFAULT, PETSC_TRUE, PETSC_FALSE);
> CHKERRQ(ierr); //This does not works: it give 3 cells for the overlap
> instead of 2.
>
Okay, I will fix the docs. I will run it, but I think I see what is
happening here. The default is used _only_ when no fields are defined.
This is to support the case of just using Plex without any field
definitions. Once you define fields, we let you have a different adjacency
for each field, so that Jacobian layout can be customized. However, what is
used for topology then? Right now, I believe it is field 0.
It sounds like I need a flag to tell me whether the user set something, so
we can have better defaults.
> Also, do you think your gitlab/knepley/fix-plex-g2n branch will find it's
> way into next or main? ;)
>
Put in the MR today.
Thanks,
Matt
> Thanks,
>
> Eric
>
> On 2021-11-10 3:26 p.m., Matthew Knepley wrote:
>
> Okay, so the PETSC_DEFAULT one is what is used for topology. There are
> two separate uses for adjacency info.
> First, for this kind of topological extension, and the second is for
> calculating Jacobians. You should be able to see
> the difference between FEM and FVM in just the case of a 2x2 mesh where
> each process gets 1 cell. With FEM,
> the overlap is the whole mesh, whereas with FVM it leaves out the diagonal
> partner.
>
> Thanks,
>
> Matt
>
>
>
--
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/20211111/ddb5dc15/attachment.html>
More information about the petsc-users
mailing list