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

Previewing xdmf file

+1 vote

I am solving a time dependant pde and I save the solution at each time step.

u_file = XDMFFile("velocity.xdmf")

while t < T:
     t += dt
     # solve for u
     u_file << u

This while loop takes a long time to finish. I want to check if 'u' is making sense so far. Hence, so way to preview 'velocity.xdmf' would be very useful but it cannot be read by paraview until the program terminates.

asked Jun 30, 2014 by bshankar FEniCS Novice (790 points)

1 Answer

+1 vote
 
Best answer

Try setting the parameter

u_file.parameters["flush_output"] = True
answered Jun 30, 2014 by Øyvind Evju FEniCS Expert (17,700 points)
selected Jun 30, 2014 by bshankar

On a different note, for time-dependent problems where the mesh does not change, I also advise setting

u_file.parameters["rewrite_function_mesh"] = False

For reference, see the related Issue https://bitbucket.org/fenics-project/dolfin/issue/278

...