Range value initialization in DiscreteGlobalBasisFunction.
A LocalFunction
of a DiscreteGlobalBasisFunction
evaluates by creating a Range
-value y like so
auto y = Range(0);
before adding up the actual values via the LocalEvaluateVisitor
.
I do not understand why this is not a
Range y(0);
in the first place, as it potentially saves a copy. My actual issue though is, that the semantic Range(0)
does not go well along with some kinds of reasonable ranges.
In particular, vector types that have no constructor which is setting all entries to a scalar fail here (e.g. MultiTypeBlockVector
or BlockVector
-- the latter expects the passed value to be a size argument (though resizeable Range
types are a bad idea here anyway)). I suggest to use
Range y;
y = 0;
instead.