VTKOutput - include time information

More
4 years 1 month ago #3195 by creativeworker
Hello,

i know .vtk files can be aware of the time information of the frame. This would allow animations in ParaView which is played back evenly, even if the frames are not stored with even time differences.
Is there a possibility to use that with the NGSolve VTKOutput?
More
4 years 1 month ago #3197 by schruste
Hi creativeworker,

Paraview has the "ParaView Data" (pvd) File Format which is essentially a collection of vtk data files along with the time steps, see here: www.paraview.org/Wiki/ParaView/Data_formats#PVD_File_Format

Haven't tried this in years, but in principle that should allow you to wrap the pvd around a collection of vtk files and time stamps. You would need to write this file yourself a.t.m., it's not featured in NGSolve.

Best,
Christoph
More
4 years 1 month ago #3198 by schruste
Ok, I checked this myself and have to admit that my answer was a bit premature. The pvd-file solution doesn't work with the legacy vtk-files that we export to in NGSolve. You need to convert to vtu-files first. This however can easily be done for example with meshio (pip install --user meshio) and the call
`meshio-convert a.vtk a.vtu`
All in all, this requires a small amount of scripting (you can also call the meshio-functionality from within python of course) but should easily be set up.

Best,
Christoph
More
4 years 1 month ago #3199 by creativeworker
Thank you very much for your effort. That helps a lot!
Time to create page: 0.108 seconds