In my code, I have time steps of 10000. With each time step the mesh and the solution evolves. I want to save all 10000 evolutions. So creating pvd and vtu files takes up a lot of space. So I need to save in a more compact format. I searched through some of the posts and got the idea of saving them as xdmf files. But it is generating an error. Here is a sketch of what I tried:
vtkfile = XDMFFile("mesh_evolution.xdmf")
vtkfile.parameters["flush_output"] = True
for t in range(0,10000):
### Solve for some variational problem to get u(t)
### Apply solution u(t) to a submesh
vtkfile.write(submesh,t)
This generates the error message
vtkfile.write(submesh,t)
'dolfin.cpp.mesh.SubMesh' object has no attribute '_cpp_object'
But with similar codes, I am having no trouble saving time evolving solutions as xdmf files!
I am not sure what I am doing wrong here. Any help or suggestion would be greatly appreciated.