Inconsistency in handing of tensor data in EXODUS II reader/writer
Reader and writer of EXODUS II format in VTK use inconsistent orderings of tensor components.
When EXODUS II file is read, VTK attempts to glom names of components. For symmetric 3D rank-2 tensors VTK expects EXODUS variables with sequential numbers named as "...XX, YY, ZZ, XY, XZ, YZ" (variable endST23 in file vtkExodusIIReader.
However, the same components of a tensor are written in another order by VTK EXODUS II writer: "... XX, XY, XZ, YY, YZ, ZZ" in file vtkExodusIIWriter.
The problems are following:
- The components are either read or written under the wrong names.
- Tensors written by vtkExodusIIWriter cannot be glommed back, because the order of sequentially numbered EXODUS variables is different from the expected one.
- Expecting sequentially numbered variables to form components of one tensor in fixed order violates the spirit of EXODUS II data model. It would be better to just check the existence of names looking like NAMEXX, NAMEYY, etc and glom together that variables.
I have prepared test EXODUS II file el1.ex2 and its CDL source el1.txt. It contains one 1st order tetrahedron with vector and tensor nodal and element variables.
If I open el1.ex2 in ParaView, it shows me correctly the contents of variables. The components of both vectors and tensors are glommed together. Everything is OK. When I save the data in EXODUS II format, I obtain the file el2.ex2 which dump is el2.txt. As I can see from the dump, the components of tensor variables are get mixed up. Moreover, If I open the saved file el2.ex2 in ParaView, I see that that tensor components are not glommed correctly anymore.