Converting from VTU files to transient VTKHDF file

I’m trying to convert timestep UnstructuredGrid data from .vtu files to a transient .vtkhdf file, preferably in python. Before I re-invent the wheel, has anyone done this before? Or have experience/tips/code for either reading from .vtu (and/or .pvd) files, or for writing to transient .vtkdhf? I’m new in this space, so any help is much appreciated. Thanks!

@lgivord

https://www.kitware.com/how-to-write-time-dependent-data-in-vtkhdf-files/

Hi @engineer,

@dpaff link can help you to create from scratch a python script to write a VTKHDF file.

To convert vtkxml, you can do it in python, probably something like that should works with ParaView master as we have a writer now:

from paraview.simple import *

your_data_0vtu = XMLUnstructuredGridReader(registrationName='transient_sphere_0.vtu*', FileName=['your_data_0.vtu', 'your_data_1.vtu', 'your_data_2.vtu'])

SaveData('your_data.vtkhdf', proxy=your_data_0vtu, WriteAllTimeSteps=1)

Alternatively, you can use Dan’s repository for such purpose :

Big thanks for the tips! I’ll update here if I have more questions / am able to get it working.