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.
incompressible_neo_hookean_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_INCOMPRESSIBLE_NEO_HOOKEAN_MODEL_H_INCLUDED )
11 #define KRATOS_INCOMPRESSIBLE_NEO_HOOKEAN_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) IncompressibleNeoHookeanModel : public IsochoricNeoHookeanModel
50  {
51  public:
52 
55 
58 
62 
65 
68 
71  {
73  return *this;
74  }
75 
77  ConstitutiveModel::Pointer Clone() const override
78  {
79  return Kratos::make_shared<IncompressibleNeoHookeanModel>(*this);
80  }
81 
84 
85 
89 
90 
94 
95 
96  // Simplyfied methods must be implemented for performance purposes
108  int Check(const Properties& rProperties, const ProcessInfo& rCurrentProcessInfo) override
109  {
110  KRATOS_TRY
111 
112  IsochoricNeoHookeanModel::Check(rProperties,rCurrentProcessInfo);
113 
114  return 0;
115 
116  KRATOS_CATCH(" ")
117  };
118 
119 
123 
129  void GetDomainVariablesList(std::vector<Variable<double> >& rScalarVariables,
130  std::vector<Variable<array_1d<double,3> > >& rComponentVariables) override
131  {
132  KRATOS_TRY
133 
134  HyperElasticModel::GetDomainVariablesList(rScalarVariables, rComponentVariables);
135 
136  rScalarVariables.push_back(PRESSURE);
137 
138  KRATOS_CATCH(" ")
139  }
140 
141 
145 
146 
150 
152  std::string Info() const override
153  {
154  std::stringstream buffer;
155  buffer << "IncompressibleHyperElasticModel";
156  return buffer.str();
157  }
158 
160  void PrintInfo(std::ostream& rOStream) const override
161  {
162  rOStream << "IncompressibleHyperElasticModel";
163  }
164 
166  void PrintData(std::ostream& rOStream) const override
167  {
168  rOStream << "IncompressibleHyperElasticModel Data";
169  }
170 
171 
175 
176 
178 
179  protected:
180 
183 
187 
191 
195 
196  //specialized methods:
197 
198  void CalculateVolumetricFactor(HyperElasticDataType& rVariables, double& rFactor) override
199  {
200  KRATOS_TRY
201 
202  rFactor = 1.0;
203 
204  KRATOS_CATCH(" ")
205  }
206 
207  void CalculatePressureFactor(HyperElasticDataType& rVariables, double& rFactor) override
208  {
209  KRATOS_TRY
210 
211  this->CalculateVolumetricFactor(rVariables,rFactor);
212 
213  rFactor *= rVariables.GetModelData().GetPressure() * rVariables.Strain.Invariants.J;
214 
215  KRATOS_CATCH(" ")
216  }
217 
218  void CalculateConstitutiveMatrixFactor(HyperElasticDataType& rVariables, double& rFactor) override
219  {
220  KRATOS_TRY
221 
222  rFactor = 1.0;
223 
224  KRATOS_CATCH(" ")
225  }
226 
227  void CalculateConstitutiveMatrixPressureFactor(HyperElasticDataType& rVariables, double& rFactor) override
228  {
229  KRATOS_TRY
230 
231  rFactor = rVariables.GetModelData().GetPressure() * rVariables.Strain.Invariants.J;
232 
233  KRATOS_CATCH(" ")
234  }
235 
236 
237  //************// dW
238 
239  double& GetVolumetricFunction1stJDerivative(HyperElasticDataType& rVariables, double& rDerivative) override //dU/dJ
240  {
241  KRATOS_TRY
242 
243  const ModelDataType& rValues = rVariables.GetModelData();
244 
245  rDerivative = rValues.GetPressure();
246 
247  return rDerivative;
248 
249  KRATOS_CATCH(" ")
250  };
251 
252 
253  double& GetVolumetricFunction2ndJDerivative(HyperElasticDataType& rVariables, double& rDerivative) override //ddU/dJdJ
254  {
255  KRATOS_TRY
256 
257  rDerivative = 0.0;
258 
259  return rDerivative;
260 
261  KRATOS_CATCH(" ")
262  };
263 
264 
268 
269 
273 
274 
278 
279 
281 
282  private:
283 
286 
287 
291 
292 
296 
297 
301 
302 
306 
307 
311  friend class Serializer;
312 
313 
314  void save(Serializer& rSerializer) const override
315  {
317  }
318 
319  void load(Serializer& rSerializer) override
320  {
322  }
323 
324 
328 
329 
333 
335 
336  }; // Class IncompressibleNeoHookeanModel
337 
339 
342 
343 
347 
348 
350 
352 
353 } // namespace Kratos.
354 
355 #endif // KRATOS_INCOMPRESSIBLE_NEO_HOOKEAN_MODEL_H_INCLUDED defined
void GetDomainVariablesList(std::vector< Variable< double > > &rScalarVariables, std::vector< Variable< array_1d< double, 3 > > > &rComponentVariables) override
Definition: hyper_elastic_model.hpp:270
Short class definition.
Definition: incompressible_neo_hookean_model.hpp:50
void CalculatePressureFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: incompressible_neo_hookean_model.hpp:207
~IncompressibleNeoHookeanModel() override
Destructor.
Definition: incompressible_neo_hookean_model.hpp:83
double & GetVolumetricFunction1stJDerivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: incompressible_neo_hookean_model.hpp:239
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: incompressible_neo_hookean_model.hpp:166
void GetDomainVariablesList(std::vector< Variable< double > > &rScalarVariables, std::vector< Variable< array_1d< double, 3 > > > &rComponentVariables) override
Definition: incompressible_neo_hookean_model.hpp:129
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: incompressible_neo_hookean_model.hpp:160
int Check(const Properties &rProperties, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_neo_hookean_model.hpp:108
void CalculateConstitutiveMatrixFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: incompressible_neo_hookean_model.hpp:218
IncompressibleNeoHookeanModel(IncompressibleNeoHookeanModel const &rOther)
Copy constructor.
Definition: incompressible_neo_hookean_model.hpp:67
IncompressibleNeoHookeanModel & operator=(IncompressibleNeoHookeanModel const &rOther)
Assignment operator.
Definition: incompressible_neo_hookean_model.hpp:70
void CalculateVolumetricFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: incompressible_neo_hookean_model.hpp:198
std::string Info() const override
Turn back information as a string.
Definition: incompressible_neo_hookean_model.hpp:152
void CalculateConstitutiveMatrixPressureFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: incompressible_neo_hookean_model.hpp:227
IncompressibleNeoHookeanModel()
Default constructor.
Definition: incompressible_neo_hookean_model.hpp:64
KRATOS_CLASS_POINTER_DEFINITION(IncompressibleNeoHookeanModel)
Pointer definition of IncompressibleNeoHookeanModel.
double & GetVolumetricFunction2ndJDerivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: incompressible_neo_hookean_model.hpp:253
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: incompressible_neo_hookean_model.hpp:77
Short class definition.
Definition: isochoric_neo_hookean_model.hpp:48
IsochoricNeoHookeanModel & operator=(IsochoricNeoHookeanModel const &rOther)
Assignment operator.
Definition: isochoric_neo_hookean_model.hpp:68
int Check(const Properties &rProperties, const ProcessInfo &rCurrentProcessInfo) override
Definition: isochoric_neo_hookean_model.hpp:112
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
#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
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
const double & GetPressure() const
Definition: constitutive_model_data.hpp:446
Definition: hyper_elastic_model.hpp:108
StrainData Strain
Definition: hyper_elastic_model.hpp:117
const ModelDataType & GetModelData() const
Definition: hyper_elastic_model.hpp:124
StrainInvariants Invariants
Definition: hyper_elastic_model.hpp:98
double J
Definition: hyper_elastic_model.hpp:60