[petsc-users] Duplicate cells when exporting a distributed dmplex

Morten Nobel-Jørgensen mono at dtu.dk
Tue Jul 5 04:17:29 CDT 2016


Hi all,

I hope someone can help me with the following:

I’m having some problems when exporting a distributed DMPlex – the cells (+cell types) seems to be duplicated.

When I’m running the code on a non-distributed system it works as expected, but when I run it on multiple processors (2 in my case) the output is invalid.

I have attached a simple example and the output for np=1 and np=2.

Abbreviated the code essentially does the following:
'
PetscInt       dim         = 3;
PetscInt       cells[]     = {1, 1, 2};
PetscInt       overlap     = 1;
PetscInitialize(&argc, &argv, NULL, help);
DMPlexCreateHexBoxMesh(PETSC_COMM_WORLD, dim, cells, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, &dm);
DMPlexDistribute(dm, overlap, NULL, &dist);
dm   = dist;
SetupDOFs(dm);
Vec V;
DMCreateGlobalVector(dm, &V);
AssignSomeValues(V);
PetscViewer viewer;
const char* fn = "output.vtk";
PetscViewerVTKOpen(PETSC_COMM_WORLD,fn,FILE_MODE_WRITE,&viewer);
VecView(V,viewer);
PetscViewerDestroy(&viewer);

Kind regards,
Morten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160705/bb8afa8f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex_vtk_export.cc
Type: application/octet-stream
Size: 2716 bytes
Desc: ex_vtk_export.cc
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160705/bb8afa8f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output-np2.vtk
Type: application/octet-stream
Size: 909 bytes
Desc: output-np2.vtk
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160705/bb8afa8f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output-np1.vtk
Type: application/octet-stream
Size: 863 bytes
Desc: output-np1.vtk
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160705/bb8afa8f/attachment-0002.obj>


More information about the petsc-users mailing list