Add a Hellan-Herrmann-Johnson basis
Summary
This merge request adds a HellanHerrmannJohnsonBasis for simplex grids,
including the BasisFactory::hhj() and
BasisFactory::hellanHerrmannJohnson() factories.
The supported scope is deliberately limited to polynomial orders zero through six in dimensions one and two:
- In 2D this is the classical symmetric matrix-valued HHJ element on triangles with continuous normal-normal traces.
- In 1D a symmetric 1-by-1 matrix is a scalar. The implementation uses the scalar Lagrange basis with the double contravariant Piola transformation. This degenerate analogue is useful, for example, in shape-operator discretizations on embedded curves, but is not presented as a standard Symfem HHJ element.
Three-dimensional HHJ elements are mathematically well-defined and are implemented on tetrahedra by Symfem and FIAT. They are outside this merge request because the Dune implementation still needs generated tetrahedral shape functions and globally consistent face-DOF permutations.
Implementation details
- Add reference basis evaluation, double-divergence evaluation, local interpolation, local coefficients, and global DOF assembly.
- Apply the double contravariant Piola transformation, including the scalar 1D case and embedded-grid geometries.
- Orient the edge moments consistently across neighboring triangles.
- Add the expected
evaluateJacobianinterface. It currently reportsDune::NotImplemented, because differentiating the geometry-dependent transformation is not part of this implementation. - Generate the 1D and 2D reference evaluations with
doc/CodeGeneration_HHJ.pyusing the SymfemduneLagrange variant. - Construct generated SPDX annotations at runtime so
reuse lintdoes not interpret them as annotations belonging to the generator itself. - Install the generated
hellanherrmannjohnsonbasis_inc.hhheader. - Test direct and basis-factory construction, global normal-normal continuity, local interpolation duality, and reproduction of constants.
- Add a changelog entry documenting the supported scope.
Follow-up work
- Implement transformed first derivatives instead of throwing from
evaluateJacobian. - Add the tetrahedral reference basis and global face orientation/permutation logic before enabling 3D.
Edited by Simon Praetorius