I want to read a mesh from a output xdmf file as follow:
from fenics import *
mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, 'P', 1)
u = Function(V)
XDMFFile("out.xdmf").write_checkpoint(u, "u", 0)
mesh2 = Mesh()
XDMFFile("out.xdmf").read(mesh2)
but this yields the following error:
Traceback (most recent call last):
File "plot.py", line 10, in <module>
XDMFFile("out.xdmf").read(mesh2)
RuntimeError:
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to recognise cell type.
*** Reason: Unknown value "".
*** Where: This error was encountered inside XDMFFile.cpp.
*** Process: 0
***
*** DOLFIN version: 2019.1.0
*** Git changeset: 74d7efe1e84d65e9433fd96c50f1d278fa3e3f3f
*** -------------------------------------------------------------------------
any idea how to read a mesh from a xdmf file created with write_checkpoint ?