Cleanup MultiIndex generation and use
In order to support hybrid (i.e. runtime-sized) multi-indices, the PowerPreBasis
and CompositePrebasis
currently rely on using ReservedVector
as MultiIndex
. The allocated size is determined automatically using *PreBasisFactory::requiredMultiIndexSize
and the determined MultiIndex
type is forwarded to all involved PreBasis
instances as template parameter. This has a severe drawback: For uniform (i.e. with statically known size) multi-indices, you cannot use a statically sized MultiIndex
like std::array
. The reason for this is that PowerPreBasis
and CompositePrebasis
need to know the size of the multi-indices generated by its children while constructing the final exported multi-indices.
Storing this size the way ReservedVector
does it is most natural.
As a remedy I propose the following changes:
- Rename
*PreBasisFactory::requiredMultiIndexSize
to*PreBasisFactory::maxMultiIndexSize
and add*PreBasisFactory::minMultiIndexSize
. This allows to detect uniform multi-indices. - Allow different types for stored and exported multi-indices. Using
ReservedVector
for caching allows to build multi-indices as outlined above. For uniform multi-indices the statically sized internal array is better suited.
In order to implement this we have to:
- Remove/ignore
MultiIndex
template parameter from*PreBasis
and*NodeIndexSet
. The type of the stored multi-index can be deduced in theindices()
method and the type of the exportet multi-indices is not needed. - Add template parameters
CachedMultiIndex
andMultiIndex
toDefaultNodalBasis
andDefaultLocalIndexSet
and let them decay multi-indices from the cached to the exported type automatically. - As an alternative: Pass
minMultiIndexSize
andmaxMultiIndexSize
toDefaultNodalBasis
and hard-wire appropriateCachedMultiIndex
andMultiIndex
types.