From: Timo Heister Date: Tue, 24 Sep 2019 18:05:20 +0000 (-0400) Subject: kinematics.h: fix always_inline X-Git-Tag: v9.2.0-rc1~1002^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adfc4876366f3192b54b494f2b89ad784bdffb47;p=dealii.git kinematics.h: fix always_inline - put function annotation in declaration - fixes #8757 --- diff --git a/include/deal.II/physics/elasticity/kinematics.h b/include/deal.II/physics/elasticity/kinematics.h index 319a6644ef..87418a0695 100644 --- a/include/deal.II/physics/elasticity/kinematics.h +++ b/include/deal.II/physics/elasticity/kinematics.h @@ -70,8 +70,8 @@ namespace Physics * @dealiiHolzapfelA{71,2.39} */ template - Tensor<2, dim, Number> - F(const Tensor<2, dim, Number> &Grad_u); + DEAL_II_ALWAYS_INLINE Tensor<2, dim, Number> + F(const Tensor<2, dim, Number> &Grad_u); /** * Return the isochoric counterpart of the deformation gradient @@ -86,8 +86,8 @@ namespace Physics * @dealiiHolzapfelA{228,6.79} */ template - Tensor<2, dim, Number> - F_iso(const Tensor<2, dim, Number> &F); + DEAL_II_ALWAYS_INLINE Tensor<2, dim, Number> + F_iso(const Tensor<2, dim, Number> &F); /** * Return the volumetric counterpart of the deformation gradient @@ -102,8 +102,8 @@ namespace Physics * @dealiiHolzapfelA{228,6.79} */ template - SymmetricTensor<2, dim, Number> - F_vol(const Tensor<2, dim, Number> &F); + DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> + F_vol(const Tensor<2, dim, Number> &F); /** * Return the symmetric right Cauchy-Green deformation tensor, @@ -117,8 +117,8 @@ namespace Physics * @dealiiHolzapfelA{78,2.65} */ template - SymmetricTensor<2, dim, Number> - C(const Tensor<2, dim, Number> &F); + DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> + C(const Tensor<2, dim, Number> &F); /** * Return the symmetric left Cauchy-Green deformation tensor, @@ -132,8 +132,8 @@ namespace Physics * @dealiiHolzapfelA{81,2.79} */ template - SymmetricTensor<2, dim, Number> - b(const Tensor<2, dim, Number> &F); + DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> + b(const Tensor<2, dim, Number> &F); //@} @@ -155,8 +155,8 @@ namespace Physics * @dealiiHolzapfelA{79,6.29} */ template - SymmetricTensor<2, dim, Number> - E(const Tensor<2, dim, Number> &F); + DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> + E(const Tensor<2, dim, Number> &F); /** * Return the symmetric small strain tensor, @@ -175,8 +175,8 @@ namespace Physics * @dealiiWriggersA{24,3.17} */ template - SymmetricTensor<2, dim, Number> - epsilon(const Tensor<2, dim, Number> &Grad_u); + DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> + epsilon(const Tensor<2, dim, Number> &Grad_u); /** * Return the symmetric Almansi strain tensor, @@ -191,8 +191,8 @@ namespace Physics * @dealiiHolzapfelA{81,2.83} */ template - SymmetricTensor<2, dim, Number> - e(const Tensor<2, dim, Number> &F); + DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> + e(const Tensor<2, dim, Number> &F); //@} @@ -277,8 +277,8 @@ namespace Physics template -inline DEAL_II_ALWAYS_INLINE Tensor<2, dim, Number> - Physics::Elasticity::Kinematics::F(const Tensor<2, dim, Number> &Grad_u) +inline Tensor<2, dim, Number> +Physics::Elasticity::Kinematics::F(const Tensor<2, dim, Number> &Grad_u) { return StandardTensors::I + Grad_u; } @@ -286,8 +286,8 @@ inline DEAL_II_ALWAYS_INLINE Tensor<2, dim, Number> template -inline DEAL_II_ALWAYS_INLINE Tensor<2, dim, Number> - Physics::Elasticity::Kinematics::F_iso(const Tensor<2, dim, Number> &F) +inline Tensor<2, dim, Number> +Physics::Elasticity::Kinematics::F_iso(const Tensor<2, dim, Number> &F) { return std::pow(determinant(F), -1.0 / dim) * F; } @@ -295,8 +295,8 @@ inline DEAL_II_ALWAYS_INLINE Tensor<2, dim, Number> template -inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> - Physics::Elasticity::Kinematics::F_vol(const Tensor<2, dim, Number> &F) +inline SymmetricTensor<2, dim, Number> +Physics::Elasticity::Kinematics::F_vol(const Tensor<2, dim, Number> &F) { return internal::NumberType::value( std::pow(determinant(F), 1.0 / dim)) * @@ -307,8 +307,8 @@ inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> template -inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> - Physics::Elasticity::Kinematics::C(const Tensor<2, dim, Number> &F) +inline SymmetricTensor<2, dim, Number> +Physics::Elasticity::Kinematics::C(const Tensor<2, dim, Number> &F) { return symmetrize(transpose(F) * F); } @@ -316,8 +316,8 @@ inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> template -inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> - Physics::Elasticity::Kinematics::b(const Tensor<2, dim, Number> &F) +inline SymmetricTensor<2, dim, Number> +Physics::Elasticity::Kinematics::b(const Tensor<2, dim, Number> &F) { return symmetrize(F * transpose(F)); } @@ -325,8 +325,8 @@ inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> template -inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> - Physics::Elasticity::Kinematics::E(const Tensor<2, dim, Number> &F) +inline SymmetricTensor<2, dim, Number> +Physics::Elasticity::Kinematics::E(const Tensor<2, dim, Number> &F) { return internal::NumberType::value(0.5) * (C(F) - static_cast>( @@ -336,8 +336,8 @@ inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> template -inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> - Physics::Elasticity::Kinematics::epsilon(const Tensor<2, dim, Number> &Grad_u) +inline SymmetricTensor<2, dim, Number> +Physics::Elasticity::Kinematics::epsilon(const Tensor<2, dim, Number> &Grad_u) { // This is the equivalent to 0.5*symmetrize(Grad_u + transpose(Grad_u)); return symmetrize(Grad_u); @@ -346,8 +346,8 @@ inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> template -inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> - Physics::Elasticity::Kinematics::e(const Tensor<2, dim, Number> &F) +inline SymmetricTensor<2, dim, Number> +Physics::Elasticity::Kinematics::e(const Tensor<2, dim, Number> &F) { const Tensor<2, dim, Number> F_inv = invert(F); return internal::NumberType::value(0.5) *