Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing tensor DG0 to VTK is broken #2298

Closed
massimiliano-leoni opened this issue Jul 28, 2022 · 2 comments
Closed

Writing tensor DG0 to VTK is broken #2298

massimiliano-leoni opened this issue Jul 28, 2022 · 2 comments

Comments

@massimiliano-leoni
Copy link
Contributor

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]

throw std::runtime_error("Unknown tetrahedron layout");

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

const std::uint32_t num_nodes = V.element()->space_dimension() / element_block_size;

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.

@garth-wells
Copy link
Member

Is this still an issue?

@garth-wells
Copy link
Member

No activity, so closing.

@garth-wells garth-wells closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants