Skip to content

Make GeometryType constexpr

Steffen Müthing requested to merge feature/make-geometrytype-constexpr into master

This merge request makes all eligible constructors and members of GeometryType constexpr. I only skipped those functions for which it doesn't make sense (I/O) or is not possible for all supported compilers. The merge request also adds new static factory functions that do the same as the make...() methods, but return a new GeometryType instead, which is much more useful in constexpr context.

The main reason for wanting a GeometryType that works in constexpr context is some code in PDELab that returns the number of DOFs per GeometryType. Being able to call that code constexpr would make it possible to automatically deduce correct ISTL block sizes. Currently, we rely on the user to correctly set the block size, which leads to ugly, silent run time errors that are really hard to debug.

Merge request reports