]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Mark some member functions of ADHelperScalarFunction as static
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 21 Mar 2019 14:25:24 +0000 (15:25 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 21 Mar 2019 14:26:50 +0000 (15:26 +0100)
include/deal.II/differentiation/ad/ad_helpers.h
source/differentiation/ad/ad_helpers.cc

index 685032fd369e10da8ca65acaba180ff4825a71d8..828ad50c932695d99b9e5bb27a5340e13fcbd10a 100644 (file)
@@ -3233,11 +3233,10 @@ namespace Differentiation
        * corresponding to the column extractor.
        */
       template <typename ExtractorType_Row>
-      typename internal::ScalarFieldGradient<dim,
-                                             scalar_type,
-                                             ExtractorType_Row>::type
-      extract_gradient_component(const Vector<scalar_type> &gradient,
-                                 const ExtractorType_Row &extractor_row) const;
+      static typename internal::
+        ScalarFieldGradient<dim, scalar_type, ExtractorType_Row>::type
+        extract_gradient_component(const Vector<scalar_type> &gradient,
+                                   const ExtractorType_Row &  extractor_row);
 
       /**
        * Extract the function Hessian for a subset of independent variables
@@ -3278,13 +3277,13 @@ namespace Differentiation
        * corresponding to the column extractor.
        */
       template <typename ExtractorType_Row, typename ExtractorType_Col>
-      typename internal::ScalarFieldHessian<dim,
-                                            scalar_type,
-                                            ExtractorType_Row,
-                                            ExtractorType_Col>::type
+      static typename internal::ScalarFieldHessian<dim,
+                                                   scalar_type,
+                                                   ExtractorType_Row,
+                                                   ExtractorType_Col>::type
       extract_hessian_component(const FullMatrix<scalar_type> &hessian,
                                 const ExtractorType_Row &      extractor_row,
-                                const ExtractorType_Col &extractor_col) const;
+                                const ExtractorType_Col &      extractor_col);
 
       /**
        * Extract the function Hessian for a subset of independent variables
@@ -3299,11 +3298,11 @@ namespace Differentiation
        * Hessian matrix because both extractors imply selection of just a
        * single row or column of the matrix.
        */
-      Tensor<0, dim, scalar_type>
+      static Tensor<0, dim, scalar_type>
       extract_hessian_component(
         const FullMatrix<scalar_type> &   hessian,
         const FEValuesExtractors::Scalar &extractor_row,
-        const FEValuesExtractors::Scalar &extractor_col) const;
+        const FEValuesExtractors::Scalar &extractor_col);
 
       /**
        * Extract the function Hessian for a subset of independent variables
@@ -3314,13 +3313,13 @@ namespace Differentiation
        * @f]
        *
        * This function is a specialization of the above for rank-4 symmetric
-       * tensors
+       * tensors.
        */
-      SymmetricTensor<4, dim, scalar_type>
+      static SymmetricTensor<4, dim, scalar_type>
       extract_hessian_component(
         const FullMatrix<scalar_type> &               hessian,
         const FEValuesExtractors::SymmetricTensor<2> &extractor_row,
-        const FEValuesExtractors::SymmetricTensor<2> &extractor_col) const;
+        const FEValuesExtractors::SymmetricTensor<2> &extractor_col);
 
       //@}
 
@@ -3508,7 +3507,7 @@ namespace Differentiation
       ExtractorType_Row>::type
     ADHelperScalarFunction<dim, ADNumberTypeCode, ScalarType>::
       extract_gradient_component(const Vector<scalar_type> &gradient,
-                                 const ExtractorType_Row &  extractor_row) const
+                                 const ExtractorType_Row &  extractor_row)
     {
       // NOTE: The order of components must be consistently defined throughout
       // this class.
@@ -3542,7 +3541,7 @@ namespace Differentiation
     ADHelperScalarFunction<dim, ADNumberTypeCode, ScalarType>::
       extract_hessian_component(const FullMatrix<scalar_type> &hessian,
                                 const ExtractorType_Row &      extractor_row,
-                                const ExtractorType_Col &extractor_col) const
+                                const ExtractorType_Col &      extractor_col)
     {
       using InternalHessian      = internal::ScalarFieldHessian<dim,
                                                            scalar_type,
index 2317f763ded1260ed697f72bd0b0db3d4d42b907..1722791301b5304e1fbefbd01b7d5dd5554c65e2 100644 (file)
@@ -1572,10 +1572,9 @@ namespace Differentiation
            typename ADHelperScalarFunction<dim, ADNumberTypeCode, ScalarType>::
              scalar_type>
     ADHelperScalarFunction<dim, ADNumberTypeCode, ScalarType>::
-      extract_hessian_component(
-        const FullMatrix<scalar_type> &   hessian,
-        const FEValuesExtractors::Scalar &extractor_row,
-        const FEValuesExtractors::Scalar &extractor_col) const
+      extract_hessian_component(const FullMatrix<scalar_type> &   hessian,
+                                const FEValuesExtractors::Scalar &extractor_row,
+                                const FEValuesExtractors::Scalar &extractor_col)
     {
       // NOTE: It is necessary to make special provision for the case when the
       // HessianType is scalar. Unfortunately Tensor<0,dim> does not provide
@@ -1614,7 +1613,7 @@ namespace Differentiation
       extract_hessian_component(
         const FullMatrix<scalar_type> &               hessian,
         const FEValuesExtractors::SymmetricTensor<2> &extractor_row,
-        const FEValuesExtractors::SymmetricTensor<2> &extractor_col) const
+        const FEValuesExtractors::SymmetricTensor<2> &extractor_col)
     {
       // NOTE: The order of components must be consistently defined throughout
       // this class.

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.