# Issues with VTK TENSORS6

**URL:** https://discourse.paraview.org/t/issues-with-vtk-tensors6/5951
**Category:** ParaView Support
**Tags:** vtk
**Created:** [December 1, 2020, 10:43pm UTC](https://discourse.paraview.org/t/issues-with-vtk-tensors6/5951 "2020-12-01T22:43:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Victor\_Saouma](https://discourse.paraview.org/user_avatar/discourse.paraview.org/victor_saouma/32/4946_2.png) [@Victor\_Saouma](https://discourse.paraview.org/u/Victor_Saouma)
#### Post date: [December 1, 2020, 10:43pm UTC](https://discourse.paraview.org/t/issues-with-vtk-tensors6/5951/1 "2020-12-01T22:43:31Z")

</div>

- 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
```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 2, 2020, 9:53am UTC](https://discourse.paraview.org/t/issues-with-vtk-tensors6/5951/2 "2020-12-02T09:53:36Z")

</div>

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](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf)

---

<div class="post-metadata">

### Author: ![Victor\_Saouma](https://discourse.paraview.org/user_avatar/discourse.paraview.org/victor_saouma/32/4946_2.png) [@Victor\_Saouma](https://discourse.paraview.org/u/Victor_Saouma)
#### Post date: [December 2, 2020, 3:42pm UTC](https://discourse.paraview.org/t/issues-with-vtk-tensors6/5951/3 "2020-12-02T15:42:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 2, 2020, 3:44pm UTC](https://discourse.paraview.org/t/issues-with-vtk-tensors6/5951/4 "2020-12-02T15:44:03Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Victor\_Saouma](https://discourse.paraview.org/user_avatar/discourse.paraview.org/victor_saouma/32/4946_2.png) [@Victor\_Saouma](https://discourse.paraview.org/u/Victor_Saouma)
#### Post date: [December 2, 2020, 3:46pm UTC](https://discourse.paraview.org/t/issues-with-vtk-tensors6/5951/5 "2020-12-02T15:46:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 2, 2020, 4:07pm UTC](https://discourse.paraview.org/t/issues-with-vtk-tensors6/5951/6 "2020-12-02T16:07:48Z")

</div>

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](https://discourse.paraview.org/uploads/short-url/cBSt0BJGFTtG8WiCp8CgRQl6nSf.vtk) (925 Bytes)
