Capture geometry Jacobians by value, not by reference
The methods of the geometry interface that return Jacobians have been changed from returning references to returning values a long time ago.
Merge request reports
Activity
@carsten.graeser , okay?
IMO the change is okay but not needed, due to life time prolongation when binding to
const
references. Also notices that return by value was only made mandatory for geometries of grid entities (that use the interface class in dune-grid). In contrast "free"Geometry
implementations may very well return references to stored values. This is e.g. the case forAffineGeometry::jacobian(Inverse)Transposed
.But I have no idea whether or not saving this copy has any performance impact (probably not).
I see, that's indeed an error. But I doubt that this is allowed with a copy (and may eventually fail if compilers get more strict). The clean way would be to either use
std::decay_t<decltype(jacobianInverseTransposed)>::rows
or define an alias to the geometry and then useGeometry::JacobianInverseTransposed::rows
.