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

   sim000000.vtu
   sim000001.vtu
   sim000002.vtu
   sim000003.vtu
   ...

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:

sim_stage01_000000.vtu
sim_stage01_000001.vtu
sim_stage01_000002.vtu
...
sim_stage02_000000.vtu
sim_stage02_000001.vtu
sim_stage02_000002.vtu
...

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

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

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

    https://lists.launchpad.net/dolfin/msg25897.html

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 :
#2

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 :
#3

Thanks Garth Wells, that solved my question.