<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Fabin,<br>
<br>
It appears to me you have found a limitation (or bug?) in the
Calculator filter. My comments are inserted below.<br>
<br>
Sam Key<br>
<br>
On 5/24/2012 2:32 AM, Fabian Wein wrote:
<blockquote cite="mid:4FBDF204.2070705@am.uni-erlangen.de"
type="cite">Hi Sam,
<br>
<br>
thanks for your reply.
<br>
<br>
The ensight file canot be read:
<br>
<br>
vtkPGenericEnSightReader (0x1e74fc0): Assuming binary file</blockquote>
<br>
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.<br>
<br>
<blockquote cite="mid:4FBDF204.2070705@am.uni-erlangen.de"
type="cite">
<br>
<br>
But as far as I understand, the XX, ... comes from Paraview ?!
<br>
</blockquote>
<br>
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.<br>
<br>
<blockquote cite="mid:4FBDF204.2070705@am.uni-erlangen.de"
type="cite">
<br>
Can you apply Stress_XX in the calculator?</blockquote>
<br>
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<br>
<br>
<span style=" font-family:'Courier'; font-size:7.8pt;
color:#800000;">ERROR: In
..\..\..\..\src\VTK\Common\vtkFunctionParser.cxx, line 1480</span>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-family:'Courier'; font-size:7.8pt; color:#800000;">vtkFunctionParser
(000000000C52E8B0): Syntax error: operator expected; see
position 9</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px; font-family:'Courier';
font-size:7.8pt; color:#800000;"><br>
</p>
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. <br>
<br>
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"?
<br>
<br>
<blockquote cite="mid:4FBDF204.2070705@am.uni-erlangen.de"
type="cite">
<br>
<br>
I converted my file to VTK and it appears that Paraview adds the
XX, ...
<br>
BTW, this Voigt interpretation is in my case the wrong
interpretation.
<br>
My 6-element vector is neither stress nor strain but the upper
part of a
<br>
3x3 Voigt elasticity tensor.
<br>
</blockquote>
<br>
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?<br>
<br>
For what it is worth, my own coding for a VTK XML-formatted results
file I have the following<br>
<br>
!!<br>
!! Start vtk "CellData" data.<br>
!!<br>
WRITE (IO_UNIT%LVTO,'(A)') '<CellData
Tensors="Stress" Scalars="Material">'<br>
!!<br>
!! Write element-based (cell) stress data to VTK Data File.<br>
!! The retrieval function STRESS_DATA( element_n, component_i ) is
used <br>
!! with the following stress-component retrieval pattern to produce
the<br>
!! the stress-component pattern expected by ParaView (PV):<br>
!! ( 1 4 5 ) ( xx xy xz ) ( 1 2 3 )<br>
!! Fma-3D Indices => ( 4 2 6 ) = ( yx yy yz ) = ( 4 5 6 ) <=
PV Indices<br>
!! ( 5 6 3 ) ( zx zy zz ) ( 7 8 9 )<br>
!!<br>
WRITE(IO_UNIT%LVTO,'(2X,A)')'<DataArray
type="Float32" Name="Stress" NumberOfComponents="9"
format="ascii">'<br>
Lbgn = 1<br>
Lend = LREMAIN<br>
DO i = 1,LBLOCKS+1<br>
WRITE(IO_UNIT%LVTO,'((6(1PE15.7)))') <br>
& ((/
STRESS_DATA(NELUSED(L),1),STRESS_DATA(NELUSED(L),4),STRESS_DATA(NELUSED(L),5),<br>
&
STRESS_DATA(NELUSED(L),4),STRESS_DATA(NELUSED(L),2),STRESS_DATA(NELUSED(L),6),<br>
&
STRESS_DATA(NELUSED(L),5),STRESS_DATA(NELUSED(L),6),STRESS_DATA(NELUSED(L),3)
/), L = Lbgn,Lend)<br>
Lbgn = Lend + 1<br>
Lend = Lend + LBCOUNT<br>
ENDDO<br>
WRITE(IO_UNIT%LVTO,'(2X,A)')'</DataArray>'<br>
<br>
<blockquote cite="mid:4FBDF204.2070705@am.uni-erlangen.de"
type="cite">This seems to be a Bug ?!
<br>
<br>
Fabian
<br>
<br>
<br>
On 05/23/2012 04:11 PM, Samuel Key wrote:
<br>
<blockquote type="cite">Greetings Fabian,
<br>
</blockquote>
<br>
<blockquote type="cite">ParaView using its EnSight
binary-formatted results reader accepts
<br>
symmetric second-order tensor node/cell variables with a
user-assigned
<br>
name. I have attached an EnSight "case" file so you can see how
it is
<br>
done. The EnSight "case" file is an ASCII-text file that
contains a
<br>
file table of contents, user-assigned variable names, time-step
<br>
values, and "directions" on the relationship between the files
in
<br>
order to know what to read when.
<br>
<br>
I checked one of my EnSight data sets and Stress appears in the
<br>
calculator with the "scaler" components Stress_XX, Stress_XY,
<br>
Stress_XZ, Stress_YY, ...
<br>
<br>
I hope this helps; I know you are not looking to change your
results
<br>
file format, but I can supply you with Fortran-90/95 routines
that
<br>
output simulation results in an EnSight "Gold" binary format.
<br>
<br>
By the way, the EnSight reader in ParaView supports polyhedral
finite
<br>
elements -- and it works; I also use the EnSight
"part"-construct to
<br>
output the results by-material.
<br>
<br>
Sam Key
<br>
<br>
On 5/23/2012 5:28 AM, Fabian Wein wrote:
<br>
<blockquote type="cite">I have vector data with 6 elements.
<br>
<br>
The vector is called 'mechTensor' and I can visualize all
components
<br>
and the
<br>
magnitude where the components are called XX, YY, ZZ, XY, YZ,
XZ.
<br>
Btw, this
<br>
is the Voigt notation for stresses and strains.
<br>
<br>
I do not know, where the component names are assigned, they
are not
<br>
defined in
<br>
the hdf5 file. Maybe this is done in our proprietary reader
but I
<br>
could not
<br>
find it there up to now.
<br>
<br>
I cannot access the components in the calculator. Having the
"equation"
<br>
"mechTensor_XX" where the string is selected from the Scalars
menue,
<br>
I get the error:
<br>
<br>
"vtkFunctionParser (0x17f8b50): Syntax error: operator
expected; see
<br>
position 12"
<br>
<br>
I guess that the parser has a problem with the double
character
<br>
after the underline ?!
<br>
<br>
Then I tried the Python Calculator. Here I do not know how to
access
<br>
the components.
<br>
<br>
inputs[0].CellData['mechTensor'][0]
<br>
<br>
Results in
<br>
<br>
"Cell array result with 6 components, has only 1 tuples but
there
<br>
are 2 cells"
<br>
<br>
I have indeed only two elements, i.e. two times the 6
components
<br>
vector.
<br>
<br>
I have a bunch of questions:
<br>
<br>
* am I right with the assumption, that the calculator does not
like
<br>
double characters
<br>
after the underline?
<br>
* Is this XX, YY, ... coming from Paraview?
<br>
* How do I access the vector components via python?
<br>
* Where can I find more information about the python
interface?
<br>
<br>
Thanks a lot for your help!
<br>
<br>
Fabian
<br>
<br>
P.S.: Same behavior with ParaView 3.10, 3.12 and 3.14
<br>
</blockquote>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the ParaView Wiki at: <a class="moz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a>
</pre>
</blockquote>
</body>
</html>