Assigning Multiple Tensors to a Point

Hi everyone,

I am using VTK to generate .vtu files from Java to use them in ParaView.

I am trying to use polyData.GetPointData().SetTensors(stress)
polyData.GetPointData().SetTensors(strain)
where polyData is a variable of vtkPolyData type, and stress and strain are of type vtkDoubleArray with 9 components.

But I notice that in the .vtu file generated there is only one Tensor written, and indeed the last one assigned, i.e. strain in this case.

Is there some other way to do this?
Any help is appreciated. Thanks a lot, and stay safe!

Regards,
Sharan

You can use

polyData.GetPointData().AddArray(stress1)
polyData.GetPointData().AddArray(stress2)
polyData.GetPointData().SetActiveTensors(“Stress 1”)

instead.

This worked perfectly, thanks a lot!