[Paraview] Tensor from variables

Romain Beucher romain.beucher at unimelb.edu.au
Tue Apr 24 02:24:34 EDT 2018


Hi,

I have a stress field saved as a h5 file that I read using an xdmf file.
The stress is defined as a symmetric tensor XX, YY, XZ and in so is interpreted as a vector with X, Y, Z components.

I would like to visualize the tensors using paraview TensorGlyphs which expects a symmetric tensor with the order XX. YY, ZZ, XY, YZ, XZ.

I tried to apply a programmable to my dataset but without luck...

Here is what I have done:

import numpy as np




data = np.zeros((inputs[0].PointData["projStressField"][0].size, 6))




data[:,0] = inputs[0].PointData["projStressField"][0] # XX

data[:,1] = inputs[0].PointData["projStressField"][1] # YY

data[:,3] = inputs[0].PointData["projStressField"][2] # XY







output.PointData.append(data, "Stress Tensor")




I suspect the shape of my numpy array is wrong... I do get a new variable called "Stress Tensor" but it has components 1..17...






I had a look at https://www.paraview.org/pipermail/paraview/2017-November/041497.html
did not really helped...

Romain

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180424/a181fd13/attachment.html>


More information about the ParaView mailing list