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.
hencky_hyper_elastic_model.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosConstitutiveModelsApplication $
3 // Created by: $Author: LMonforte $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2017 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_HENCKY_HYPER_ELASTIC_MODEL_H_INCLUDED )
11 #define KRATOS_HENCKY_HYPER_ELASTIC_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) HenckyHyperElasticModel : public HyperElasticModel
48  {
49  public:
50 
53 
56 
60 
63 
66 
69  {
71  return *this;
72  };
73 
75  ConstitutiveModel::Pointer Clone() const override
76  {
77  return ( HenckyHyperElasticModel::Pointer( new HenckyHyperElasticModel(*this)) );
78  };
79 
80 
82  ~HenckyHyperElasticModel() override {};
83 
84 
88 
89 
93 
97  void InitializeModel(ModelDataType& rValues) override
98  {
100 
102 
103  // Compute trial strain
104  //deformation gradient
105  const MatrixType& rDeltaDeformationMatrix = rValues.GetDeltaDeformationMatrix();
106 
107  //historical strain matrix
108  rValues.StrainMatrix = ConstitutiveModelUtilities::VectorToSymmetricTensor(this->mHistoryVector,rValues.StrainMatrix);
109  rValues.StrainMatrix = prod( rDeltaDeformationMatrix, rValues.StrainMatrix);
110  rValues.StrainMatrix = prod( rValues.StrainMatrix, trans(rDeltaDeformationMatrix));
111 
112  KRATOS_CATCH("")
113 
114  };
115 
119 
120 
124 
125 
129 
131  std::string Info() const override
132  {
133  std::stringstream buffer;
134  buffer << "HenckyHyperElasticModel";
135  return buffer.str();
136  }
137 
139  void PrintInfo(std::ostream& rOStream) const override
140  {
141  rOStream << "HenckyHyperElasticModel";
142  }
143 
145  void PrintData(std::ostream& rOStream) const override
146  {
147  rOStream << "HenckyHyperElasticModel Data";
148  }
149 
150 
154 
155 
157 
158  protected:
161 
162 
166 
167 
171 
172 
176 
177  void CalculateStrainData(ModelDataType& rValues, HyperElasticDataType& rVariables) override
178  {
179  KRATOS_TRY
180 
181  rVariables.SetModelData(rValues);
182  rVariables.SetState(rValues.State);
183 
184  const StressMeasureType& rStressMeasure = rValues.GetStressMeasure();
185 
186  if( rStressMeasure == ConstitutiveModelData::StressMeasureType::StressMeasure_PK2 ){ //mStrainMatrix = RightCauchyGreen (C=FT*F) C^-1=(FT*F)^-1=F^-1*FT^-1
187 
188  KRATOS_ERROR << "calling HenckyHyperelastic based method with PK2 stress. not implemented" << std::endl;
189 
190  }
191  else if( rStressMeasure == ConstitutiveModelData::StressMeasureType::StressMeasure_Kirchhoff ){ //mStrainMatrix = LeftCauchyGreen (b=F*FT)
192 
193  //set working strain measure
195 
196  MatrixType EigenVectors;
197  MatrixType EigenValues;
198  EigenVectors.clear();
199  EigenValues.clear();
200 
202 
203  rVariables.Strain.Matrix.clear();
204  for (unsigned int i = 0; i < 3; i++)
205  rVariables.Strain.Matrix(i,i) = std::log(EigenValues(i,i)) / 2.0;
206 
207  rVariables.Strain.Matrix = prod(rVariables.Strain.Matrix, trans(EigenVectors));
208  rVariables.Strain.Matrix = prod(EigenVectors, rVariables.Strain.Matrix);
209 
210  rValues.State.Set(ConstitutiveModelData::STRAIN_COMPUTED);
211 
212  }
213  else{
214  KRATOS_ERROR << "calling initialize HyperElasticModel .. StressMeasure required is inconsistent" << std::endl;
215  }
216 
217 
218  KRATOS_CATCH("")
219  };
220 
224 
225 
229 
230 
234 
235 
237 
238  private:
239 
242 
243 
247 
248 
252 
253 
257 
258 
262 
263 
267  friend class Serializer;
268 
269 
270  void save(Serializer& rSerializer) const override
271  {
273  }
274 
275  void load(Serializer& rSerializer) override
276  {
278  }
279 
283 
284 
288 
290 
291  }; // Class BorjaModel
292 
294 
297 
298 
302 
303 
305 
307 
308 } // namespace Kratos.
309 
310 #endif // KRATOS_HENCKY_HYPER_ELASTIC_MODEL_H_INCLUDED defined
StressMeasureType
Definition: constitutive_model_data.hpp:83
static MatrixType & VectorToSymmetricTensor(const array_1d< double, 6 > &rVector, MatrixType &rMatrix)
Definition: constitutive_model_utilities.hpp:568
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
Short class definition.
Definition: hencky_hyper_elastic_model.hpp:48
HenckyHyperElasticModel & operator=(HenckyHyperElasticModel const &rOther)
Assignment operator.
Definition: hencky_hyper_elastic_model.hpp:68
KRATOS_CLASS_POINTER_DEFINITION(HenckyHyperElasticModel)
Pointer definition of BorjaModel.
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: hencky_hyper_elastic_model.hpp:75
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: hencky_hyper_elastic_model.hpp:145
void InitializeModel(ModelDataType &rValues) override
Definition: hencky_hyper_elastic_model.hpp:97
std::string Info() const override
Turn back information as a string.
Definition: hencky_hyper_elastic_model.hpp:131
void CalculateStrainData(ModelDataType &rValues, HyperElasticDataType &rVariables) override
Definition: hencky_hyper_elastic_model.hpp:177
~HenckyHyperElasticModel() override
Destructor.
Definition: hencky_hyper_elastic_model.hpp:82
HenckyHyperElasticModel()
Default constructor.
Definition: hencky_hyper_elastic_model.hpp:62
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: hencky_hyper_elastic_model.hpp:139
HenckyHyperElasticModel(HenckyHyperElasticModel const &rOther)
Copy constructor.
Definition: hencky_hyper_elastic_model.hpp:65
Short class definition.
Definition: hyper_elastic_model.hpp:50
HyperElasticModel & operator=(HyperElasticModel const &rOther)
Assignment operator.
Definition: hyper_elastic_model.cpp:59
void InitializeModel(ModelDataType &rValues) override
Definition: hyper_elastic_model.cpp:76
Definition: amatrix_interface.h:41
void clear()
Definition: amatrix_interface.h:284
Various mathematical utilitiy functions.
Definition: math_utils.h:62
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
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
def load(f)
Definition: ode_solve.py:307
integer i
Definition: TensorModule.f:17
Definition: constitutive_model_data.hpp:383
const MatrixType & GetDeltaDeformationMatrix() const
Definition: constitutive_model_data.hpp:455
void SetStrainMeasure(StrainMeasureType Measure)
Definition: constitutive_model_data.hpp:424
const StressMeasureType & GetStressMeasure() const
Definition: constitutive_model_data.hpp:452
Flags State
Definition: constitutive_model_data.hpp:399
MatrixType StrainMatrix
Definition: constitutive_model_data.hpp:402
Definition: hyper_elastic_model.hpp:108
StrainData Strain
Definition: hyper_elastic_model.hpp:117
void SetState(Flags &rState)
Definition: hyper_elastic_model.hpp:120
void SetModelData(const ModelDataType &rModelData)
Definition: hyper_elastic_model.hpp:121
MatrixType Matrix
Definition: hyper_elastic_model.hpp:101