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

Attachment: ex_vtk_export.cc
Description: ex_vtk_export.cc

Attachment: output-np2.vtk
Description: output-np2.vtk

Attachment: output-np1.vtk
Description: output-np1.vtk

Reply via email to