Skip to content

Add istlVectorBackend()

Carsten Gräser requested to merge feature/istl-vector-backend into master

This creates a VectorBackend suitable for using nested ISTL vectors as coefficient vector in dune-functions. The returned type is an implementation detail for now. However we may want to make this public also.

This is very close to the old HierarchicVectorWrapper but does not require to pass the coefficient type for termination of the recursive index resolution. Instead indices are resolved as log as the resulting type is not a scalar, i.e., as long as it provides operator[]. To handle the nasty case of scalars encoded as Dune::FieldVector<k,1> this adds [0] as long as needed once the digits of the multi-index are exhausted.

This helps to avoid the nasty atomagic feature of HierarchicVectorWrapper that only worked partially anyway. Onthe other hand, it prohibits using non-scalar coefficients to implement implicitly vector-valued functions. However, this should better be implemented using a power-basis anyway. Users relying on this feature (e.g. for dune-fufem) can still use the old HierarchicVectorWrapper for a transition period. I.e. the goal is to remove the old HierarchicVectorWrapper.

Edited by Carsten Gräser

Merge request reports

Loading