From: Martin Kronbichler Date: Mon, 29 Jul 2019 16:12:40 +0000 (+0200) Subject: Force inlining in several kinematics functions X-Git-Tag: v9.2.0-rc1~1330^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dad9641efdca954219fa318e88269d97aba3408a;p=dealii.git Force inlining in several kinematics functions --- diff --git a/include/deal.II/physics/elasticity/kinematics.h b/include/deal.II/physics/elasticity/kinematics.h index e216099971..319a6644ef 100644 --- a/include/deal.II/physics/elasticity/kinematics.h +++ b/include/deal.II/physics/elasticity/kinematics.h @@ -277,8 +277,8 @@ namespace Physics template -inline Tensor<2, dim, Number> -Physics::Elasticity::Kinematics::F(const Tensor<2, dim, Number> &Grad_u) +inline DEAL_II_ALWAYS_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 @@ Physics::Elasticity::Kinematics::F(const Tensor<2, dim, Number> &Grad_u) template -inline Tensor<2, dim, Number> -Physics::Elasticity::Kinematics::F_iso(const Tensor<2, dim, Number> &F) +inline DEAL_II_ALWAYS_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 @@ Physics::Elasticity::Kinematics::F_iso(const Tensor<2, dim, Number> &F) template -inline SymmetricTensor<2, dim, Number> -Physics::Elasticity::Kinematics::F_vol(const Tensor<2, dim, Number> &F) +inline DEAL_II_ALWAYS_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 @@ Physics::Elasticity::Kinematics::F_vol(const Tensor<2, dim, Number> &F) template -inline SymmetricTensor<2, dim, Number> -Physics::Elasticity::Kinematics::C(const Tensor<2, dim, Number> &F) +inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> + Physics::Elasticity::Kinematics::C(const Tensor<2, dim, Number> &F) { return symmetrize(transpose(F) * F); } @@ -316,8 +316,8 @@ Physics::Elasticity::Kinematics::C(const Tensor<2, dim, Number> &F) template -inline SymmetricTensor<2, dim, Number> -Physics::Elasticity::Kinematics::b(const Tensor<2, dim, Number> &F) +inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> + Physics::Elasticity::Kinematics::b(const Tensor<2, dim, Number> &F) { return symmetrize(F * transpose(F)); } @@ -325,8 +325,8 @@ Physics::Elasticity::Kinematics::b(const Tensor<2, dim, Number> &F) template -inline SymmetricTensor<2, dim, Number> -Physics::Elasticity::Kinematics::E(const Tensor<2, dim, Number> &F) +inline DEAL_II_ALWAYS_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 @@ Physics::Elasticity::Kinematics::E(const Tensor<2, dim, Number> &F) template -inline SymmetricTensor<2, dim, Number> -Physics::Elasticity::Kinematics::epsilon(const Tensor<2, dim, Number> &Grad_u) +inline DEAL_II_ALWAYS_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 @@ Physics::Elasticity::Kinematics::epsilon(const Tensor<2, dim, Number> &Grad_u) template -inline SymmetricTensor<2, dim, Number> -Physics::Elasticity::Kinematics::e(const Tensor<2, dim, Number> &F) +inline DEAL_II_ALWAYS_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) *