RFFGen
 All Classes Namespaces Files Functions Typedefs Enumerations Groups
mooneyRivlin.hh
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the C++-library RFFGen. */
4 /* Copyright 2015 Lars Lubkoll */
5 /* */
6 /* RFFGen is free software: you can redistribute it and/or modify */
7 /* it under the terms of the GNU General Public License as published by */
8 /* the Free Software Foundation, either version 3 of the License, or */
9 /* (at your option) any later version. */
10 /* */
11 /* RFFGen is distributed in the hope that it will be useful, */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* GNU General Public License for more details. */
15 /* */
16 /* You should have received a copy of the GNU General Public License */
17 /* along with RFFGen. If not, see <http://www.gnu.org/licenses/>. */
18 /* */
19 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
20 
21 #ifndef RFFGEN_MOONEY_RIVLIN_HH
22 #define RFFGEN_MOONEY_RIVLIN_HH
23 
24 #include <iostream>
25 
26 #include "../../identity.hh"
27 #include "../../LinearAlgebra/strainTensor.hh"
28 #include "../../LinearAlgebra/unitMatrix.hh"
29 #include "../../LinearAlgebra/principalInvariants.hh"
30 #include "../../generate.hh"
31 
37 namespace RFFGen
38 {
44  template < class Matrix , int offset = LinearAlgebra::dimension<Matrix>() >
45  auto incompressibleMooneyRivlin(double c0, double c1, const Matrix& F)
46  {
47  using namespace LinearAlgebra;
48  using I1 = ShiftedFirstPrincipalInvariant<Matrix,offset>;
49  using I2 = ShiftedSecondPrincipalInvariant<Matrix,offset>;
50 
51  return ( c0*I1() + c1*I2() ) << LeftCauchyGreenStrainTensor<Matrix>(F); // function definition
52  }
53 
54 
60  template <class InflationPenalty, class CompressionPenalty, class Matrix , int offset = LinearAlgebra::dimension<Matrix>() >
61  auto compressibleMooneyRivlin(double c0, double c1, double d0, double d1, const Matrix& F)
62  {
63  using namespace LinearAlgebra;
64  using I1 = ShiftedFirstPrincipalInvariant<Matrix,offset>;
65  using I2 = ShiftedSecondPrincipalInvariant<Matrix,offset>;
66 
67  return ( ( c0*I1() + c1*I2() ) << LeftCauchyGreenStrainTensor<Matrix>(F) ) + volumetricPenalty<InflationPenalty,CompressionPenalty>(d0,d1,F); // function definition
68 // ( ( d0*InflationPenalty() + d1*CompressionPenalty()) << Determinant<Matrix>(F) );
69  }
70 
71 
72 // /**
73 // * \ingroup Rubber
74 // *
75 // * \brief Generate a compressible Mooney-Rivlin material law \f$ W(F)=c_0\iota_1(F^T F) + c_1\iota_2(F^T F) + d_0\Gamma_\mathrm{In}(\det(F))+d_1\Gamma_\mathrm{Co}(\det(F)) \f$,
76 // * where \f$\iota_1\f$ is the first and \f$\iota_2\f$ the second principal matrix invariant.
77 // * The parameters \f$c_0,c_1,d_0,d_1\f$ are chosen such that for \f$F\rightarrow I\f$ the model asymptotically yields Hooke's model of linearized elasticity with Lam\'e constants \f$\lambda,\mu\f$.
78 // * Here \f$I\f$ denotes the unit matrix.
79 // *
80 // * \param lambda first Lame constant
81 // * \param mu second Lame constant
82 // */
83 // template <class Matrix, class InflationPenalty, class CompressionPenalty>
84 // auto createMooneyRivlinFromLameConstants(double lambda, double mu)
85 // {
86 // auto I = 1.;
87 // auto g0 = CompressionPenalty(I) << Identity<double>(1.);
88 // Finalize<decltype(g0)> g(g0);
89 
90 // auto rho = g.d1(I)/(-g.d2(I,I)+g.d1(I));
91 // auto d = (lambda+2.0*mu)/(g.d2(I,I)-g.d1(I));
92 // auto c = (0.5*rho-0.25)*mu+0.25*rho*lambda;
93 // if(c > 0.25*mu) c = (rho-0.75)*mu+0.5*rho*lambda;
94 // auto b = -mu + rho*(lambda+2.*mu)-2.*c;
95 // auto a = b + mu;
96 // auto alpha = 0.5*a - b;
97 // auto beta = 0.5*b;
98 
99 // if(a<0 || b<0 || c<0)
100 // {
101 // std::cout << "In the generation of Mooney-Rivlin material model from Lame constants." << std::endl;
102 // std::cout << "Computed parameters: " << alpha << ", " << beta<< ", " << c << ", " << d << std::endl;
103 // std::cout << "Material law is not polyconvex! -> Terminating." << std::endl;
104 // exit(1);
105 // }
106 
107 // return compressibleMooneyRivlin<InflationPenalty,CompressionPenalty>(alpha,beta,c,d,LinearAlgebra::unitMatrix<Matrix>());
108 // }
109 
110 
111 // /**
112 // * \ingroup Rubber
113 // *
114 // * \brief Generate a compressible Mooney-Rivlin material law \f$ W(F)=c_0\iota_1(F^T F) + c_1\iota_2(F^T F) + d_0\Gamma_\mathrm{In}(\det(F))+d_1\Gamma_\mathrm{Co}(\det(F)) \f$,
115 // * where \f$\iota_1\f$ is the first and \f$\iota_2\f$ the second principal matrix invariant.
116 // * The parameters \f$c_0,c_1,d_0,d_1\f$ are chosen such that for \f$F\rightarrow I\f$ the model asymptotically yields Hooke's model of linearized elasticity with Young's modulus \f$E\f$ and
117 // * Poisson ratio \f$\nu\f$. Here \f$I\f$ denotes the unit matrix.
118 // *
119 // * \param E Young's modulus
120 // * \param nu Poisson ratio
121 // */
122 // template <class Matrix, class InflationPenalty, class CompressionPenalty>
123 // auto createMooneyRivlinFromMaterialConstants(double E, double nu)
124 // {
125 // double lambda = E*nu/((1+nu)*(1-2*nu));
126 // double mu = E/(2*(1+nu));
127 // return createMooneyRivlinFromLameConstants<Matrix,InflationPenalty,CompressionPenalty>(lambda,mu);
128 // }
129 }
130 
131 #endif // RFFGEN_MOONEY_RIVLIN_HH
auto compressibleMooneyRivlin(double c0, double c1, double d0, double d1, const Matrix &F)
Generate a compressible Mooney-Rivlin material law , where is the first and the second principal ma...
Definition: mooneyRivlin.hh:61
auto incompressibleMooneyRivlin(double c0, double c1, const Matrix &F)
Generate an "incompressible" Mooney-Rivlin material law , where is the first and the second princip...
Definition: mooneyRivlin.hh:45