[Paraview] programmable access to vector components (via Python)

Fabian Wein fabian.wein at am.uni-erlangen.de
Wed May 23 07:28:45 EDT 2012


I have vector data with 6 elements.

The vector is called 'mechTensor' and I can visualize all components 
and the
magnitude where the components are called XX, YY, ZZ, XY, YZ, XZ. Btw, 
this
is the Voigt notation for stresses and strains.

I do not know, where the component names are assigned, they are not 
defined in
the hdf5 file. Maybe this is done in our proprietary reader but I 
could not
find it there up to now.

I cannot access the components in the calculator. Having the "equation"
"mechTensor_XX" where the string is selected from the Scalars menue, I 
get the error:

"vtkFunctionParser (0x17f8b50): Syntax error: operator expected;  see 
position 12"

I guess that the parser has a problem with the double character after 
the underline ?!

Then I tried the Python Calculator. Here I do not know how to access 
the components.

inputs[0].CellData['mechTensor'][0]

Results in

"Cell array result with 6 components, has only 1 tuples but there are 
2 cells"

I have indeed only two elements, i.e. two times the 6 components vector.

I have a bunch of questions: :)

* am I right with the assumption, that the calculator does not like 
double characters
   after the underline?
* Is this XX, YY, ... coming from Paraview?
* How do I access the vector components via python?
* Where can I find more information about the python interface?

Thanks a lot for your help!

Fabian

P.S.: Same behavior with ParaView 3.10, 3.12 and 3.14


More information about the ParaView mailing list