Hi all,
I've output results into time-series xdmf files, and now wish to read the data (mesh and functions) back for further use. I am using Fenics 1.60
Here's an example of output:
from dolfin import *
import numpy
parameters["allow_extrapolation"]=True
mesh=UnitSquareMesh(10,10)
V=FunctionSpace(mesh,'CG',1)
U = Function(V)
U.interpolate(Expression(('0.25*x[0]')))
# as_backend_type(U.vector()).update_ghost_values()
file = File('mesh.xdmf')# << U
file << (U , 1.0)
#ALE.move(mesh, Constant((1, 1)))
V = VectorFunctionSpace(mesh, 'CG', 1)
# Shear displacement
u = interpolate(Expression(('0.25*x[1]', '0')), V)
mesh.move (u)
file << (U,2.0)
plot(U)
interactive()
and what I am looking for is:
file = File('mesh.xdmf')
file >> U
file >> mesh
Any suggestions how do this?
Thanks.