[petsc-users] DMView and DMLoad

Berend van Wachem berend.vanwachem at ovgu.de
Tue Sep 14 04:14:48 CDT 2021


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,

Berend.




More information about the petsc-users mailing list