Automate ISTL vector block size computation
This patch enhances the TMP which builds the ISTL vector type from the backend types in the GridFunctionSpace
to automatically detect the natural
block size of leaf spaces from their finite element maps.
In order for this to work, the finite element map must have a member function constexpr static size_type size(GeometryType)
that only returns a single non-zero size for all geometry types which have DOFs attached to them. If a finite element maps fails these requirements and a user tries to apply static blocking without explicitly setting a block size for the leaf space with the problematic finite element map, this is now reported as an error at compile time. In order to detect a default block size, the template parameter on the VectorBackend
now defaults to 0 instead of one. As long as the user does not apply blocking, this is fine as the actual block size is always set to 1 for Blocking::none
, this has not changed.
The user can still override the detection mechanism by explicitly specifying the block size in the VectorBackend
. In that case, we now make sure that the user-specified block size is compatible with the natural block size of the space, i.e. that the natural size is a multiple of the specified size.
As the default for the block size changed, we also to have make sure the experimental GridFunctionSpace for dune-functions doesn't try to create vectors and matrices with block size 0.
There will be a separate MR to update all of the finite element maps.
Fixes #101 (closed).