From 461bf46c07f747b64c60379431ada73dd3cb1a3d Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Thu, 21 Mar 2019 15:25:24 +0100 Subject: [PATCH] Mark some member functions of ADHelperScalarFunction as static --- .../deal.II/differentiation/ad/ad_helpers.h | 33 +++++++++---------- source/differentiation/ad/ad_helpers.cc | 9 +++-- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/include/deal.II/differentiation/ad/ad_helpers.h b/include/deal.II/differentiation/ad/ad_helpers.h index 685032fd36..828ad50c93 100644 --- a/include/deal.II/differentiation/ad/ad_helpers.h +++ b/include/deal.II/differentiation/ad/ad_helpers.h @@ -3233,11 +3233,10 @@ namespace Differentiation * corresponding to the column extractor. */ template - typename internal::ScalarFieldGradient::type - extract_gradient_component(const Vector &gradient, - const ExtractorType_Row &extractor_row) const; + static typename internal:: + ScalarFieldGradient::type + extract_gradient_component(const Vector &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 internal::ScalarFieldHessian::type + static typename internal::ScalarFieldHessian::type extract_hessian_component(const FullMatrix &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 & 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 & 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:: extract_gradient_component(const Vector &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:: extract_hessian_component(const FullMatrix &hessian, const ExtractorType_Row & extractor_row, - const ExtractorType_Col &extractor_col) const + const ExtractorType_Col & extractor_col) { using InternalHessian = internal::ScalarFieldHessian:: scalar_type> ADHelperScalarFunction:: - extract_hessian_component( - const FullMatrix & hessian, - const FEValuesExtractors::Scalar &extractor_row, - const FEValuesExtractors::Scalar &extractor_col) const + extract_hessian_component(const FullMatrix & 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 & 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. -- 2.39.5