about the use of File("myfile.pvd")

Asked by Dupront

Hello,
  I am running an unsteady case and at each time
step I save my solution.
  I proceed as it is done in many demos:

myfile = File("myfile.pvd")
...
myfile << my_function_solution

As a result I have saved the files:
myfile.pvd
myfile000000.vtu
...
myfileI.vtu
I being the number of output.

Now I can restart my run at time step I+1.
What should I do for the vtu output file to
start with number I+1 and to have the old
pvd file updated ?

thanks

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Dupront
Solved:
Last query:
Last reply:
Revision history for this message
Jan Blechta (blechta) said :
#1

It seems this is not implemented. You can consider using TimeSeries instead.

You can also write information about timestep to pvd

file = File('output.pvd')
file << (func, 42.)

So when you restart your computation you write to different pvd file and then you can load both pvd files with paraview (or something else) and use values from both files as they belong to different timesteps. And you can either write a simple shell utility which merges two pvd files.

Jan

Revision history for this message
Dupront (michel-dupront) said :
#2

Thanks a lot.
I will use the second idea you proposed now
and check what a TimeSeries is later.