Is it possible to create a 6- or 9-array for Tensor Glyph from 1-arrays?

In the dataset provided below I have individual arrays for the six components of the symmetric stress tensor. The code (MOOSE) used to create this dataset does not have the ability (to best of my knowledge) to output the values in a single data array. I’d like to use the Tensor Glyphs filter in ParaView, but can’t seem to figure out how to use ParaView filters to create the 6-component array.

I know that I can use the Calculator filter to create a 3-component array:

disp_x * iHat + disp_y * jHat + disp_z * kHat

or via the MergeVectorComponents filter, so I’m wondering if there are similar tricks for 6- or 9-component arrays.

Link to files: http://transfer.coreform.com/get/UaH9W/nist.tar.gz

EDIT: uploaded wrong files, added screenshots

One way is to use the programmable filter Check the “Create Tensor” section of this tutorial
https://docs.paraview.org/en/latest/Tutorials/ClassroomTutorials/PythonAndBatchPythonCalculatorProgrammableSourceAndFilter.html#programmable-filter

You can also use the main formula
numpy.vstack([xx,yy,zz,xy, yz, xz]).transpose()

into the Python Calculator

Thanks @Christos_Tsolakis – that was very handy.

1 Like