Fabin,

It appears to me you have found a limitation (or bug?) in the Calculator filter.  My comments are inserted below.

Sam Key

On 5/24/2012 2:32 AM, Fabian Wein wrote:
Hi Sam,

thanks for your reply.

The ensight file canot be read:

vtkPGenericEnSightReader (0x1e74fc0): Assuming binary file

Yes, the EnSight Gold format specification is for binary results files; only the "case" file is ASCII text. However, EnSight, if I recall correctly, does have a specification for ASCII text results files, however, I have never used it. I graduated from VTK XML-structured ASCII-text results files to the EnSight binary-formatted specification in order to get compact, manageable file-sets for my modestly large explicit transient dynamic simulations.



But as far as I understand, the XX, ... comes from Paraview ?!

Yes, the "_XX" is appended by ParaView, and for my simulation results, stress is a 3x3 symmetric tensor which is specified in the EnSight "case" file, and the appending of the _XX does not surprise me.


Can you apply Stress_XX in the calculator?

Well, It looks like you have uncovered a limitation (or bug) in the calculator. It is my habit to include Pressure = (Stress_XX + Stress_YY + Stress_ZZ) / 3.0 in my simulation results (it is computed in my simulation software). To answer your question with certainty, I attempted to compute "Pressure" in the calculator using the above formula, and the calculator choked on "(Stress_XX... )" The error message is

ERROR: In ..\..\..\..\src\VTK\Common\vtkFunctionParser.cxx, line 1480

vtkFunctionParser (000000000C52E8B0): Syntax error: operator expected; see position 9


If the error message reflects a "limitation" in the Calculator, then the Calculator only processes scalars and vectors (1st-order tensors), and that in itself is no small accomplishment.

However, the calculator does list Stress_XX, Stress_YY, Stress_ZZ, Stress_XY, Stress_XZ, and Stress_YZ as available cell scalar quantities.  To my way of thinking, the user-requested _expression_ should first be examined for available variable names before examining the operator sequencing?  It would appear that the parsing has a built-in assumption that there will only have appended "_<single-character>" vector component designators like "_X"?



I converted my file to VTK and it appears that Paraview adds the XX, ...
BTW, this Voigt interpretation is in my case the wrong interpretation.
My 6-element vector is neither stress nor strain but the upper part of a
3x3 Voigt elasticity tensor.

I don't understand if your "6-element vector" is the top row of a 6x6 Voigt  matrix representation of the 3x3x3x3 4th-order elasticity tensor or a 3x3 sub-matrix from the 6x6 Voigt matrix? Did you supply your "6-element vector" to ParaView as a 2nd-order tensor?

For what it is worth, my own coding for a VTK XML-formatted results file I have the following

!!
!! Start vtk "CellData" data.
!!
            WRITE (IO_UNIT%LVTO,'(A)') '<CellData Tensors="Stress" Scalars="Material">'
!!
!! Write element-based (cell) stress data to VTK Data File.
!! The retrieval function STRESS_DATA( element_n, component_i ) is used
!! with the following stress-component retrieval pattern to produce the
!! the stress-component pattern expected by ParaView (PV):
!!                   ( 1 4 5 )   ( xx xy xz )   ( 1 2 3 )
!! Fma-3D Indices => ( 4 2 6 ) = ( yx yy yz ) = ( 4 5 6 ) <= PV Indices
!!                   ( 5 6 3 )   ( zx zy zz )   ( 7 8 9 )
!!
            WRITE(IO_UNIT%LVTO,'(2X,A)')'<DataArray type="Float32" Name="Stress" NumberOfComponents="9" format="ascii">'
            Lbgn = 1
            Lend = LREMAIN
            DO i = 1,LBLOCKS+1
              WRITE(IO_UNIT%LVTO,'((6(1PE15.7)))')
     &        ((/ STRESS_DATA(NELUSED(L),1),STRESS_DATA(NELUSED(L),4),STRESS_DATA(NELUSED(L),5),
     &            STRESS_DATA(NELUSED(L),4),STRESS_DATA(NELUSED(L),2),STRESS_DATA(NELUSED(L),6),
     &            STRESS_DATA(NELUSED(L),5),STRESS_DATA(NELUSED(L),6),STRESS_DATA(NELUSED(L),3) /),  L = Lbgn,Lend)
              Lbgn = Lend + 1
              Lend = Lend + LBCOUNT
            ENDDO
            WRITE(IO_UNIT%LVTO,'(2X,A)')'</DataArray>'

This seems to be a Bug ?!

Fabian


On 05/23/2012 04:11 PM, Samuel Key wrote:
Greetings Fabian,

ParaView using its EnSight binary-formatted results reader accepts
symmetric second-order tensor node/cell variables with a user-assigned
name. I have attached an EnSight "case" file so you can see how it is
done. The EnSight "case" file is an ASCII-text file that contains a
file table of contents, user-assigned variable names, time-step
values, and "directions" on the relationship between the files in
order to know what to read when.

I checked one of my EnSight data sets and Stress appears in the
calculator with the "scaler" components Stress_XX, Stress_XY,
Stress_XZ, Stress_YY, ...

I hope this helps; I know you are not looking to change your results
file format, but I can supply you with Fortran-90/95 routines that
output simulation results in an EnSight "Gold" binary format.

By the way, the EnSight reader in ParaView supports polyhedral finite
elements -- and it works; I also use the EnSight "part"-construct to
output the results by-material.

Sam Key

On 5/23/2012 5:28 AM, Fabian Wein wrote:
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



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to