[petsc-users] Duplicate cells when exporting a distributed dmplex
Matthew Knepley
knepley at gmail.com
Wed Jul 6 14:35:24 CDT 2016
On Tue, Jul 5, 2016 at 4:17 AM, Morten Nobel-Jørgensen <mono at dtu.dk> wrote:
> 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.
>
The problem here is VTK output with overlapped meshes. If you change to
overlap = 0, it works as expected. I never fixed the VTK output
for this, but the HDF5 output works correctly. I will put this on the list
of things to do. I am attaching your code with some cleanup from me,
including assigning values in parallel.
Thanks,
Matt
> 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
>
--
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/20160706/e2785085/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex_vtk_export.c
Type: text/x-csrc
Size: 3336 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160706/e2785085/attachment.c>
More information about the petsc-users
mailing list