This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Save a Mesh in parallel.

+1 vote

I have a simulation with an evolving mesh, and would like to save the resulting mesh in parallel. Is this possible?

I can save the mesh as a .pvd file, but when I load it,

mesh = Mesh('mesh.pvd')

I get the error

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     https://answers.launchpad.net/dolfin
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to read object from file.
*** Reason:  Cannot read objects of type Mesh from VTK files.
*** Where:   This error was encountered inside GenericFile.cpp.
*** Process: 0
*** -------------------------------------------------------------------------
asked Dec 6, 2013 by pf4d FEniCS User (2,970 points)
edited Dec 6, 2013 by pf4d

1 Answer

+3 votes
 
Best answer

Hi, for parallel IO with mesh, you should use the XDMF file format

File('mesh.xdmf') << mesh

Also take a look at this previously asked question.

answered Dec 6, 2013 by MiroK FEniCS Expert (80,920 points)
selected Dec 6, 2013 by pf4d
...