[petsc-users] reading and writing periodic DMPlex to file

Berend van Wachem berend.vanwachem at ovgu.de
Wed Dec 14 03:27:45 CST 2022


Dear PETSc team and users,

I have asked a few times about this before, but we haven't really gotten 
this to work yet.

In our code, we use the DMPlex framework and are also interested in 
periodic geometries.

As our simulations typically require many time-steps, we would like to 
be able to save the DM to file and to read it again to resume the 
simulation (a restart).

Although this works for a non-periodic DM, we haven't been able to get 
this to work for a periodic one. To illustrate this, I have made a 
working example, consisting of 2 files, createandwrite.c and 
readandcreate.c. I have attached these 2 working examples. We are using 
Petsc-3.18.2.

In the first file (createandwrite.c) a DMPlex is created and written to 
a file. Periodicity is activated on lines 52-55 of the code.

In the second file (readandcreate.c) a DMPlex is read from the file. 
When a periodic DM is read, this does not work. Also, trying to 
'enforce' periodicity, lines 55 - 66, does not work if the number of 
processes is larger than 1 - the code "hangs" without producing an error.

Could you indicate what I am missing? I have really tried many different 
options, without finding a solution.

Many thanks and kind regards,
Berend.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: createandwrite.c
Type: text/x-csrc
Size: 7721 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221214/aaf6c4f8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readandcreate.c
Type: text/x-csrc
Size: 5379 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221214/aaf6c4f8/attachment-0001.bin>


More information about the petsc-users mailing list