]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Force inlining in several kinematics functions
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 29 Jul 2019 16:12:40 +0000 (18:12 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 30 Jul 2019 07:27:37 +0000 (09:27 +0200)
include/deal.II/physics/elasticity/kinematics.h

index e2160999711ff9ec76b111e70dff3d3e993d0c87..319a6644ef58908d0438d349c3203f96bdf722bb 100644 (file)
@@ -277,8 +277,8 @@ namespace Physics
 
 
 template <int dim, typename Number>
-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<dim>::I + Grad_u;
 }
@@ -286,8 +286,8 @@ Physics::Elasticity::Kinematics::F(const Tensor<2, dim, Number> &Grad_u)
 
 
 template <int dim, typename Number>
-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 <int dim, typename Number>
-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<Number>::value(
            std::pow(determinant(F), 1.0 / dim)) *
@@ -307,8 +307,8 @@ Physics::Elasticity::Kinematics::F_vol(const Tensor<2, dim, Number> &F)
 
 
 template <int dim, typename Number>
-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 <int dim, typename Number>
-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 <int dim, typename Number>
-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<Number>::value(0.5) *
          (C(F) - static_cast<SymmetricTensor<2, dim, Number>>(
@@ -336,8 +336,8 @@ Physics::Elasticity::Kinematics::E(const Tensor<2, dim, Number> &F)
 
 
 template <int dim, typename Number>
-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 <int dim, typename Number>
-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<Number>::value(0.5) *

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.