[petsc-users] DMPlex: Ghost points after DMRefine
Matthew Knepley
knepley at gmail.com
Mon Nov 30 07:08:48 CST 2015
On Mon, Nov 30, 2015 at 7:01 AM, Morten Nobel-Jørgensen <mono at mek.dtu.dk>
wrote:
> I have a very simple unstructured mesh composed of two triangles (four
> vertices) with one shared edge using a DMPlex:
>
> /|\
> / | \
> \ | /
> \|/
>
> After distributing this mesh to two processes, each process owns a
> triangle. However one process owns tree vertices, while the last vertex is
> owned by the other process.
>
> The problem occurs after uniformly refining the dm. The mesh now looks
> like this:
>
> /|\
> /\|/\
> \/|\/
> \|/
>
> The new center vertex is now not listed as a ghost vertex but instead
> exists as two individual points.
>
> Is there any way that this new center vertex could be created as a ghost
> vertex during refinement?
>
This could be a bug with the l2g mapping. I do not recreate it when
refining, only the SF defining the mapping.
Here is an experiment: do not retrieve the mapping until after the
refinement. Do you get what you want? If so,
I can easily fix this by destroying the map when I refine.
Thanks,
Matt
> Kind regards,
> Morten
>
> Ps. Here are some code snippets for getting global point index and test of
> point is a ghost point:
>
> int localToGlobal(DM dm, PetscInt point){
> const PetscInt* array;
> ISLocalToGlobalMapping ltogm;
> DMGetLocalToGlobalMapping(dm,<ogm);
> ISLocalToGlobalMappingGetIndices(ltogm, &array);
> PetscInt res = array[point];
> if (res < 0){ // if ghost
> res = -res +1;
> }
> return res;
> }
>
> bool isGhost(DM dm, PetscInt point){
> const PetscInt* array;
> ISLocalToGlobalMapping ltogm;
> DMGetLocalToGlobalMapping(dm,<ogm);
> ISLocalToGlobalMappingGetIndices(ltogm, &array);
> return array[point]<0;
> }
>
>
--
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151130/0a07f447/attachment-0001.html>
More information about the petsc-users
mailing list