New Animated Stream Lines Representation for ParaView 5.3

Figure 1 – The new Stream Lines representation display animated streamlines using a vector field defined on a dataset.

We are proud to introduce you a new cool feature that will be available in ParaView 5.3.

This feature comes with the StreamLinesRepresentation plugin which provides a new representation called “Stream Lines“. This representation that can deal with any kind of data set and takes benefit of the new OpenGL2 back-end of VTK.

The Stream Lines Representation

The representation displays an animated view of streamlines in a vector field associated to cells or points of the dataset. The streamline seeds are initialized randomly in the bounds of the domain and recreated each time one particle dies (time to live – ie, max number of iterations – is reached, out-of-domain or zero velocity).
The UI panel allows to specify:

  • Vectors: the vector field array (mandatory).
  • Alpha: the rate of fading (depends on MaxTimeToLive, 0: no trace, 1: trace will fade as long as TimeToLive).
  • Step Length: the normalized integration step – allow to adjust particle speed.
  • Number Of Particles: the number of simulated particles in the flow.
  • Max Time To Live: the maximum number of iteration a particle moves before it dies.
  • Animate: allow to turn ON or OFF the streamlines animation – when turned OFF, lines will be visible until the camera is changed.

The Color (solid color or depending on a data array, see Figure 2) and Line Width can also be changed using default ParaView UI widgets.

Animation on disk_out_ref.ex2
Figure 2 – disk_out_ref.ex2 dataset with V as Vectors, and Pressure Coloring.

The streamlines are continuously updated implying a infinite rendering loop of the whole view to which to representation belongs.
Technically speaking, we added a new class that observes all pqRenderView. When a rendering on such a view is finished, it checks all existing representations and search for a visible StreamLines representation. If found, a new still render pass is requested.

Known Limitations

  • So far, this new representation only works in local rendering mode – it does not work in parallel.
  • The streamlines are reset when camera settings change: this is a side effect of the efficient rendering mechanism involved here: particle tracks are accumulated in a 2D buffer.  At each time step, new track segments are computed, per particle, between their previous and new position. The final image is a blending new tracks and the image obtained at previous iteration. To make it consistent, this image buffer mechanism assumes a still camera.

How to Test?

Here is an simple way to test this new feature:
1.  Load the plugin “StreamLinesRepresentation”, enable the AutoLoad checkbox for it and restart ParaView (if you don’t, stream lines will not correctly animate).
2. Create a “Wavelet” source. Apply a “Gradient” filter on it.
3. Switch representation from “Outline” to “Stream Lines”.
4. Play with the StreamLines options in the Representation panel.
5. Change the Coloring array – see Figure 3.

 

Figure 3 – RTData Gradients vector field in a Wavelet source.

 

 

Another cool demo is to load the disk_out_ref.ex2 dataset with the V vector point data array – see Figure 1 and 2.

Here is a video capture of those animated streamlines on a “real” case:

 

This work was supported by Total SA.

Developments were done by Kitware SAS, France.

 

Joachim Pouderoux is a Technical Expert at Kitware, France. He is a developer of VTK and ParaView since 2012. His areas of expertise include scientific visualization, computer graphics, interaction techniques, Voronoi meshing and software development.

 

 

 

Bastien Jacquet is a Technical Leader at Kitware, France. Since 2016, he promotes and extends Kitware’s Computer Vision expertise in Europe. He has experience in various Computer Vision subdomains, and he is an expert in 3D Reconstruction and related mathematical tools.

23 comments to New Animated Stream Lines Representation for ParaView 5.3

  1. Hi! Thanks for introducing such a wonderful tool. May I know how can I export the animation for a particular time step?

    1. Alex, as every other plguin you will find it in the “Tools/Manage Plugins…” dialog. Remember that it is prefered to turn the “Auto load” option for it and restart ParaView (otherwise, the animation will not work until you create a new Render View).

  2. Controling line width is possible with the usual “Line Width” representation property. There was a bug in 5.3 release with it but it is working well on 5.4.

  3. Great addition to Paraview! Works well for the disk_out_ref.ex2 data set. However, all of my other data sets seem to disappear as soon as I set the representation to streamlines. Is there a reason for this?

  4. Hello,

    This is really great, I was looking forward to such a capability for paraview! Is there any way this could be made to work continuously while rotating the camera (and not relaunching the process as explained)? Also, can we control speed somehow? Many thanks in advance.

  5. Hello,
    I am afraid this is not possible: this is an image-based technique which rely on the current position of the camera. Using the previous image after a camera change (instead of reseting it) would be possible but very confusing if camera changes too quickly. See for instance the Windy website which shows streamlines with the same kind of approach. Well, it has the same behaviour/limitation.
    Best regards,
    Joachim

    1. Thanks for the fast reply Joachim! Ok I understand this limitation. I would still be curious to try out using the previous image for a slow camera motion, how would you advise me to try that? Thanks again.

      Antoine

      1. Antoine,

        Well you can easily try this by removing this part of this piece of code “|| this->CameraMTime GetMTime()” at line 382 of vtkStreamLinesMapper.cxx.
        Have fun and let me know what you think! 🙂

        Best regards,
        Joachim

    1. Eilo,

      First you have to create an “empty” animation with the target running time with the Animation Panel.
      Then you cannot directly export the animation to gif from ParaView but you can export frames to PNG.
      You will finally use some utilities (like ‘convert’ on Linux) to convert the PNG series to an animated GIF file.

      Best regards,
      Joachim Pouderoux

      1. Hi Joachim, this was several years ago, but I can’t find a way to export pngs with the streamlines ; I only get the “tip” of the streamlines moving. Could you elaborate on this approach ? thanks

  6. Hi Joachim,
    It’s a cool feature in paraview. can we choose a surface or point from where the steamlines originate instead of the whole flowfield

    1. Hi,
      I fear this is not possible so far but this is definitely something that could be done.
      Best,
      Joachim

  7. Hello,

    This is really a beautiful feature, so thanks a lot. It helps greatly in analyzing steady flow fields.

    Do you think it would be a lot a work to allow this feature to work for transient flow fields (so that the particles aren’t reset every time we advance 1 simulation time step)? One of the vtk particle tracking integration schemes could be used. Though I guess it would then only make sense with ‘animate’ switched off. The time in ‘max time to live’ could then correspond to physical time, and the ‘step length’ would be ignored.

    Essentially we would then get the rougly the same behaviour as the lagrangian particle tracking plugin, but without the need for an explicit seed (and without the advanced lagrangian physics etc..).

    I’d be happy to do the work.

    Best regards,
    Christian

  8. Hello! This is extremely interesting. However, when I try to do it for a simple 2D vtk file, I get the error: Unrecognized output type: 3. cannot create output.

    Also, a Gradient filter cannot be imposed on the Wavelet source.

    Is this a bug in Paraview 5.5?

  9. Hello!
    I want to know if there is a way to implement this visualization directly from vtk library in c++.

    Best regards,
    César

Leave a Reply