[petsc-users] DMView and DMLoad

Matthew Knepley knepley at gmail.com
Tue Sep 14 06:23:49 CDT 2021


On Tue, Sep 14, 2021 at 5:15 AM Berend van Wachem <berend.vanwachem at ovgu.de>
wrote:

> Dear PETSc-team,
>
> We are trying to save and load distributed DMPlex and its associated
> physical fields (created with DMCreateGlobalVector)  (Uvelocity,
> VVelocity,  ...) in HDF5_XDMF format. To achieve this, we do the following:
>
> 1) save in the same xdmf.h5 file:
> DMView( DM         , H5_XDMF_Viewer );
> VecView( UVelocity, H5_XDMF_Viewer );
>
> 2) load the dm:
> DMPlexCreateFromfile(PETSC_COMM_WORLD, Filename, PETSC_TRUE, DM);
>
> 3) load the physical field:
> VecLoad( UVelocity, H5_XDMF_Viewer );
>
> There are no errors in the execution, but the loaded DM is distributed
> differently to the original one, which results in the incorrect
> placement of the values of the physical fields (UVelocity etc.) in the
> domain.
>
> This approach is used to restart the simulation with the last saved DM.
> Is there something we are missing, or there exists alternative routes to
> this goal? Can we somehow get the IS of the redistribution, so we can
> re-distribute the vector data as well?
>
> Many thanks, best regards,
>

Hi Berend,

We are in the midst of rewriting this. We want to support saving multiple
meshes, with fields attached to each,
and preserving the discretization (section) information, and allowing us to
load up on a different number of
processes. We plan to be done by October. Vaclav and I are doing this in
collaboration with Koki Sagiyama,
David Ham, and Lawrence Mitchell from the Firedrake team.

For this problem, we need to give hints for the distribution when you load
the DM, as is done now with Vec.
We have replaced the DMPlexCreateFromFile() with DMLoad() to better match
the interface in the rest of PETSc.
Hopefully the wait is not too big an inconvenience.

  Thanks,

     Matt


> Berend.
>
>
>

-- 
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://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210914/e5fcd160/attachment.html>


More information about the petsc-users mailing list