You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this shortcoming while elaborating on the hyperelasticity demo.
There, in the UFL/py file, we export an expression sigma
expressions = [(sigma, [[0.25, 0.25, 0.25]])]
and then create a function space for it via basix with
const basix::FiniteElement S_element =
basix::create_element(family, cell_type, k, variant, discontinuous);
auto S = std::make_shared<fem::FunctionSpace>(fem::create_functionspace(
problem.getMesh(),
S_element,
pow(problem.getMesh()->geometry().dim(), 2)));
Now, since saving a DG0 tensor function is currently unsupported [see https://gitlab.kitware.com/vtk/vtk/-/issues/18458 and https://github.com/FEniCS/dolfinx/issues/2298 ] but -- and I say BUT -- writing a DG1 tensor works with ADIOS2, I thought I'd do that.
Unfortunately, this doesn't work because basix only creates elements with a value shape of {} [see https://github.com/FEniCS/basix/issues/626 ] and then dolfinx mistakenly assigns a vector value shape
// dolfinx/fem/FiniteElement.cpp:266
if (_value_shape.empty() and bs > 1)
_value_shape = {1};
std::transform(_value_shape.cbegin(), _value_shape.cend(),
_value_shape.begin(), [bs](auto s) { return bs * s; }); // is {9}, should be {3, 3}
and ultimately, down the line,
// dolfinx/io/ADIOS2Writers.cpp:91
const int rank = u.function_space()->element()->value_shape().size(); // is 1, should be 2
const std::uint32_t num_comp = std::pow(3, rank); // is 3, should be 9
which eventually yields a segfault in ADIOS2.
So fine, I'll export the function space from UFL instead of creating it with basix:
DG1T = TensorElement("DG", tetrahedron, 1)
elements = [(DG1T)]
but then DG1T is nowhere to be found in the generated code. I see that the element is being exported to the C file but there is no alias or handle to instantiate it.
Ideally I would expect to be able to do something like
auto S = std::make_shared<fem::FunctionSpace>(
fem::create_functionspace(functionspace_DG1T, "", mesh));
The text was updated successfully, but these errors were encountered:
I ran into this shortcoming while elaborating on the hyperelasticity demo.
There, in the UFL/py file, we export an expression
sigma
and then create a function space for it via
basix
withNow, since saving a DG0 tensor function is currently unsupported [see https://gitlab.kitware.com/vtk/vtk/-/issues/18458 and https://github.com/FEniCS/dolfinx/issues/2298 ] but -- and I say BUT -- writing a DG1 tensor works with ADIOS2, I thought I'd do that.
Unfortunately, this doesn't work because
basix
only creates elements with a value shape of{}
[see https://github.com/FEniCS/basix/issues/626 ] and thendolfinx
mistakenly assigns a vector value shapeand ultimately, down the line,
which eventually yields a segfault in ADIOS2.
So fine, I'll export the function space from UFL instead of creating it with
basix
:but then
DG1T
is nowhere to be found in the generated code. I see that the element is being exported to the C file but there is no alias or handle to instantiate it.Ideally I would expect to be able to do something like
The text was updated successfully, but these errors were encountered: