Paraview and VTK support for moving mesh

In my simulations I often have to display a 3D mesh (which could be PolyData or UnstructuredGrid depending on where it comes from) that is moving about the simulation domain, like a propeller blade in a CFD domain. In this case the definition of the mesh is always the same, just with a different orientation and/or translation.

Currently I just dump out the relevant mesh vtk file for every time step but this is not very efficient, especially if it’s a complex geometry with thousands of faces (This could be GBs of uneccessary data over hundreds of timesteps so I’m keen to avoid writing it out). Is there a smart way of doing this where I only write out the mesh once but write the translation and orientation matrix (or quaternion) to a separate vtk file as something like FieldData?

Hello @jpmorr,

There is different approach here:

  1. as suggested, save this translation/rotation… matrix as a fieldData. Write a programmable filter which apply a vtkTransform on the input with these informations.
  2. Write each points for each timestep and use an “static” mechanism for other, AFAIK only the VTKHDF File Format can do that. With that you will save some space (for the connectivities, data array …)

@Lucas_Givord In the second method you mention do you mean like in this post: How to write time dependent data in VTKHDF files? Here the connectivity seems to be fixed but the poitns appear to be chnaging.

In my case, the connectivity and relative position of the points are always fixed, just with a change in posiiotn/orientation so the vtkTransform on the input sounds like the way to proceed. Can this be applied through a paraview filter automatically each time a vtk file is loaded in a time series? The transform filter seems to require manual input of the rotation matrix without any option to read from a variable?

image

And it appears to be Euler angles rather than a rotation matrix or quaternion - What euler angle sequence should be used: ZYX?

If the filter has to be applied progmatically, then I will have to leave this alone for now as the main end-users will not familiar with vtk or how to use complex scripts within paraview. I’d like to be able to reduce the data written but not if it makes things more difficult for other users later.

In the second method you mention do you mean like in this post: How to write time dependent data in VTKHDF files? Here the connectivity seems to be fixed but the poitns appear to be chnaging.

Yes and indeed it’s not the best solution here as you still need to specify each point for each timestep

Can this be applied through a paraview filter automatically each time a vtk file is loaded in a time series?

yes

The transform filter seems to require manual input of the rotation matrix without any option to read from a variable?

Yes that’s why I spoke about programmable filter to set, with some code, Translate/Scale/Rotate fields.

And it appears to be Euler angles rather than a rotation matrix or quaternion - What euler angle sequence should be used: ZYX?

it should be XYZ

If the filter has to be applied progmatically, then I will have to leave this alone for now as the main end-users will not familiar with vtk or how to use complex scripts within paraview. I’d like to be able to reduce the data written but not if it makes things more difficult for other users later.

hum here a solution could be:

  • write the code for the programmable filter (find rotate/translate/… field data from the input, transform it as euler angle and so on, do a vtkTransform)
  • save it as a python state
  • create a macro
  • share this micro to your user so that they just need to click on a button in the interface to apply this programmable filter

@Lucas_Givord Thanks for all the info. I need to go learn about macros and programmable filters next!

1 Like