Hello, when using TemporalParticlesToPathlines, is there a way to color the pathlines by velocity, as is an option for the StreamTracer filter?

The paths are pre-computed by the solver, so only their positions are read by paraview. The local velocity field is available if interpolating it is an option. It also would be easy to compute the local velocity with finite differences, but then I would need to somehow assign that velocity to the pathline.

This can be accomplished with python vtk by adding the velocity field to particle data using a snippet like the following. After reading the files that contain positions to data1 and data2, call

to add a field “velocity” to the data. Here this is a simple first order finite difference for the time derivative, but more sophisticated options could also be used. Then write a new vtu with data2, and upon reading in Paraview, the magnitude of velocity can be used to color the pathlines. Note that “numpy_support” is loaded from with “from vtk.util import numpy_support”.