Specifying different names for the individual .vtu files when saving to .pvd

Asked by Maximilian Albert

I'm running a simulation which consists of multiple stages, and I'm saving snapshots at various time steps to a .pvd file by doing something along the following lines (in pseudo-code):

f = dolfin.File("sim.pvd")
for s in stages:
    # do some computations, then at certain regular time steps save a snapshot:
    f << some_data

This results in a collection of files called


However, what I would like to do is keep the 'global' filename sim.pvd the same while grouping the files within each stage together and mark with an extra suffix, like this:


Unfortunately, I can't find a way to change the names of the .vtu files (they seem to be derived automatically from the name of the .pvd file with sequential numbers added). Is there a way to explicitly specify these names somehow and thus to set them to something else than the default?

Many thanks for any suggestions, and in particular thanks for a great piece of software!

Question information

English Edit question
DOLFIN Edit question
No assignee Edit question
Solved by:
Garth Wells
Last query:
Last reply:
Revision history for this message
Best Garth Wells (garth-wells) said :

This is not possible at present. Our file interface is a bit too complicated to make this an easy fix, see


Depending on feedback to the above, I may make some changes to allow the use of a PVDFile object, in which what you request would be easy.

Revision history for this message
Maximilian Albert (cilix) said :

Thanks a lot for the quick reply, Garth! In this case I'll hope for a positive response to your question on the mailing list. :-)

Keep up the great work!

Revision history for this message
Maximilian Albert (cilix) said :

Thanks Garth Wells, that solved my question.