There is already automatic naming of 6 component symmetric tensor like this: "XX", "YY", "ZZ", "XY", "YZ", "XZ"
But it appears that there is no such standard for 9 component tensor, and that even this 6 component mapping could also be considered without any standard.
I personally donāt think the specific ordering is very important as long as it is documented. If the chosen order is clearly documented it is after all very easy to do the permutation when doing the export.
The current situation is that you need to consult the application that produced the VTK file to find which order is used (even in the case of symmetric tensors). Quite likely they simply export in the order of internal storage of these tensors, which might not necessarily be the same as the convention used in ParaView, and then the existing labeling might be wrong. This is what our code used to do until recently Ferrite-FEM/Ferrite.jl#383. Before this patch tensors where exported in the storage order of the tensors library so in this case ParaView āmislabeledā the data.
I think that, if ParaView picks a order, any order, then applications can adjust to this quite easily when exporting the data, as in the linked pull request above.
I personally donāt think the specific ordering is very important as long as it is documented.
The problem is that as soon as your changes is merged, users using a different convention will be presented with misleading component labels instead of the neutral numbering we have now.
True, but that is already the case for symmetric tensors ā just because ParaView adds labels there is no guarantee that the exporter used that ordering.
I agree, and I mean to say that maybe the automatic naming of symmetric tensor is already confusing people. I added the naming some years ago thinking it was considered standard.
Right, and I would be perfectly fine if the existing labeling of symmetric tensors were removed.
Probably the best thing would be for the exporter to include ordering or custom labels as metadata in the VTK file, and then ParaView would look that up (defaulting to enumeration). But perhaps that is not currently possible.
Iāve answered there to be more precise, but since this is supported by the vtkDataArray api, it is a matter of file formats, not VTK/ParaView directly.
The solution given in Data array multi-component labelling - #11 by mwestphal is perfect for me. Perhaps the automatic labeling should be removed then, and users can put names in the file itself such that the information in the file is complete without having to look at the order of the exporter.
I would have thought ordering by indicial notation (Ī¾ij) would be the most logical.
(Ī¾11, Ī¾12, Ī¾13, Ī¾21, Ī¾22, Ī¾23, Ī¾31, Ī¾32, Ī¾33) <==> (XX XY XZ YX YY YZ ZX ZY ZZ)
although for a symmetric tensor I would expect
XX YY ZZ XY YZ ZX
Alternatively you could always show 9 components regardless of symmetry.
I agree. No matter what choice is made by ParaView you can not be sure that it matches the ordering used for the export. This is already the case with the symmetric matrices. Since it is possible to encode custom names in the file, maybe it is better to point to that, and completely remove automatic naming (also for the existing symmetric case).
For my own case, I have already now implemented custom naming in the file exporter I use, so personally I donāt really have an interest in the automatic naming now since I can encode it directly in the file.
Indeed, the right resolution for this could be a filter that lets user set the names of the components, ideally with a default naming scheme based on the number of components.
Well, I think we will not change anything and just close your MR unless someone as other inputs.