[petsc-users] local/global DMPlex Vec output

Matthew Knepley knepley at gmail.com
Mon Oct 21 12:15:52 CDT 2024


On Mon, Oct 21, 2024 at 12:22 PM Matteo Semplice via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Dear petsc-users,
>
>     I am having issues with output of parallel data attached to a DMPlex
> (or maybe more fundamental ones about DMPlex...).
>
> So I currently
>
>    1. create a DMPlex (DMPlexCreateGmshFromFile or DMPlexCreateBoxMesh)
>    2. partition it
>    3. and create a section for my data layout with
>    DMPlexCreateSection(ctx.dmMesh, NULL, numComp, numDof, numBC, NULL, NULL,
>    NULL, NULL, &sUavg)
>    4. DMSetLocalSection(ctx.dmMesh, sUavg)
>    5. create solLoc and solGlob vectors with DMCreateGlobalVector and
>    DMCreateLocalVector
>    6. solve ....
>    7. VecView(ctx.solGlob, vtkViewer) on a .vtu file
>
> but when I load data in ParaView I get more cells than expected and it is
> as if the cells in the halo are put twice in output. (I could create a MWE
> if the above is not clear)
>
> I think we need an MWE here, because from the explanation above, it should
work.

However, I can try to guess the problem. When you partition the mesh, I am
guessing that you have cells in the overlap. These cells
must be in the point SF in order for the global section to give them a
unique owner. Perhaps something has gone wrong here.

  Thanks,

     Matt

> I guess that the culprit is point (4), but if I replace it with
> DMSetGlobalSection then I cannot create the local vector at point (5).
>
> How should I handle this properly? In my code I need to create both local
> and global vectors, to perform at least GlobalToLocal and to save the
> global data.
>
> (On a side note, I tried also HDF5 but then it complains about the DM not
> having a DS...; really, any working solution that allows data to be
> explored with Paraview is fine)
>
> Thanks for any advice!
>
> Matteo Semplice
>


-- 
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

https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dyUl2snizAM-nnjAz0JsZ-BQgR8C9AVaDc6IMX6AAMGg4BCq5vOHECpDJvryh20xQRl6SKI_KLzhXk6P7Co7$  <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dyUl2snizAM-nnjAz0JsZ-BQgR8C9AVaDc6IMX6AAMGg4BCq5vOHECpDJvryh20xQRl6SKI_KLzhXs4Z9aPI$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20241021/e02c949e/attachment.html>


More information about the petsc-users mailing list