Hello,
I've managed to read/write functions using the HDF format, but I'm unsure how to read data in time series format.
My code is basically the following:
writing (MPI)
t = 0.0
T=2
file << (u,t)
Hdf=HDF5File(mesh.mpi_comm(), hdfFile, "w")
Hdf.write(mesh, "mesh")
i=0
while (t < T):
i+=1
t += dt
u0.vector()[:] = u.vector()
solver.solve(problem, u.vector())
file << (u,t)
r = u.vector()
Hdf.write(u, "u",i)
Hdf.close()
reading (single proc)
f = HDF5File(mpi_comm_world(),hdfFile,'r')
mesh = Mesh()
f.read(mesh,"mesh",False)
V = FunctionSpace(mesh,"CG",1)
u = Function(V)
f.read(u,'u',1.)
f.close()
In the 'reading' routine, I can only call f.read as f.read(u,'u'), so it appears I can grab only one time slice. Is there a different syntax I should use for grabbing other iterations?
Thanks in advance and I apologize if I missed this in the documentation somewhere.
Pete