Issues with VTK TENSORS6

  • We are told that VTK/Legacy is deprecated, but what would be an alternative for someone who does not have much time to figure out how to create a dataset from say Matlab)= for his own finite element code)?

  • I am baffled by an error I get when trying to define a tensor (Error reading ascii data. Possible mismatch of datasize with declaration.)

# vtk DataFile Version 3.0
Increment No. 2 
ASCII
DATASET UNSTRUCTURED_GRID
POINTS  12 float
0.000000e+00 0.000000e+00 0.000000e+00
1.000000e+00 0.000000e+00 0.000000e+00
1.000000e+00 1.000000e+00 0.000000e+00
0.000000e+00 1.000000e+00 0.000000e+00
0.000000e+00 0.000000e+00 2.000000e+00
1.000000e+00 0.000000e+00 2.000000e+00
1.000000e+00 1.000000e+00 2.000000e+00
0.000000e+00 1.000000e+00 2.000000e+00
0.000000e+00 0.000000e+00 1.000000e+00
1.000000e+00 0.000000e+00 1.000000e+00
1.000000e+00 1.000000e+00 1.000000e+00
0.000000e+00 1.000000e+00 1.000000e+00
CELLS 2 18
     8     5     6     9    10     4     7     8    11
     8     9    10     1     2     8    11     0     3
CELL_TYPES 2
    11
    11
CELL_DATA      2
SCALARS CELL_SCALARS INT 1
LOOKUP_TABLE default
1
7
POINT_DATA   12
TENSORS6 Cauchy_Stress float
LOOKUP_TABLE default
3.132000e+00 3.327000e-16 3.296000e-01 
3.327000e-16 3.132000e+00 3.296000e-01 
3.296000e-01 3.296000e-01 2.044000e+01 
3.132000e+00 5.132000e-16 -3.296000e-01 
4.132000e-16 3.132000e+00 3.296000e-01 
-3.296000e-01 3.296000e-01 2.044000e+01 
3.132000e+00 8.566000e-17 -3.296000e-01 
8.566000e-17 3.132000e+00 -3.296000e-01 
-3.296000e-01 -3.296000e-01 2.044000e+01 
3.132000e+00 -4.398000e-18 3.296000e-01 
-4.398000e-18 3.132000e+00 -3.296000e-01 
3.296000e-01 -3.296000e-01 2.044000e+01 
-6.991000e-02 -4.694000e-17 -6.991000e-02 
-4.694000e-17 -6.991000e-02 -6.991000e-02 
-6.991000e-02 -6.991000e-02 2.009000e+01 
-6.991000e-02 -2.851000e-16 6.991000e-02 
-2.851000e-16 -6.991000e-02 -6.991000e-02 
6.991000e-02 -6.991000e-02 2.009000e+01 
-6.991000e-02 -8.146000e-16 6.991000e-02 
-8.146000e-16 -6.991000e-02 6.991000e-02 
6.991000e-02 6.991000e-02 2.009000e+01 
-6.991000e-02 -5.687000e-16 -6.991000e-02 
-5.687000e-16 -6.991000e-02 6.991000e-02 
-6.991000e-02 6.991000e-02 2.009000e+01 
1.997000e-01 5.649000e-16 1.298000e-01 
5.649000e-16 1.997000e-01 1.298000e-01 
1.298000e-01 1.298000e-01 1.973000e+01 
1.997000e-01 6.355000e-16 -1.298000e-01 
6.355000e-16 1.997000e-01 1.298000e-01 
-1.298000e-01 1.298000e-01 1.973000e+01 
1.997000e-01 -9.796000e-17 -1.298000e-01 
-9.796000e-17 1.997000e-01 -1.298000e-01 
-1.298000e-01 -1.298000e-01 1.973000e+01 
1.997000e-01 -1.632000e-16 1.298000e-01 
-1.632000e-16 1.997000e-01 -1.298000e-01 
1.298000e-01 -1.298000e-01 1.973000e+01

VTK format is legacy, not deprecated.

XML VTK format is the alternative.

All information are here:
https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf

Thanks, VTK I get it (despite a lingering error in defining TENSORS6), but the “legacy” adjective is somehow ominous and as such have been looking at VTU. However I could not find a documentation on how to write the VTU file.

Having said that where would i find documentation on how to write (from Matlab) an XML VTK file (btw is this the same as VTU)?

thanks

victor

The documentation is in the link I provided.

.vtk and .vtu are not the same at all, the first is the legacy format you know, .vtu is the XML based format to store unstructured grid.

Oops sorry, you are right, but is there an advantage of using VTU/XML format over the vtk one?

And may I please ask your input on the TENSOR6 issue I am having (might be something simple/obvious, but I just do not get it).

thanks

Yes, the XML format are much more flexible et generally faster.

No idea about your tensor issue. Here is an example of a tensor file in .vtk format that is working perfectly. symTensor.vtk (925 Bytes)