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.
hyperelastic_3D_law.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Bodhinanda Chandra
11 //
12 // References: This class is adapted from applications/SolidMechanicsApplication/custom_constitutive/hyperelastic_3D_law.hpp
13 
14 
15 #if !defined (KRATOS_HYPERELASTIC_3D_LAW_H_INCLUDED)
16 #define KRATOS_HYPERELASTIC_3D_LAW_H_INCLUDED
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
24 
25 namespace Kratos
26 {
36 class KRATOS_API(PARTICLE_MECHANICS_APPLICATION) HyperElastic3DLaw
37  : public ConstitutiveLaw
38 {
39 protected:
40 
41 
43  {
44  // general material properties
45  double LameMu;
46  double LameLambda;
47 
48  // general thermal properties
51 
52  // kinematic properties
53  double DeterminantF;
54  double traceCG; // LeftCauchyGreen or RightCauchyGreen
55  Matrix CauchyGreenMatrix; // LeftCauchyGreen or InverseRightCauchyGreen
56  Matrix DeformationGradientF; // Deformation Gradient Tensor in 3D
58 
59  //element properties
62 
63  public:
64  void SetShapeFunctionsValues (const Vector& rShapeFunctionsValues) {mpShapeFunctionsValues=&rShapeFunctionsValues;};
65  void SetElementGeometry (const GeometryType& rElementGeometry) {mpElementGeometry =&rElementGeometry;};
66  const Vector& GetShapeFunctionsValues () const {return *mpShapeFunctionsValues;};
67  const GeometryType& GetElementGeometry () const {return *mpElementGeometry;};
68  };
69 
70 
71 public:
77  typedef std::size_t SizeType;
78 
84 
93 
98  ConstitutiveLaw::Pointer Clone() const override;
99 
103  HyperElastic3DLaw (const HyperElastic3DLaw& rOther);
104 
105 
110  //HyperElastic3DLaw& operator=(const HyperElastic3DLaw& rOther);
111 
112 
116  ~HyperElastic3DLaw() override;
117 
130  {
131  return 3;
132  };
133 
137  SizeType GetStrainSize() const override
138  {
139  return 6;
140  };
141 
142 
143  bool Has( const Variable<double>& rThisVariable ) override;
144  bool Has( const Variable<Vector>& rThisVariable ) override;
145  bool Has( const Variable<Matrix>& rThisVariable ) override;
146 
147  double& CalculateValue(Parameters& rParameterValues, const Variable<double>& rThisVariable, double& rValue) override;
148 
149  double& GetValue( const Variable<double>& rThisVariable, double& rValue ) override;
150  Vector& GetValue( const Variable<Vector>& rThisVariable, Vector& rValue ) override;
151  Matrix& GetValue( const Variable<Matrix>& rThisVariable, Matrix& rValue ) override;
152 
153 
154  void SetValue( const Variable<double>& rVariable,
155  const double& rValue,
156  const ProcessInfo& rCurrentProcessInfo ) override;
157  void SetValue( const Variable<Vector>& rThisVariable,
158  const Vector& rValue,
159  const ProcessInfo& rCurrentProcessInfo ) override;
160  void SetValue( const Variable<Matrix>& rThisVariable,
161  const Matrix& rValue,
162  const ProcessInfo& rCurrentProcessInfo ) override;
166  void InitializeMaterial( const Properties& rMaterialProperties,
167  const GeometryType& rElementGeometry,
168  const Vector& rShapeFunctionsValues ) override;
169 
176  void CalculateMaterialResponseKirchhoff (Parameters & rValues) override;
177 
178 
185  void CalculateMaterialResponseCauchy (Parameters & rValues) override;
186 
187 
194  void FinalizeMaterialResponseKirchhoff (Parameters & rValues) override;
195 
202  void FinalizeMaterialResponseCauchy (Parameters & rValues) override;
203 
204 
209  void GetLawFeatures(Features& rFeatures) override;
210 
220  int Check(const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const ProcessInfo& rCurrentProcessInfo) const override;
221 
228  //String Info() const override;
232  //void PrintInfo(std::ostream& rOStream) const override;
236  //void PrintData(std::ostream& rOStream) const override;
237 
238 protected:
239 
245 
247 
249 
251 
258 
259 
265  virtual void CalculateGreenLagrangeStrain( const Matrix & rRightCauchyGreen,
266  Vector& rStrainVector );
267 
268 
274  virtual void CalculateAlmansiStrain( const Matrix & rLeftCauchyGreen,
275  Vector& rStrainVector );
276 
283  virtual double& CalculateDomainTemperature (const MaterialResponseVariables & rElasticVariables,
284  double & rTemperature);
285 
293  void CalculateStress( const MaterialResponseVariables& rElasticVariables,
294  StressMeasure rStressMeasure,
295  Vector& rStressVector);
296 
302  virtual void CalculateVolumetricStress( const MaterialResponseVariables & rElasticVariables,
303  Vector& rVolStressVector );
304 
312  virtual void CalculateIsochoricStress( const MaterialResponseVariables & rElasticVariables,
313  StressMeasure rStressMeasure,
314  Vector& rIsoStressVector);
315 
316 
323  virtual void CalculateConstitutiveMatrix (const MaterialResponseVariables& rElasticVariables,
324  Matrix& rConstitutiveMatrix);
325 
326 
330  double& ConstitutiveComponent( double & rCabcd,
331  const MaterialResponseVariables& rElasticVariables,
332  const unsigned int& a, const unsigned int& b,
333  const unsigned int& c, const unsigned int& d);
334 
335 
342  virtual void CalculateVolumetricConstitutiveMatrix (const MaterialResponseVariables& rElasticVariables,
343  Matrix& rConstitutiveMatrix);
344 
345 
350  double& VolumetricConstitutiveComponent( double & rCabcd,
351  const MaterialResponseVariables& rElasticVariables,
352  const Vector& rFactors,
353  const unsigned int& a, const unsigned int& b,
354  const unsigned int& c, const unsigned int& d);
355 
356 
364  virtual void CalculateIsochoricConstitutiveMatrix (const MaterialResponseVariables& rElasticVariables,
365  const Matrix & rIsoStressMatrix,
366  Matrix& rConstitutiveMatrix);
367 
368 
372  double& IsochoricConstitutiveComponent( double & rCabcd,
373  const MaterialResponseVariables& rElasticVariables,
374  const Matrix & rIsoStressMatrix,
375  const unsigned int& a, const unsigned int& b,
376  const unsigned int& c, const unsigned int& d);
377 
378 
384  virtual double& CalculateVolumetricFactor (const MaterialResponseVariables & rElasticVariables,
385  double & rFactor);
386 
387 
393  virtual double& CalculateVolumetricPressure (const MaterialResponseVariables & rElasticVariables,
394  double & rPressure);
395 
396 
402  virtual Vector& CalculateVolumetricPressureFactors (const MaterialResponseVariables & rElasticVariables,
403  Vector & rFactors);
404 
405 
412  Matrix& Transform2DTo3D (Matrix& rMatrix);
413 
414 
421  virtual void UpdateInternalVariables (Parameters & rValues);
422 
429  virtual bool CheckParameters(Parameters& rValues);
430 
431 
433 
434 private:
435 
441 
442 
446 
447 
451 
452 
457 
458 
462  friend class Serializer;
463 
464  void save(Serializer& rSerializer) const override
465  {
467  rSerializer.save("mInverseDeformationGradientF0",mInverseDeformationGradientF0);
468  rSerializer.save("mDeterminantF0",mDeterminantF0);
469  rSerializer.save("mStrainEnergy",mStrainEnergy);
470  }
471 
472  void load(Serializer& rSerializer) override
473  {
475  rSerializer.load("mInverseDeformationGradientF0",mInverseDeformationGradientF0);
476  rSerializer.load("mDeterminantF0",mDeterminantF0);
477  rSerializer.load("mStrainEnergy",mStrainEnergy);
478  }
479 
480 
482 
483 }; // Class HyperElastic3DLaw
484 } // namespace Kratos.
485 #endif // KRATOS_HYPERELASTIC_3D_LAW_H_INCLUDED defined
Definition: constitutive_law.h:47
StressMeasure
Definition: constitutive_law.h:69
std::size_t SizeType
Definition: constitutive_law.h:82
Geometry base class.
Definition: geometry.h:71
Definition: hyperelastic_3D_law.hpp:38
std::size_t SizeType
Definition: hyperelastic_3D_law.hpp:77
Matrix mInverseDeformationGradientF0
Definition: hyperelastic_3D_law.hpp:246
KRATOS_CLASS_POINTER_DEFINITION(HyperElastic3DLaw)
double mStrainEnergy
Definition: hyperelastic_3D_law.hpp:250
ProcessInfo ProcessInfoType
Definition: hyperelastic_3D_law.hpp:75
ConstitutiveLaw BaseType
Definition: hyperelastic_3D_law.hpp:76
SizeType GetStrainSize() const override
Definition: hyperelastic_3D_law.hpp:137
SizeType WorkingSpaceDimension() override
Definition: hyperelastic_3D_law.hpp:129
double mDeterminantF0
Definition: hyperelastic_3D_law.hpp:248
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
def load(f)
Definition: ode_solve.py:307
int d
Definition: ode_solve.py:397
Definition: constitutive_law.h:189
Definition: hyperelastic_3D_law.hpp:43
const Vector * mpShapeFunctionsValues
Definition: hyperelastic_3D_law.hpp:60
Matrix CauchyGreenMatrix
Definition: hyperelastic_3D_law.hpp:55
double LameLambda
Definition: hyperelastic_3D_law.hpp:46
const GeometryType & GetElementGeometry() const
Definition: hyperelastic_3D_law.hpp:67
Matrix Identity
Definition: hyperelastic_3D_law.hpp:57
void SetShapeFunctionsValues(const Vector &rShapeFunctionsValues)
Definition: hyperelastic_3D_law.hpp:64
Matrix DeformationGradientF
Definition: hyperelastic_3D_law.hpp:56
double DeterminantF
Definition: hyperelastic_3D_law.hpp:53
double LameMu
Definition: hyperelastic_3D_law.hpp:45
const GeometryType * mpElementGeometry
Definition: hyperelastic_3D_law.hpp:61
void SetElementGeometry(const GeometryType &rElementGeometry)
Definition: hyperelastic_3D_law.hpp:65
double traceCG
Definition: hyperelastic_3D_law.hpp:54
double ThermalExpansionCoefficient
Definition: hyperelastic_3D_law.hpp:49
const Vector & GetShapeFunctionsValues() const
Definition: hyperelastic_3D_law.hpp:66
double ReferenceTemperature
Definition: hyperelastic_3D_law.hpp:50