Global interpolate() with vector valued coefficinets is broken
The global interpolate()
function provides support for implicit vector valued coefficients and functions. I.e. one can interpolate a vector valued function into a scalar basis with vector valued coefficients. This was added to provide backward compatibility with the old dune-fufem behavior.
However, this feature is broken for at least 3 years. The interpolate()
method checks if the provided vector supports the VectorBackend
concept and wraps it using istlVectorBackend()
if not but the ISTLVectorBackend
only supports scalar coefficients.
The way this originally worked is subtle: The backend was compatible with plain stl vectors in case of flat indices. This is reflected in the fact that interpolate()
uses vector.resize(sizeInfo(basis))
, where sizeInfo
casts to a plain number. So far vector-valued coefficients would still work. However, the concept requires that the vector supports vector.resize(basis)
directly. Hence plain vectors no longer pass the concept check and are wrapped into ISTLVectorBackend
.
This could theoretically be fixed by relaxing the concept to only require vector.resize(sizeInfo(basis))
. But I strongly advocate to remove this broken feature, because it would only work in very special situations anyway and also causes other problems (e.g. generalization of interpolate to Hermit-elements).