Skip to content

introduce local DoF mapping to IndexSetDofMapper

Martin Nolte requested to merge feature/generalized-dof-reordering into master

The original IndexSetDofMapper assumed that the degrees of freedom assigned to a subentity are viewed in the same order for all elements containing it.

Unfortunately, the embedding of subentities can be twisted between elements sharing a subentity and Lagrange spaces of higher order did not work, e.g., on ALUGrid. In two space dimensions, Robert fixed the problem by simply reversing the order of the local DoFs, if an edge is twisted w.r.t. a fixed global orientation.

As it turns out, not all local finite elements order their DoFs such that edge twists are resolved by reversing the degrees of freedom. The BDM spaces from dune-localfunctions, for example, always use the same order independent of any twist (they are moments of the normal component, which remain invariant under twists).

To resolve the problem, this patch adds another template argument to the IndexSetDofMapper: a local DoF mapping. The local DoF mapping is responsible for mapping the local degrees of freedom on one subentity to the local degrees of freedom in the element. If reordering is necessary for some reason, it is now up to the developer of the discrete function space to provide a suitable local DoF mapping. For the LagrangeDiscreteFunctionSpace, this local DoF mapping is called LagrangeLocalDofMapping.

Note: By default DoFs are no longer reversed, so that discrete function spaces relying on the Lagrange behavior need to be adapted.

Merge request reports