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 // Project Name: KratosPoromechanicsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: July 2015 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined (KRATOS_HYPERELASTIC_3D_LAW_H_INCLUDED)
11 #define KRATOS_HYPERELASTIC_3D_LAW_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
19 
20 namespace Kratos
21 {
31 class KRATOS_API(POROMECHANICS_APPLICATION) HyperElastic3DLaw : public ConstitutiveLaw
32 {
33 protected:
34 
35 
36  struct MaterialResponseVariables
37  {
38  //general material properties
39  double LameMu;
40  double LameLambda;
41 
42  //general thermal properties
43  double ThermalExpansionCoefficient;
44  double ReferenceTemperature;
45 
46  //kinematic properties
47  double J_pow13;
48  double DeterminantF;
49  double traceCG; //LeftCauchyGreen or RightCauchyGreen
50  Matrix CauchyGreenMatrix; //LeftCauchyGreen or InverseRightCauchyGreen
51  Matrix DeformationGradientF; //Deformation Gradient Tensor in 3D
52  Matrix Identity;
53 
54  //element properties
55  const Vector* mpShapeFunctionsValues;
56  const GeometryType* mpElementGeometry;
57 
58  public:
59  void SetShapeFunctionsValues (const Vector& rShapeFunctionsValues) {mpShapeFunctionsValues=&rShapeFunctionsValues;};
60  void SetElementGeometry (const GeometryType& rElementGeometry) {mpElementGeometry =&rElementGeometry;};
61  const Vector& GetShapeFunctionsValues () const {return *mpShapeFunctionsValues;};
62  const GeometryType& GetElementGeometry () const {return *mpElementGeometry;};
63 
64 
65  };
66 
67 
68 public:
74  typedef std::size_t SizeType;
75 
81 
90 
95  ConstitutiveLaw::Pointer Clone() const override;
96 
101 
102 
107  //HyperElastic3DLaw& operator=(const HyperElastic3DLaw& rOther);
108 
109 
113  ~HyperElastic3DLaw() override;
114 
127  {
128  return 3;
129  };
130 
134  SizeType GetStrainSize() const override
135  {
136  return 6;
137  };
138 
139 
140  bool Has( const Variable<double>& rThisVariable ) override;
141  bool Has( const Variable<Vector>& rThisVariable ) override;
142  bool Has( const Variable<Matrix>& rThisVariable ) override;
143 
144  double& CalculateValue(Parameters& rParameterValues, const Variable<double>& rThisVariable, double& rValue) override;
145 
146  double& GetValue( const Variable<double>& rThisVariable, double& rValue ) override;
147  Vector& GetValue( const Variable<Vector>& rThisVariable, Vector& rValue ) override;
148  Matrix& GetValue( const Variable<Matrix>& rThisVariable, Matrix& rValue ) override;
149 
150 
151  void SetValue( const Variable<double>& rVariable,
152  const double& rValue,
153  const ProcessInfo& rCurrentProcessInfo ) override;
154  void SetValue( const Variable<Vector>& rThisVariable,
155  const Vector& rValue,
156  const ProcessInfo& rCurrentProcessInfo ) override;
157  void SetValue( const Variable<Matrix>& rThisVariable,
158  const Matrix& rValue,
159  const ProcessInfo& rCurrentProcessInfo ) override;
163  void InitializeMaterial( const Properties& rMaterialProperties,
164  const GeometryType& rElementGeometry,
165  const Vector& rShapeFunctionsValues ) override;
166 
173  void CalculateMaterialResponsePK1 (Parameters & rValues) override;
174 
181  void CalculateMaterialResponsePK2 (Parameters & rValues) override;
182 
190 
191 
198  void CalculateMaterialResponseCauchy (Parameters & rValues) override;
199 
200 
207  void FinalizeMaterialResponsePK1 (Parameters & rValues) override;
208 
215  void FinalizeMaterialResponsePK2 (Parameters & rValues) override;
216 
224 
231  void FinalizeMaterialResponseCauchy (Parameters & rValues) override;
232 
233 
238  void GetLawFeatures(Features& rFeatures) override;
239 
249  int Check(const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const ProcessInfo& rCurrentProcessInfo) const override;
250 
257  //String Info() const override;
261  //void PrintInfo(std::ostream& rOStream) const override;
265  //void PrintData(std::ostream& rOStream) const override;
266 
267 protected:
268 
274 
275  Matrix mInverseDeformationGradientF0;
276 
277  double mDeterminantF0;
278 
279  double mStrainEnergy;
280 
287 
288 
294  virtual void CalculateGreenLagrangeStrain( const Matrix & rRightCauchyGreen,
295  Vector& rStrainVector );
296 
297 
303  virtual void CalculateAlmansiStrain( const Matrix & rLeftCauchyGreen,
304  Vector& rStrainVector );
305 
306 
314  void CalculateStress( const MaterialResponseVariables& rElasticVariables,
315  StressMeasure rStressMeasure,
316  Vector& rStressVector);
317 
325  virtual void CalculateIsochoricStress( const MaterialResponseVariables & rElasticVariables,
326  StressMeasure rStressMeasure,
327  Vector& rIsoStressVector);
328 
334  virtual void CalculateVolumetricStress( const MaterialResponseVariables & rElasticVariables,
335  Vector& rVolStressVector );
336 
343  virtual void CalculateConstitutiveMatrix (const MaterialResponseVariables& rElasticVariables,
344  Matrix& rConstitutiveMatrix);
345 
346 
351  double& ConstitutiveComponent( double & rCabcd,
352  const MaterialResponseVariables& rElasticVariables,
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 
384  virtual void CalculateVolumetricConstitutiveMatrix (const MaterialResponseVariables& rElasticVariables,
385  Matrix& rConstitutiveMatrix);
386 
387 
392  double& VolumetricConstitutiveComponent( double & rCabcd,
393  const MaterialResponseVariables& rElasticVariables,
394  const Vector& rFactors,
395  const unsigned int& a, const unsigned int& b,
396  const unsigned int& c, const unsigned int& d);
397 
398 
404  virtual double& CalculateVolumetricFactor (const MaterialResponseVariables & rElasticVariables,
405  double & rFactor);
406 
407 
413  virtual double& CalculateVolumetricPressure (const MaterialResponseVariables & rElasticVariables,
414  double & rPressure);
415 
416 
423  Vector & rFactors);
424 
425 
432  virtual double& CalculateDomainTemperature (const MaterialResponseVariables & rElasticVariables,
433  double & rTemperature);
434 
442 
443 
444 
451  virtual void UpdateInternalVariables (Parameters & rValues);
452 
459  virtual bool CheckParameters(Parameters& rValues);
460 
461 
463 
464 private:
465 
471 
472 
476 
477 
481 
482 
487 
488 
492  friend class Serializer;
493 
494  void save(Serializer& rSerializer) const override
495  {
497  rSerializer.save("mInverseDeformationGradientF0",mInverseDeformationGradientF0);
498  rSerializer.save("mDeterminantF0",mDeterminantF0);
499  rSerializer.save("mStrainEnergy",mStrainEnergy);
500  }
501 
502  void load(Serializer& rSerializer) override
503  {
505  rSerializer.load("mInverseDeformationGradientF0",mInverseDeformationGradientF0);
506  rSerializer.load("mDeterminantF0",mDeterminantF0);
507  rSerializer.load("mStrainEnergy",mStrainEnergy);
508  }
509 
510 
512 
513 }; // Class HyperElastic3DLaw
514 } // namespace Kratos.
515 #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
virtual void CalculateIsochoricStress(const MaterialResponseVariables &rElasticVariables, StressMeasure rStressMeasure, Vector &rIsoStressVector)
bool Has(const Variable< Matrix > &rThisVariable) override
Returns whether this constitutive Law has specified variable (Matrix)
int Check(const Properties &rMaterialProperties, const GeometryType &rElementGeometry, const ProcessInfo &rCurrentProcessInfo) const override
std::size_t SizeType
Definition: hyperelastic_3D_law.hpp:74
virtual void CalculateVolumetricStress(const MaterialResponseVariables &rElasticVariables, Vector &rVolStressVector)
void GetLawFeatures(Features &rFeatures) override
double & GetValue(const Variable< double > &rThisVariable, double &rValue) override
Returns the value of a specified variable (double)
virtual void CalculateConstitutiveMatrix(const MaterialResponseVariables &rElasticVariables, Matrix &rConstitutiveMatrix)
void FinalizeMaterialResponseKirchhoff(Parameters &rValues) override
virtual Vector & CalculateVolumetricPressureFactors(const MaterialResponseVariables &rElasticVariables, Vector &rFactors)
void FinalizeMaterialResponseCauchy(Parameters &rValues) override
Matrix & Transform2DTo3D(Matrix &rMatrix)
virtual double & CalculateVolumetricPressure(const MaterialResponseVariables &rElasticVariables, double &rPressure)
bool Has(const Variable< Vector > &rThisVariable) override
Returns whether this constitutive Law has specified variable (Vector)
void CalculateMaterialResponseCauchy(Parameters &rValues) override
void CalculateStress(const MaterialResponseVariables &rElasticVariables, StressMeasure rStressMeasure, Vector &rStressVector)
virtual double & CalculateVolumetricFactor(const MaterialResponseVariables &rElasticVariables, double &rFactor)
Matrix & GetValue(const Variable< Matrix > &rThisVariable, Matrix &rValue) override
Returns the value of a specified variable (Matrix)
void SetValue(const Variable< double > &rVariable, const double &rValue, const ProcessInfo &rCurrentProcessInfo) override
Sets the value of a specified variable (double)
HyperElastic3DLaw(const HyperElastic3DLaw &rOther)
void CalculateMaterialResponseKirchhoff(Parameters &rValues) override
KRATOS_CLASS_POINTER_DEFINITION(HyperElastic3DLaw)
virtual void CalculateAlmansiStrain(const Matrix &rLeftCauchyGreen, Vector &rStrainVector)
virtual void CalculateIsochoricConstitutiveMatrix(const MaterialResponseVariables &rElasticVariables, const Matrix &rIsoStressMatrix, Matrix &rConstitutiveMatrix)
void SetValue(const Variable< Vector > &rThisVariable, const Vector &rValue, const ProcessInfo &rCurrentProcessInfo) override
Sets the value of a specified variable (Vector)
void InitializeMaterial(const Properties &rMaterialProperties, const GeometryType &rElementGeometry, const Vector &rShapeFunctionsValues) override
virtual void CalculateGreenLagrangeStrain(const Matrix &rRightCauchyGreen, Vector &rStrainVector)
double & ConstitutiveComponent(double &rCabcd, const MaterialResponseVariables &rElasticVariables, const unsigned int &a, const unsigned int &b, const unsigned int &c, const unsigned int &d)
virtual void UpdateInternalVariables(Parameters &rValues)
double & CalculateValue(Parameters &rParameterValues, const Variable< double > &rThisVariable, double &rValue) override
Calculates the value of a specified variable (double)
ProcessInfo ProcessInfoType
Definition: hyperelastic_3D_law.hpp:72
double & VolumetricConstitutiveComponent(double &rCabcd, const MaterialResponseVariables &rElasticVariables, const Vector &rFactors, const unsigned int &a, const unsigned int &b, const unsigned int &c, const unsigned int &d)
bool Has(const Variable< double > &rThisVariable) override
Returns whether this constitutive Law has specified variable (double)
ConstitutiveLaw BaseType
Definition: hyperelastic_3D_law.hpp:73
virtual bool CheckParameters(Parameters &rValues)
SizeType GetStrainSize() const override
Definition: hyperelastic_3D_law.hpp:134
Vector & GetValue(const Variable< Vector > &rThisVariable, Vector &rValue) override
Returns the value of a specified variable (Vector)
SizeType WorkingSpaceDimension() override
Definition: hyperelastic_3D_law.hpp:126
virtual double & CalculateDomainTemperature(const MaterialResponseVariables &rElasticVariables, double &rTemperature)
double & IsochoricConstitutiveComponent(double &rCabcd, const MaterialResponseVariables &rElasticVariables, const Matrix &rIsoStressMatrix, const unsigned int &a, const unsigned int &b, const unsigned int &c, const unsigned int &d)
void SetValue(const Variable< Matrix > &rThisVariable, const Matrix &rValue, const ProcessInfo &rCurrentProcessInfo) override
Sets the value of a specified variable (Matrix)
ConstitutiveLaw::Pointer Clone() const override
virtual void CalculateVolumetricConstitutiveMatrix(const MaterialResponseVariables &rElasticVariables, Matrix &rConstitutiveMatrix)
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
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:137
Definition: constitutive_law.h:189
Definition: hyperelastic_3D_law.hpp:43
double J_pow13
Definition: hyperelastic_3D_law.hpp:47
const GeometryType & GetElementGeometry() const
Definition: hyperelastic_3D_law.hpp:62
void SetShapeFunctionsValues(const Vector &rShapeFunctionsValues)
Definition: hyperelastic_3D_law.hpp:59
void SetElementGeometry(const GeometryType &rElementGeometry)
Definition: hyperelastic_3D_law.hpp:60
const Vector & GetShapeFunctionsValues() const
Definition: hyperelastic_3D_law.hpp:61