Bug
In output_converters/anim_to_vtk/src/anim_to_vtk.cpp, the 3×3 tensor
matrix written to the legacy VTK TENSORS block places the yz and zx
components in the wrong off-diagonal positions.
The 6 tensor values read from the anim file are ordered xx,yy,zz,xy,yz,zx
(indices 0..5), as the comment at line 576 correctly states.
A symmetric tensor must be written as:
| xx xy zx | indices | 0 3 5 |
| xy yy yz | --> | 3 1 4 |
| zx yz zz | | 5 4 2 |
But the current code writes index 4 (yz) at position (1,3)/(3,1) and
index 5 (zx) at position (2,3)/(3,2) — they are swapped.
Affected lines
- Solid elements —
anim_to_vtk.cpp:1473-1475
- SPH elements —
anim_to_vtk.cpp:1575-1577 (identical bug)
The 2D shell block (lines 1366-1369) is correct (only 3 components).
Ground truth
The component order is confirmed by the engine's stress-rotation routine
engine/source/output/anim/generate/srota6.F:200-205:
L11=TENS(1) L22=TENS(2) L33=TENS(3) -> xx yy zz
L12=TENS(4) L23=TENS(5) L13=TENS(6) -> xy yz zx
tensor6.F writes TENS(1..6) verbatim into the anim file, so index 4 is
yz and index 5 is zx (= xz).
Suggested fix
In both blocks, swap offsets + 4 and + 5 so the matrix becomes:
// row 1: idx 0, 3, 5
// row 2: idx 3, 1, 4
// row 3: idx 5, 4, 2
Bug
In
output_converters/anim_to_vtk/src/anim_to_vtk.cpp, the 3×3 tensormatrix written to the legacy VTK
TENSORSblock places theyzandzxcomponents in the wrong off-diagonal positions.
The 6 tensor values read from the anim file are ordered
xx,yy,zz,xy,yz,zx(indices 0..5), as the comment at line 576 correctly states.
A symmetric tensor must be written as:
But the current code writes index 4 (
yz) at position (1,3)/(3,1) andindex 5 (
zx) at position (2,3)/(3,2) — they are swapped.Affected lines
anim_to_vtk.cpp:1473-1475anim_to_vtk.cpp:1575-1577(identical bug)The 2D shell block (lines 1366-1369) is correct (only 3 components).
Ground truth
The component order is confirmed by the engine's stress-rotation routine
engine/source/output/anim/generate/srota6.F:200-205:tensor6.FwritesTENS(1..6)verbatim into the anim file, so index 4 isyzand index 5 iszx(=xz).Suggested fix
In both blocks, swap offsets
+ 4and+ 5so the matrix becomes: