[petsc-users] DMPlex: Ghost points after DMRefine
Morten Nobel-Jørgensen
mono at mek.dtu.dk
Mon Nov 30 07:01:49 CST 2015
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?
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;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151130/52d239a8/attachment.html>
More information about the petsc-users
mailing list