KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
neo_hookean_lnJ_squared_model.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosConstitutiveModelsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2017 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_NEO_HOOKEAN_LNJ_SQUARED_MODEL_H_INCLUDED)
11 #define KRATOS_NEO_HOOKEAN_LNJ_SQUARED_MODEL_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
19 
20 namespace Kratos
21 {
24 
27 
31 
35 
39 
43 
45 
47  class KRATOS_API(CONSTITUTIVE_MODELS_APPLICATION) NeoHookeanLnJSquaredModel : public NeoHookeanModel
48  {
49  public:
50 
53 
56 
60 
63 
66 
69  {
71  return *this;
72  }
73 
75  ConstitutiveModel::Pointer Clone() const override
76  {
77  return Kratos::make_shared<NeoHookeanLnJSquaredModel>(*this);
78  }
79 
82 
83 
87 
88 
92 
93 
97 
98 
102 
103 
107 
109  std::string Info() const override
110  {
111  std::stringstream buffer;
112  buffer << "NeoHookeanLnJSquaredModel";
113  return buffer.str();
114  }
115 
117  void PrintInfo(std::ostream& rOStream) const override
118  {
119  rOStream << "NeoHookeanLnJSquaredModel";
120  }
121 
123  void PrintData(std::ostream& rOStream) const override
124  {
125  rOStream << "NeoHookeanLnJSquaredModel Data";
126  }
127 
131 
132 
134 
135  protected:
136 
139 
143 
147 
148 
152 
153 
154  // specialized methods:
155 
156  void CalculateVolumetricFactor(HyperElasticDataType& rVariables, double& rFactor) override
157  {
158  KRATOS_TRY
159 
160  rFactor = std::log(rVariables.Strain.Invariants.J);
161 
162  KRATOS_CATCH(" ")
163  }
164 
165 
166  void CalculateConstitutiveMatrixFactor(HyperElasticDataType& rVariables, double& rFactor) override
167  {
168  KRATOS_TRY
169 
170  rFactor = 1.0;
171 
172  KRATOS_CATCH(" ")
173  }
174 
175  //************// W
176 
177  //option: g(J) = (lambda/2)*ln(J)² - (mu)*lnJ (neo_hookean_lnJ_model)
178 
179  void CalculateAndAddVolumetricStrainEnergy(HyperElasticDataType& rVariables, double& rVolumetricDensityFunction) override
180  {
181  KRATOS_TRY
182 
183  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
184 
185  //g(J) = (lambda/2)*ln(J)² - (mu)*lnJ
186  rVolumetricDensityFunction = rMaterial.GetLameLambda() * 0.5 * std::log( rVariables.Strain.Invariants.J );
187  rVolumetricDensityFunction -= rMaterial.GetLameMu() * std::log( rVariables.Strain.Invariants.J );
188 
189  KRATOS_CATCH(" ")
190  }
191 
192 
193  //************// dW
194 
195 
196  double& GetFunction1stI3Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //dW/dI3
197  {
198  KRATOS_TRY
199 
200  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
201 
202  //derivative of "g(J) = (lambda/2)*(lnJ)² - (mu)*lnJ"
203  //dg(J)/dI3 = (lambda/2)*(lnJ/J²) - (mu)*(1/J²)/2
204  rDerivative = 0.5 * rMaterial.GetLameLambda() * std::log( rVariables.Strain.Invariants.J );
205  rDerivative -= 0.5 * rMaterial.GetLameMu();
206  rDerivative /= rVariables.Strain.Invariants.I3;
207 
208  return rDerivative;
209 
210  KRATOS_CATCH(" ")
211  }
212 
213 
214  double& GetFunction2ndI3Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //ddW/dI3dI3
215  {
216  KRATOS_TRY
217 
218  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
219 
220  //ddg(J)/dI3dI3 = (lambda/4)*(1-2*lnJ)/J⁴ + (mu/2)*(1/J⁴)
221  rDerivative = 0.25 * rMaterial.GetLameLambda() * (1.0 - 2.0 * std::log( rVariables.Strain.Invariants.J ) );
222  rDerivative += 0.5 * rMaterial.GetLameMu();
223  rDerivative /= (rVariables.Strain.Invariants.I3 * rVariables.Strain.Invariants.I3);
224 
225  return rDerivative;
226 
227  KRATOS_CATCH(" ")
228  }
229 
230 
234 
235 
239 
240 
244 
245 
247 
248  private:
249 
252 
253 
257 
258 
262 
263 
267 
268 
272 
273 
277  friend class Serializer;
278 
279 
280  void save(Serializer& rSerializer) const override
281  {
283  }
284 
285  void load(Serializer& rSerializer) override
286  {
288  }
289 
293 
294 
298 
300 
301  }; // Class NeoHookeanLnJSquaredModel
302 
304 
307 
308 
312 
313 
315 
317 
318 } // namespace Kratos.
319 
320 #endif // KRATOS_NEO_HOOKEAN_LNJ_SQUARED_MODEL_H_INCLUDED defined
Short class definition.
Definition: neo_hookean_lnJ_squared_model.hpp:48
~NeoHookeanLnJSquaredModel() override
Destructor.
Definition: neo_hookean_lnJ_squared_model.hpp:81
NeoHookeanLnJSquaredModel()
Default constructor.
Definition: neo_hookean_lnJ_squared_model.hpp:62
double & GetFunction1stI3Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: neo_hookean_lnJ_squared_model.hpp:196
std::string Info() const override
Turn back information as a string.
Definition: neo_hookean_lnJ_squared_model.hpp:109
NeoHookeanLnJSquaredModel & operator=(NeoHookeanLnJSquaredModel const &rOther)
Assignment operator.
Definition: neo_hookean_lnJ_squared_model.hpp:68
void CalculateVolumetricFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: neo_hookean_lnJ_squared_model.hpp:156
void CalculateAndAddVolumetricStrainEnergy(HyperElasticDataType &rVariables, double &rVolumetricDensityFunction) override
Definition: neo_hookean_lnJ_squared_model.hpp:179
KRATOS_CLASS_POINTER_DEFINITION(NeoHookeanLnJSquaredModel)
Pointer definition of NeoHookeanLnJSquaredModel.
NeoHookeanLnJSquaredModel(NeoHookeanLnJSquaredModel const &rOther)
Copy constructor.
Definition: neo_hookean_lnJ_squared_model.hpp:65
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: neo_hookean_lnJ_squared_model.hpp:123
void CalculateConstitutiveMatrixFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: neo_hookean_lnJ_squared_model.hpp:166
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: neo_hookean_lnJ_squared_model.hpp:117
double & GetFunction2ndI3Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: neo_hookean_lnJ_squared_model.hpp:214
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: neo_hookean_lnJ_squared_model.hpp:75
Short class definition.
Definition: neo_hookean_model.hpp:48
NeoHookeanModel & operator=(NeoHookeanModel const &rOther)
Assignment operator.
Definition: neo_hookean_model.hpp:68
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_model_data.hpp:92
const double & GetLameLambda() const
Definition: constitutive_model_data.hpp:113
Definition: hyper_elastic_model.hpp:108
StrainData Strain
Definition: hyper_elastic_model.hpp:117
const MaterialDataType & GetMaterialParameters() const
Definition: hyper_elastic_model.hpp:125
StrainInvariants Invariants
Definition: hyper_elastic_model.hpp:98
double J
Definition: hyper_elastic_model.hpp:60