vtu/xdmf synchronisation

(Patrick Bégou) #1

Hi paraview users,
I’m using two coupled applications. One save vtu files, the other save hdf5/xdmf files. Is there a way to synchronize these files when viewing them in a paraview session and building an animation ? I have one VTU file for each hdf5/xdmf file but in vtu format I have not the time information .
At this time, creating animation show some additionnal step (a total of nearly 300 steps for only 200 steps), advancing only one of the coupled file (the vtu only, then the xdmf one) and there are a lot of bad images saved.
Thanks
Patrick

(Haocheng Liu) #2

Personally I use a script to generate a PVD file to visualize them as animation. Check the details about PVD here.

(Patrick Bégou) #3

Thanks Liu for your suggestion. Indeed I do not understand clearly how to associate these two sets of data in a PVD file. Do you provide two collections of datasets with same range of timestep ? A dataset seams to be only on file for me.
Or do you use two PVD files (one for each set of data) with same time steps in the datasets of the collections ?

Patrick

(Haocheng Liu) #4

When you say synchronize vtu && hdf5/xdmf files, what do you want to achieve?

If you just want to remove duplicate time steps, can you mix them?(Ex. Step 0 uses vtu file and step 1 use hdf5 file.)

IMO there is nothing prevent you from mixing vtu files and hdf5/xdmf files in the PVD file which provides an easy way to generate animation data.

Sample PVD file:

<?xml version="1.0"?>
<VTKFile type="Collection" version="0.1"
         byte_order="LittleEndian"
         compressor="vtkZLibDataCompressor">
  <Collection>
    <DataSet timestep="0" group="" part="0"
             file="examplePVD/examplePVD_T0000.vtu"/>
    <DataSet timestep="1" group="" part="0"
             file="examplePVD/examplePVD_T0001.xdmf"/>
    <DataSet timestep="2" group="" part="0"
             file="examplePVD/examplePVD_T0002.vtu"/>
    <DataSet timestep="3" group="" part="0"
             file="examplePVD/examplePVD_T0003.vtu"/>
    <DataSet timestep="4" group="" part="0"
             file="examplePVD/examplePVD_T0004.vtu"/>
  </Collection>
</VTKFile>
(Patrick Bégou) #5

Hi Liu,

it is a coupled application with 2 different codes A and B.
For each time step I have a vtu file from code A showing one part of the geometry and an xdmf file from code B showing the second part of the geometry. The goal is to build an animation with the 2 parts of the géometry.
Reading 200 vtu files and 200 xdmf file give 317 steps (don’t know why) as time to time only one of the two code results are updated in my Paraview session. Ex:
step 1 datas from code A and B are synchronized (view is OK)
step 2 datas from code A and B are synchronized (view is OK)
step 3 only data from code A goes to next step (view is bad)
step 4 only data from code B goes to next step (view is OK)
step 5 datas from code A and B are synchronized (view is OK)
etc…
So I need 2 file per timestep (file N°1 xdmf and file n°1 vtu,…etc) to set the synchronization of the data

(Haocheng Liu) #6

Humm, can you group the 2 files into some vtkCompositeDataset(Ex vtkMultiBlockDataset)? It can be an expensive operation, but basically you are conbining the two files into one. Other than that, I don’t know how to read 2 files per time step.

PS: Also you can check how Paraview handles the pvd file and extend its functionality to support your case.