From: Wolfgang Bangerth Date: Thu, 23 Jul 2015 16:19:47 +0000 (-0500) Subject: Let second_derivative() return a const reference, rather than a value. X-Git-Tag: v8.4.0-rc2~718^2~7 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9314389f1565bac0fa545ee502343a1a55ec9b8e;p=dealii.git Let second_derivative() return a const reference, rather than a value. This function is used in places where we want to get pointers into an array. Make sure that is possible for both the const and the non-const version of the function. (The latter already did this; the former didn't and that wasn't needed, but I need it for a follow-up patch.) --- diff --git a/include/deal.II/fe/mapping_fe_field.h b/include/deal.II/fe/mapping_fe_field.h index 34000afbc7..8324e956f4 100644 --- a/include/deal.II/fe/mapping_fe_field.h +++ b/include/deal.II/fe/mapping_fe_field.h @@ -232,8 +232,8 @@ public: /** * Second derivative of shape function in quadrature point. See above. */ - Tensor<2,dim> second_derivative (const unsigned int qpoint, - const unsigned int shape_nr) const; + const Tensor<2,dim> &second_derivative (const unsigned int qpoint, + const unsigned int shape_nr) const; /** * Second derivative of shape function in quadrature point. See above. @@ -681,7 +681,7 @@ MappingFEField::InternalData::derivative (const unsigned template inline -Tensor<2,dim> +const Tensor<2,dim> & MappingFEField::InternalData::second_derivative (const unsigned int qpoint, const unsigned int shape_nr) const {