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.
isochoric_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_ISOCHORIC_NEO_HOOKEAN_LNJ_SQUARED_MODEL_H_INCLUDED )
11 #define KRATOS_ISOCHORIC_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) IsochoricNeoHookeanLnJSquaredModel : public IsochoricNeoHookeanModel
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<IsochoricNeoHookeanLnJSquaredModel>(*this);
78  }
79 
82 
83 
87 
88 
92 
93 
94  // Simplyfied methods must be implemented for performance purposes
95 
112  int Check(const Properties& rProperties, const ProcessInfo& rCurrentProcessInfo) override
113  {
114  KRATOS_TRY
115 
116  HyperElasticModel::Check(rProperties,rCurrentProcessInfo);
117 
118  if( C10.Key() == 0 || rProperties[C10] <= 0.00 )
119  KRATOS_ERROR << "C10 has an invalid key or value" << std::endl;
120 
121  if( BULK_MODULUS.Key() == 0 || rProperties[BULK_MODULUS] <= 0.00 )
122  KRATOS_ERROR << "BULK_MODULUS has an invalid key or value" << std::endl;
123 
124  return 0;
125 
126  KRATOS_CATCH(" ")
127  }
128 
129 
133 
134 
138 
139 
143 
145  std::string Info() const override
146  {
147  std::stringstream buffer;
148  buffer << "IsochoricNeoHookeanLnJSquaredModel";
149  return buffer.str();
150  }
151 
153  void PrintInfo(std::ostream& rOStream) const override
154  {
155  rOStream << "IsochoricNeoHookeanLnJSquaredModel";
156  }
157 
159  void PrintData(std::ostream& rOStream) const override
160  {
161  rOStream << "IsochoricNeoHookeanLnJSquaredModel Data";
162  }
163 
164 
168 
169 
171 
172  protected:
173 
176 
180 
184 
188 
189  //specialized methods:
190 
191  void CalculateVolumetricFactor(HyperElasticDataType& rVariables, double& rFactor) override
192  {
193  KRATOS_TRY
194 
195  rFactor = std::log(rVariables.Strain.Invariants.J);
196 
197  KRATOS_CATCH(" ")
198  }
199 
200 
201  void CalculateConstitutiveMatrixFactor(HyperElasticDataType& rVariables, double& rFactor) override
202  {
203  KRATOS_TRY
204 
205  rFactor = 1.0;
206 
207  KRATOS_CATCH(" ")
208  }
209 
210  //************// W
211 
212  void CalculateAndAddIsochoricStrainEnergy(HyperElasticDataType& rVariables, double& rIsochoricDensityFunction) override
213  {
214  KRATOS_TRY
215 
216  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
217 
218  rIsochoricDensityFunction += rMaterial.GetModelParameters()[0] * ( rVariables.Strain.Invariants.J_13 * rVariables.Strain.Invariants.I1 - 3.0);
219 
220  KRATOS_CATCH(" ")
221  }
222 
223 
224  void CalculateAndAddVolumetricStrainEnergy(HyperElasticDataType& rVariables, double& rVolumetricDensityFunction) override
225  {
226  KRATOS_TRY
227 
228  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
229 
230  //energy function "U(J) = (K/2)*(lnJ)²"
231  rVolumetricDensityFunction += rMaterial.GetBulkModulus() * 0.5 * pow(std::log(rVariables.Strain.Invariants.J),2);
232 
233  KRATOS_CATCH(" ")
234  }
235 
236  //************// dW
237 
238  double& GetFunction1stI1Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //dW/dI1
239  {
240  KRATOS_TRY
241 
242  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
243 
244  rDerivative = rMaterial.GetModelParameters()[0];
245 
246  return rDerivative;
247 
248  KRATOS_CATCH(" ")
249  }
250 
251  double& GetFunction1stI2Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //dW/dI2
252  {
253  KRATOS_TRY
254 
255  rDerivative = 0.0;
256 
257  return rDerivative;
258 
259  KRATOS_CATCH(" ")
260  }
261 
262  double& GetFunction1stI3Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //dW/dI3
263  {
264  KRATOS_TRY
265 
266  rDerivative = 0.0;
267 
268  return rDerivative;
269 
270  KRATOS_CATCH(" ")
271  }
272 
273  double& GetVolumetricFunction1stJDerivative(HyperElasticDataType& rVariables, double& rDerivative) override //dU/dJ
274  {
275  KRATOS_TRY
276 
277  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
278 
279  //derivative of "U(J) = (K/2)*ln(J)²"
280  //dU(J)/dJ = (K)*(lnJ/J)
281  rDerivative = rMaterial.GetBulkModulus() * std::log( rVariables.Strain.Invariants.J );
282 
283  rDerivative /= rVariables.Strain.Invariants.J;
284 
285  return rDerivative;
286 
287  KRATOS_CATCH(" ")
288  }
289 
290 
291  double& GetFunction2ndI1Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //ddW/dI1dI1
292  {
293  KRATOS_TRY
294 
295  rDerivative = 0.0;
296 
297  return rDerivative;
298 
299  KRATOS_CATCH(" ")
300  }
301 
302  double& GetFunction2ndI2Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //ddW/dI2dI2
303  {
304  KRATOS_TRY
305 
306  rDerivative = 0.0;
307 
308  return rDerivative;
309 
310  KRATOS_CATCH(" ")
311  }
312 
313  double& GetFunction2ndI3Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //ddW/dI3dI3
314  {
315  KRATOS_TRY
316 
317  rDerivative = 0.0;
318 
319  return rDerivative;
320 
321  KRATOS_CATCH(" ")
322  }
323 
324 
325  double& GetVolumetricFunction2ndJDerivative(HyperElasticDataType& rVariables, double& rDerivative) override //ddU/dJdJ
326  {
327  KRATOS_TRY
328 
329  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
330 
331  //derivative of "dU(J)/dJ = (K)*(lnJ/J)"
332  //ddU(J)/dJdJ = (K)*(1-lnJ)/J²
333  rDerivative = rMaterial.GetBulkModulus() * (1.0 -std::log(rVariables.Strain.Invariants.J)) / (rVariables.Strain.Invariants.J * rVariables.Strain.Invariants.J);
334 
335  return rDerivative;
336 
337  KRATOS_CATCH(" ")
338  }
339 
340 
344 
345 
349 
350 
354 
355 
357 
358  private:
359 
362 
363 
367 
368 
372 
373 
377 
378 
382 
383 
387  friend class Serializer;
388 
389 
390  void save(Serializer& rSerializer) const override
391  {
393  }
394 
395  void load(Serializer& rSerializer) override
396  {
398  }
399 
403 
404 
408 
410 
411  }; // Class IsochoricNeoHookeanLnJSquaredModel
412 
414 
417 
418 
422 
423 
425 
427 
428 } // namespace Kratos.
429 
430 #endif // KRATOS_ISOCHORIC_NEO_HOOKEAN_LNJ_SQUARED_MODEL_H_INCLUDED defined
int Check(const Properties &rProperties, const ProcessInfo &rCurrentProcessInfo) override
Definition: hyper_elastic_model.cpp:728
Short class definition.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:48
void CalculateAndAddIsochoricStrainEnergy(HyperElasticDataType &rVariables, double &rIsochoricDensityFunction) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:212
~IsochoricNeoHookeanLnJSquaredModel() override
Destructor.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:81
void CalculateVolumetricFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:191
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:159
IsochoricNeoHookeanLnJSquaredModel(IsochoricNeoHookeanLnJSquaredModel const &rOther)
Copy constructor.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:65
double & GetFunction1stI2Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:251
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:75
int Check(const Properties &rProperties, const ProcessInfo &rCurrentProcessInfo) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:112
void CalculateAndAddVolumetricStrainEnergy(HyperElasticDataType &rVariables, double &rVolumetricDensityFunction) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:224
IsochoricNeoHookeanLnJSquaredModel()
Default constructor.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:62
double & GetVolumetricFunction2ndJDerivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:325
double & GetFunction1stI3Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:262
IsochoricNeoHookeanLnJSquaredModel & operator=(IsochoricNeoHookeanLnJSquaredModel const &rOther)
Assignment operator.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:68
double & GetFunction2ndI3Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:313
double & GetVolumetricFunction1stJDerivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:273
double & GetFunction2ndI1Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:291
std::string Info() const override
Turn back information as a string.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:145
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:153
KRATOS_CLASS_POINTER_DEFINITION(IsochoricNeoHookeanLnJSquaredModel)
Pointer definition of IsochoricNeoHookeanLnJSquaredModel.
double & GetFunction2ndI2Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:302
void CalculateConstitutiveMatrixFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:201
double & GetFunction1stI1Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: isochoric_neo_hookean_lnJ_squared_model.hpp:238
Short class definition.
Definition: isochoric_neo_hookean_model.hpp:48
IsochoricNeoHookeanModel & operator=(IsochoricNeoHookeanModel const &rOther)
Assignment operator.
Definition: isochoric_neo_hookean_model.hpp:68
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
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
#define KRATOS_ERROR
Definition: exception.h:161
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 & GetBulkModulus() const
Definition: constitutive_model_data.hpp:114
const std::vector< double > & GetModelParameters() const
Definition: constitutive_model_data.hpp:116
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
double I1
Definition: hyper_elastic_model.hpp:56
double J_13
Definition: hyper_elastic_model.hpp:61