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.
hypo_elastic_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 2018 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_HYPO_ELASTIC_MODEL_H_INCLUDED )
11 #define KRATOS_HYPO_ELASTIC_MODEL_H_INCLUDED
12 
13 // System includes
14 #include <string>
15 #include <iostream>
16 
17 // External includes
18 
19 // Project includes
21 
22 namespace Kratos
23 {
26 
29 
33 
37 
41 
45 
47 
49  class KRATOS_API(CONSTITUTIVE_MODELS_APPLICATION) HypoElasticModel : public ConstitutiveModel
50  {
51  protected:
52 
54  {
55  private:
56 
57  Flags* mpState;
58  const ModelDataType* mpModelData;
59 
60  public:
61 
64 
65  //Set Data Pointers
66  void SetState (Flags& rState) {mpState = &rState;};
67  void SetModelData (const ModelDataType& rModelData) {mpModelData = &rModelData;};
68 
69  //Get Data Pointers
70  const ModelDataType& GetModelData () const {return *mpModelData;};
71  const MaterialDataType& GetMaterialParameters () const {return mpModelData->GetMaterialParameters();};
72 
73  //Get non const Data
74  Flags& State () {return *mpState;};
75 
76  //Get const Data
77  const Flags& GetState () const {return *mpState;};
78  };
79 
80 
81  public:
82 
86 
87 
90 
94 
97 
99  HypoElasticModel(HypoElasticModel const& rOther);
100 
102  ConstitutiveModel::Pointer Clone() const override;
103 
106 
108  ~HypoElasticModel() override;
109 
110 
114 
115 
119 
120 
124  void InitializeModel(ModelDataType& rValues) override;
125 
126 
130  void FinalizeModel(ModelDataType& rValues) override;
131 
132 
136  void CalculateStrainEnergy(ModelDataType& rValues, double& rDensityFunction) override;
137 
138 
142  void CalculateStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix) override;
143 
144  void CalculateIsochoricStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix) override;
145 
146  void CalculateVolumetricStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix) override;
147 
148 
149 
153  void CalculateConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutiveMatrix) override;
154 
155  void CalculateIsochoricConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutiveMatrix) override;
156 
157  void CalculateVolumetricConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutiveMatrix) override;
158 
162  void CalculateStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutiveMatrix) override;
163 
164  void CalculateIsochoricStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutiveMatrix) override;
165 
166  void CalculateVolumetricStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutiveMatrix) override;
167 
168 
172  int Check(const Properties& rProperties, const ProcessInfo& rCurrentProcessInfo) override;
173 
177 
178  void SetValue(const Variable<Vector>& rThisVariable, const Vector& rValue,
179  const ProcessInfo& rCurrentProcessInfo ) override
180  {
181  KRATOS_TRY
182 
183  // A method to compute the initial linear strain from the stress is needed
184  //if(rThisVariable == INITIAL_STRESS_VECTOR)
185 
186  // A method to compute the initial linear strain from the stress is needed
187  // if(rThisVariable == INITIAL_STRAIN_VECTOR){
188  // this->mHistoryVector = rValue;
189  // }
190 
191  KRATOS_CATCH(" ")
192  }
193 
194 
195  void SetValue(const Variable<Matrix>& rThisVariable, const Matrix& rValue,
196  const ProcessInfo& rCurrentProcessInfo ) override
197  {
198  KRATOS_TRY
199 
200  // A method to compute the initial linear strain from the stress is needed
201  //if(rThisVariable == INITIAL_STRESS_VECTOR)
202 
203  // A method to compute the initial linear strain from the stress is needed
204  // if(rThisVariable == INITIAL_STRAIN_VECTOR){
205  // this->mHistoryVector = rValue;
206  // }
207 
208  KRATOS_CATCH(" ")
209  }
210 
216  void GetDomainVariablesList(std::vector<Variable<double> >& rScalarVariables,
217  std::vector<Variable<array_1d<double,3> > >& rComponentVariables) override
218  {
219  KRATOS_TRY
220 
221  rComponentVariables.push_back(VELOCITY);
222 
223  KRATOS_CATCH(" ")
224  }
225 
229 
230 
234 
236  std::string Info() const override
237  {
238  std::stringstream buffer;
239  buffer << "HypoElasticModel";
240  return buffer.str();
241  }
242 
244  void PrintInfo(std::ostream& rOStream) const override
245  {
246  rOStream << "HypoElasticModel";
247  }
248 
250  void PrintData(std::ostream& rOStream) const override
251  {
252  rOStream << "HypoElasticModel Data";
253  }
254 
255 
259 
260 
262 
263  protected:
266 
267 
271 
272 
276 
277 
281 
285  void AddHistoricalStress(ModelDataType& rValues, MatrixType& rStressMatrix);
286 
290  virtual void CalculateAndAddStressTensor(ElasticDataType& rVariables, VectorType& rStrainVector, VectorType& rStressVector);
291 
292  virtual void CalculateAndAddIsochoricStressTensor(ElasticDataType& rVariables, VectorType& rStrainVector, VectorType& rStressVector);
293 
294  virtual void CalculateAndAddVolumetricStressTensor(ElasticDataType& rVariables, VectorType& rStrainVector, VectorType& rStressVector);
295 
299  virtual void CalculateAndAddConstitutiveTensor(ElasticDataType& rVariables, Matrix& rConstitutiveMatrix);
300 
301  virtual void CalculateAndAddConstitutiveTensor(ElasticDataType& rVariables);
302 
303  virtual void CalculateAndAddIsochoricConstitutiveTensor(ElasticDataType& rVariables, Matrix& rConstitutiveMatrix);
304 
305  virtual void CalculateAndAddIsochoricConstitutiveTensor(ElasticDataType& rVariables);
306 
307 
308  virtual void CalculateAndAddVolumetricConstitutiveTensor(ElasticDataType& rVariables, Matrix& rConstitutiveMatrix);
309 
310  virtual void CalculateAndAddVolumetricConstitutiveTensor(ElasticDataType& rVariables);
311 
312  //************//
313 
314  void InitializeElasticData(ModelDataType& rValues, ElasticDataType& rVariables);
315 
316  virtual void CalculateAndAddIsochoricStrainEnergy(ElasticDataType& rVariables, double& rIsochoricDensityFunction);
317 
318  virtual void CalculateAndAddVolumetricStrainEnergy(ElasticDataType& rVariables, double& rIsochoricDensityFunction);
319 
320 
324 
325 
329 
330 
334 
335 
337 
338  private:
339 
342 
343 
347 
348 
352 
353 
357 
358 
362 
363 
367  friend class Serializer;
368 
369  void save(Serializer& rSerializer) const override
370  {
372  }
373 
374  void load(Serializer& rSerializer) override
375  {
377  }
378 
382 
383 
387 
389 
390  }; // Class HypoElasticModel
391 
393 
396 
397 
401 
403 
405 
406 } // namespace Kratos.
407 
408 #endif // KRATOS_HYPO_ELASTIC_MODEL_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Short class definition.
Definition: constitutive_model.hpp:52
Definition: flags.h:58
Short class definition.
Definition: hypo_elastic_model.hpp:50
void SetValue(const Variable< Vector > &rThisVariable, const Vector &rValue, const ProcessInfo &rCurrentProcessInfo) override
Definition: hypo_elastic_model.hpp:178
KRATOS_CLASS_POINTER_DEFINITION(HypoElasticModel)
Pointer definition of HypoElasticModel.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: hypo_elastic_model.hpp:244
ElasticModelData ElasticDataType
Definition: hypo_elastic_model.hpp:85
void SetValue(const Variable< Matrix > &rThisVariable, const Matrix &rValue, const ProcessInfo &rCurrentProcessInfo) override
Definition: hypo_elastic_model.hpp:195
void GetDomainVariablesList(std::vector< Variable< double > > &rScalarVariables, std::vector< Variable< array_1d< double, 3 > > > &rComponentVariables) override
Definition: hypo_elastic_model.hpp:216
std::string Info() const override
Turn back information as a string.
Definition: hypo_elastic_model.hpp:236
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: hypo_elastic_model.hpp:250
Definition: amatrix_interface.h:41
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#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
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
double CalculateStrainEnergy(Element &rElement)
Definition: mpm_energy_calculation_utility.cpp:89
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
Definition: constitutive_model_data.hpp:383
const MaterialData & GetMaterialParameters() const
Definition: constitutive_model_data.hpp:462
Definition: hypo_elastic_model.hpp:54
const MaterialDataType & GetMaterialParameters() const
Definition: hypo_elastic_model.hpp:71
const Flags & GetState() const
Definition: hypo_elastic_model.hpp:77
Flags & State()
Definition: hypo_elastic_model.hpp:74
void SetModelData(const ModelDataType &rModelData)
Definition: hypo_elastic_model.hpp:67
BoundedMatrix< double, 6, 6 > ConstitutiveTensor
Definition: hypo_elastic_model.hpp:62
MatrixType StrainMatrix
Definition: hypo_elastic_model.hpp:63
void SetState(Flags &rState)
Definition: hypo_elastic_model.hpp:66
const ModelDataType & GetModelData() const
Definition: hypo_elastic_model.hpp:70