My problem is in the Paraview GUI:
Any vector components can be colored by Magnitude, or by components X, Y, Z. However, Is there a way to enforce this labelling to Ux, Uy, Uz (for example), instead of the spatial-centric notation X, Y,Z? (Similary with tensor components: Magnitude,XX, YY, ZZ, etc…)
Thanks in advance,
Jack
mwestphal
(Mathieu Westphal (Kitware))
September 16, 2021, 1:45pm
2
This can be done by setting the component name on the vtk data itself.
You could create a simple programmable filter that would rename the component.
fredrik
(Fredrik Ekre)
January 10, 2022, 4:39pm
3
Do you mean that the component names of vectors/tensors can be set in a VTK file directly? Any pointers to the format specification in that case?
mwestphal
(Mathieu Westphal (Kitware))
January 10, 2022, 4:41pm
4
No I mean programmatically, although that is doable on the file format itself:
https://kitware.github.io/vtk-examples/site/VTKFileFormats/
fredrik
(Fredrik Ekre)
January 10, 2022, 4:56pm
5
Thanks for the link, although I didn’t find anything about label names there. To clarify what I want: I want to put the label names (Ux
, Uy
, Uz
) in the VTK file itself, is that possible?
mwestphal
(Mathieu Westphal (Kitware))
January 11, 2022, 8:27am
6
I’m afraid this is not supported by .vtk files.
fredrik
(Fredrik Ekre)
January 11, 2022, 10:07am
7
I see, thanks. Slightly tangential is there any interest in annotating 2nd order non-symmetric tensors with XX
, YY
, …, just like symmetric tensors? I could not find any discussion about this.
mwestphal
(Mathieu Westphal (Kitware))
January 11, 2022, 10:46am
8
no idea what you mean, sounds unrelated to the discussion at hand. please open your own topic if needed.
mwestphal
(Mathieu Westphal (Kitware))
January 12, 2022, 2:05pm
9
To precise my thinking, this is not supported by .vtk file but very well supported by many other formats, like .vtu/vtp files.
fredrik
(Fredrik Ekre)
January 12, 2022, 2:14pm
10
I see. I was using VTK file as a collective term – I am mostly interested in .vtu
, so maybe that could work then?
mwestphal
(Mathieu Westphal (Kitware))
January 12, 2022, 2:38pm
11
Actually supported by both .vtk and .vtu/vtp:
cname.vtu (2.4 KB)
cname.vtk (528 Bytes)
cname.vtp (3.4 KB)
vtk:
[glow@arch ~/tmp]$ cat cname.vtk
# vtk DataFile Version 5.1
vtk output
ASCII
DATASET POLYDATA
POINTS 1 float
0 0 0
METADATA
INFORMATION 2
NAME L2_NORM_RANGE LOCATION vtkDataArray
DATA 2 0 0
NAME L2_NORM_FINITE_RANGE LOCATION vtkDataArray
DATA 2 0 0
VERTICES 2 1
OFFSETS vtktypeint64
0 1
CONNECTIVITY vtktypeint64
0
POINT_DATA 1
FIELD FieldData 1
Vals 3 1 double
17 13 7
METADATA
COMPONENT_NAMES
name
INFORMATION 2
NAME L2_NORM_RANGE LOCATION vtkDataArray
DATA 2 22.5167 22.5167
NAME L2_NORM_FINITE_RANGE LOCATION vtkDataArray
DATA 2 22.5167 22.5167
vtp/vtu:
[glow@arch ~/tmp]$ cat cname.vtu
<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
<UnstructuredGrid>
<Piece NumberOfPoints="1" NumberOfCells="1" >
<PointData>
<DataArray type="Float64" Name="Vals" NumberOfComponents="3" ComponentName1="name" format="appended" RangeMin="22.516660498" RangeMax="22.516660498" offset="0" >
<InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
<Value index="0">
1 Like
fredrik
(Fredrik Ekre)
January 12, 2022, 5:10pm
12
Perfect, just what I was looking for.