]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let second_derivative() return a const reference, rather than a value.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Jul 2015 16:19:47 +0000 (11:19 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 26 Jul 2015 14:16:07 +0000 (09:16 -0500)
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.)

include/deal.II/fe/mapping_fe_field.h

index 34000afbc764ea4e63c67ed5c9d3c1e5445f67c2..8324e956f4b474e12dd3b7e9470d3384376cf536 100644 (file)
@@ -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<dim,spacedim,DH,VECTOR>::InternalData::derivative (const unsigned
 
 template <int dim, int spacedim, class DH, class VECTOR>
 inline
-Tensor<2,dim>
+const Tensor<2,dim> &
 MappingFEField<dim,spacedim,DH,VECTOR>::InternalData::second_derivative (const unsigned int qpoint,
     const unsigned int shape_nr) const
 {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.