I noticed that the hyperelasticity demo saves the Cauchy stress tensor to XDMF as a continuous function while it should in fact be a [tensor-valued] DG0 function. I tried to achieve that by saving to VTK but it complains that [dolfinx/cpp/dolfinx/io/cells.cpp:162]
in function vtk_tetrahedron which is called with num_nodes equal to 1 [which is very suspicious].
This number comes from dolfinx/cpp/dolfinx/io/vtk_utils.cpp:166 which is
with V.element()->space_dimension() and element_block_size both being equal to 9.
Saving only one component to a scalar DG0 VTK file seems to work as expected and the function above is called with num_nodes equal to 4.
The final, and most suspicious, thing I noticed is that at dolfinx/cpp/dolfinx/io/VTKFile.cpp:420, when saving the full tensor-valued sigma, the test if (is_cellwise(*V0)), which I expect should pass for a DG0 function, fails.
I noticed that the hyperelasticity demo saves the Cauchy stress tensor to XDMF as a continuous function while it should in fact be a [tensor-valued] DG0 function. I tried to achieve that by saving to VTK but it complains that [
dolfinx/cpp/dolfinx/io/cells.cpp:162
]in function
vtk_tetrahedron
which is called withnum_nodes
equal to1
[which is very suspicious]. This number comes fromdolfinx/cpp/dolfinx/io/vtk_utils.cpp:166
which iswith
V.element()->space_dimension()
andelement_block_size
both being equal to9
. Saving only one component to a scalar DG0 VTK file seems to work as expected and the function above is called withnum_nodes
equal to4
.The final, and most suspicious, thing I noticed is that at
dolfinx/cpp/dolfinx/io/VTKFile.cpp:420
, when saving the full tensor-valued sigma, the testif (is_cellwise(*V0))
, which I expect should pass for a DG0 function, fails.