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.
yeoh_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_YEOH_MODEL_H_INCLUDED)
11 #define KRATOS_YEOH_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) YeohModel : public HyperElasticModel
48  {
49  public:
50 
53 
56 
60 
63 
65  YeohModel(YeohModel const& rOther) : HyperElasticModel(rOther) {}
66 
68  YeohModel& operator=(YeohModel const& rOther)
69  {
71  return *this;
72  }
73 
75  virtual ConstitutiveModel::Pointer Clone() const override
76  {
77  return Kratos::make_shared<YeohModel>(*this);
78  }
79 
81  virtual ~YeohModel() {}
82 
83 
87 
88 
92 
93  virtual void CalculateStrainEnergy(ModelDataType& rValues, double& rDensityFunction)
94  {
96 
97  HyperElasticDataType Variables;
98  this->CalculateStrainData(rValues, Variables);
99 
100  rDensityFunction += rVariables.GetMaterialParameters()[0] * ( Variables.Strain.Invariants.I1 - 3.0) + rVariables.GetMaterialParameters()[1] * ( Variables.Strain.Invariants.I2 - 3.0) + rVariables.GetMaterialParameters()[2] * ( Variables.Strain.Invariants.I3 - 3.0);
101 
102  KRATOS_CATCH(" ")
103  }
104 
105 
106 
107  virtual int Check(const Properties& rProperties,
108  const ProcessInfo& rCurrentProcessInfo)
109  {
110  KRATOS_TRY
111 
112  HyperElasticModel::Check(rProperties,rCurrentProcessInfo);
113 
114  if( C10.Key() == 0 || rProperties[C10] <= 0.00 )
115  KRATOS_ERROR << "C10 has an invalid key or value" << std::endl;
116 
117  if( C20.Key() == 0 || rProperties[C20] <= 0.00 )
118  KRATOS_ERROR << "C20 has an invalid key or value" << std::endl;
119 
120  if( C30.Key() == 0 || rProperties[C30] <= 0.00 )
121  KRATOS_ERROR << "C30 has an invalid key or value" << std::endl;
122 
123  if( BULK_MODULUS.Key() == 0 || rProperties[BULK_MODULUS] <= 0.00 )
124  KRATOS_ERROR << "BULK_MODULUS has an invalid key or value" << std::endl;
125 
126  KRATOS_CATCH(" ")
127  }
128 
129 
133 
134 
138 
139 
143 
145  virtual std::string Info() const override
146  {
147  std::stringstream buffer;
148  buffer << "YeohModel";
149  return buffer.str();
150  }
151 
153  virtual void PrintInfo(std::ostream& rOStream) const override
154  {
155  rOStream << "YeohModel";
156  }
157 
159  virtual void PrintData(std::ostream& rOStream) const override
160  {
161  rOStream << "YeohModel Data";
162  }
163 
167 
168 
170 
171  protected:
172 
175 
179 
183 
187 
188  //************// dW
189 
190  virtual double& GetFunction1stI1Derivative(HyperElasticDataType& rVariables, double& rDerivative) //dW/dI1
191  {
192  KRATOS_TRY
193 
194  rDerivative = rVariables.GetMaterialParameters()[0];
195  rDerivative += 2.0 * rVariables.GetMaterialParameters()[1] * (rVariables.Strain.Invariants.I1-3);
196  rDerivative += 3.0 * rVariables.GetMaterialParameters()[2] * (rVariables.Strain.Invariants.I1-3) * (rVariables.Strain.Invariants.I1-3);
197 
198  return rDerivative;
199 
200  KRATOS_CATCH(" ")
201  }
202 
203  virtual double& GetFunction1stI2Derivative(HyperElasticDataType& rVariables, double& rDerivative) //dW/dI2
204  {
205  KRATOS_TRY
206 
207  rDerivative = 0;
208 
209  return rDerivative;
210 
211  KRATOS_CATCH(" ")
212  }
213 
214  virtual double& GetFunction1stI3Derivative(HyperElasticDataType& rVariables, double& rDerivative) //dW/dI3
215  {
216  KRATOS_TRY
217 
218  rDerivative = 0;
219 
220  return rDerivative;
221 
222  KRATOS_CATCH(" ")
223  }
224 
225 
226  virtual double& GetFunction2ndI1Derivative(HyperElasticDataType& rVariables, double& rDerivative) //ddW/dI1dI1
227  {
228  KRATOS_TRY
229 
230  rDerivative = 0.0;
231 
232  return rDerivative;
233 
234  KRATOS_CATCH(" ")
235  }
236 
237  virtual double& GetFunction2ndI2Derivative(HyperElasticDataType& rVariables, double& rDerivative) //ddW/dI2dI2
238  {
239  KRATOS_TRY
240 
241  rDerivative = 0.0;
242 
243  return rDerivative;
244 
245  KRATOS_CATCH(" ")
246  }
247 
248  virtual double& GetFunction2ndI3Derivative(HyperElasticDataType& rVariables, double& rDerivative) //ddW/dI3dI3
249  {
250  KRATOS_TRY
251 
252  rDerivative = 0;
253 
254  return rDerivative;
255 
256  KRATOS_CATCH(" ")
257  }
258 
259 
263 
264 
268 
269 
273 
274 
276 
277  private:
278 
281 
282 
286 
287 
291 
292 
296 
297 
301 
302 
306  friend class Serializer;
307 
308 
309  virtual void save(Serializer& rSerializer) const override
310  {
312  }
313 
314  virtual void load(Serializer& rSerializer) override
315  {
317  }
318 
322 
323 
327 
329 
330  }; // Class YeohModel
331 
333 
336 
337 
341 
342 
344 
346 
347 } // namespace Kratos.
348 
349 #endif // KRATOS_YEOH_MODEL_H_INCLUDED defined
Short class definition.
Definition: hyper_elastic_model.hpp:50
HyperElasticModel & operator=(HyperElasticModel const &rOther)
Assignment operator.
Definition: hyper_elastic_model.cpp:59
int Check(const Properties &rProperties, const ProcessInfo &rCurrentProcessInfo) override
Definition: hyper_elastic_model.cpp:728
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
Short class definition.
Definition: yeoh_model.hpp:48
virtual double & GetFunction1stI1Derivative(HyperElasticDataType &rVariables, double &rDerivative)
Definition: yeoh_model.hpp:190
virtual double & GetFunction1stI3Derivative(HyperElasticDataType &rVariables, double &rDerivative)
Definition: yeoh_model.hpp:214
virtual double & GetFunction2ndI1Derivative(HyperElasticDataType &rVariables, double &rDerivative)
Definition: yeoh_model.hpp:226
KRATOS_CLASS_POINTER_DEFINITION(YeohModel)
Pointer definition of YeohModel.
virtual double & GetFunction2ndI2Derivative(HyperElasticDataType &rVariables, double &rDerivative)
Definition: yeoh_model.hpp:237
YeohModel()
Default constructor.
Definition: yeoh_model.hpp:62
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: yeoh_model.hpp:159
virtual ~YeohModel()
Destructor.
Definition: yeoh_model.hpp:81
virtual double & GetFunction2ndI3Derivative(HyperElasticDataType &rVariables, double &rDerivative)
Definition: yeoh_model.hpp:248
YeohModel & operator=(YeohModel const &rOther)
Assignment operator.
Definition: yeoh_model.hpp:68
virtual double & GetFunction1stI2Derivative(HyperElasticDataType &rVariables, double &rDerivative)
Definition: yeoh_model.hpp:203
virtual ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: yeoh_model.hpp:75
YeohModel(YeohModel const &rOther)
Copy constructor.
Definition: yeoh_model.hpp:65
virtual int Check(const Properties &rProperties, const ProcessInfo &rCurrentProcessInfo)
Definition: yeoh_model.hpp:107
virtual void CalculateStrainEnergy(ModelDataType &rValues, double &rDensityFunction)
Definition: yeoh_model.hpp:93
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: yeoh_model.hpp:153
virtual std::string Info() const override
Turn back information as a string.
Definition: yeoh_model.hpp:145
#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:383
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 I1
Definition: hyper_elastic_model.hpp:56