Remove NodeIndexSet
The original purpose of the NodeIndexSet
(to encapsulate index computation and potential index caching) has become obsolete, since
- The
PreBasis
provides the globalsize()
method and is thus not orthogonal to the indexing scheme. - The caching of indices is done in the
DefaultLocalView
for some time.
This can also be seen in the current usage pattern: During its bind method the DefaultLocalView
first calls NodeIndexSet::bind
directly followed by NodeIndexSet::indices
. The bound NodeIndexSet
is not used afterwards again.
As a consequence I propose to remove NodeIndexSet
and add PreBasis::indices(tree, begin)
for filling the index cache. The benefit of this would be:
- Less classes to implement.
- Less redirection.
- Cleaner design, since all index computation is collected in a single class (the
PreBasis
). - It reduces state (and side effects), which is always a good idea.
In fact most NodeIndexSets
already forward part of the index computation to a mapper or index set stored in the PreBasis
. The only potential use is to provide temporary storage needed during the index computation. However - up to a single exception - no existing NodeIndexSet
makes use of this. The exception is the BSplineBasis
, whose NodeIndexSet
stores and reuses a std::array<unsigned int,dim>
. This, could easily be a stack variable in the proposed PreBasis::indices
method. In the exceptional case that the index computation would really need nontrivial temporary storage this could still be implemented using a mutable member PreBasis
.