How do I use three different arrays as components of one vector field?

Many filters that operate on vector fields (e.g., Glyph, Stream Tracer, and so on) expect to operate on an array with three components. Suppose your data set has three separate arrays named “VX”, “VY”, and “VZ” that define a vector field. You cannot provide those three arrays to the Glyph filter. Instead, you will need to do a little work to combine them into a 3-component data array.

One way is to use the Python Calculator filter to make the vector array. To make a new array named “V” that has all three components combined, set the Expression to make_vector(VX, VY, VZ) and the Array Name to V. This filter is available if ParaView is built with Python support, which is true of all the ParaView binaries available for download at www.paraview.org/download.

If you are using a custom-built ParaView that does not have Python support, you can use the Calculator filter instead. Set the Result Array Name to V and the calculator expression to VX*iHat + VY*jHat + VZ*kHat. This filter is available when Python is enabled, so it will also work in that case - the expression is just more complex.

3 Likes

The Merge Vector Components filter provides a simpler way to do this in ParaView 5.10 and above.