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_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_INCOMPRESSIBLE_HYPO_ELASTIC_MODEL_H_INCLUDED)
11 #define KRATOS_INCOMPRESSIBLE_HYPO_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) IncompressibleHypoElasticModel : public IsochoricHypoElasticModel
48  {
49  public:
50 
53 
56 
60 
63 
66 
69  {
71  return *this;
72  }
73 
75  ConstitutiveModel::Pointer Clone() const override
76  {
77  return Kratos::make_shared<IncompressibleHypoElasticModel>(*this);
78  }
79 
82 
83 
87 
88 
92 
93 
94  // Simplyfied methods must be implemented for performance purposes
95 
96  //************************************************************************************
97  //************************************************************************************
98 
99  int Check(const Properties& rProperties, const ProcessInfo& rCurrentProcessInfo) override
100  {
101  KRATOS_TRY
102 
103  if(YOUNG_MODULUS.Key() == 0 || rProperties[YOUNG_MODULUS] <= 0.00)
104  KRATOS_ERROR << "YOUNG_MODULUS has Key zero or invalid value" << std::endl;
105 
106  if(POISSON_RATIO.Key() == 0){
107  KRATOS_ERROR << "POISSON_RATIO has Key zero invalid value" << std::endl;
108  }
109  else{
110  const double& nu = rProperties[POISSON_RATIO];
111  if( nu < -0.999 && nu > -1.01 )
112  KRATOS_ERROR << "POISSON_RATIO has an invalid value" << std::endl;
113  }
114 
115  return 0;
116 
117 
118  KRATOS_CATCH(" ")
119  }
120 
121 
125 
131  void GetDomainVariablesList(std::vector<Variable<double> >& rScalarVariables,
132  std::vector<Variable<array_1d<double,3> > >& rComponentVariables) override
133  {
134  KRATOS_TRY
135 
136  HypoElasticModel::GetDomainVariablesList(rScalarVariables, rComponentVariables);
137 
138  rScalarVariables.push_back(PRESSURE);
139 
140  KRATOS_CATCH(" ")
141  }
142 
146 
147 
151 
153  std::string Info() const override
154  {
155  std::stringstream buffer;
156  buffer << "IncompressibleHypoElasticModel";
157  return buffer.str();
158  }
159 
161  void PrintInfo(std::ostream& rOStream) const override
162  {
163  rOStream << "IncompressibleHypoElasticModel";
164  }
165 
167  void PrintData(std::ostream& rOStream) const override
168  {
169  rOStream << "IncompressibleHypoElasticModel Data";
170  }
171 
175 
176 
178 
179  protected:
180 
183 
184 
188 
189 
193 
194 
198 
199  void CalculateAndAddVolumetricStressTensor(ElasticDataType& rVariables, VectorType& rStrainVector, VectorType& rStressVector) override
200  {
201  KRATOS_TRY
202 
203  const ModelDataType& rValues = rVariables.GetModelData();
204 
205  //volumetric stress
206  const double& Pressure = rValues.GetPressure();
207  for(unsigned int i = 0; i < 3; i++)
208  rStressVector[i] += Pressure;
209 
210  KRATOS_CATCH(" ")
211  }
212 
213 
214  // set the default volumetric function for the incompressible case
215 
216  void CalculateAndAddVolumetricStrainEnergy(ElasticDataType& rVariables, double& rVolumetricDensityFunction) override
217  {
218  KRATOS_TRY
219 
220  KRATOS_ERROR << "calling the class function in IncompressibleHypoElasticModel ... illegal operation" << std::endl;
221 
222  KRATOS_CATCH(" ")
223  }
224 
225 
229 
230 
234 
235 
239 
240 
242 
243  private:
244 
247 
248 
252 
253 
257 
258 
262 
263 
267 
268 
272  friend class Serializer;
273 
274 
275  void save(Serializer& rSerializer) const override
276  {
278  }
279 
280  void load(Serializer& rSerializer) override
281  {
283  }
284 
288 
289 
293 
295 
296  }; // Class IncompressibleHypoElasticModel
297 
299 
302 
303 
307 
308 
310 
312 
313 } // namespace Kratos.
314 
315 #endif // KRATOS_INCOMPRESSIBLE_HYPO_ELASTIC_MODEL_H_INCLUDED defined
Short class definition.
Definition: hypo_elastic_model.hpp:50
void GetDomainVariablesList(std::vector< Variable< double > > &rScalarVariables, std::vector< Variable< array_1d< double, 3 > > > &rComponentVariables) override
Definition: hypo_elastic_model.hpp:216
HypoElasticModel & operator=(HypoElasticModel const &rOther)
Assignment operator.
Definition: hypo_elastic_model.cpp:46
Short class definition.
Definition: incompressible_hypo_elastic_model.hpp:48
~IncompressibleHypoElasticModel() override
Destructor.
Definition: incompressible_hypo_elastic_model.hpp:81
void CalculateAndAddVolumetricStrainEnergy(ElasticDataType &rVariables, double &rVolumetricDensityFunction) override
Definition: incompressible_hypo_elastic_model.hpp:216
IncompressibleHypoElasticModel(IncompressibleHypoElasticModel const &rOther)
Copy constructor.
Definition: incompressible_hypo_elastic_model.hpp:65
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: incompressible_hypo_elastic_model.hpp:161
IncompressibleHypoElasticModel & operator=(IncompressibleHypoElasticModel const &rOther)
Assignment operator.
Definition: incompressible_hypo_elastic_model.hpp:68
void GetDomainVariablesList(std::vector< Variable< double > > &rScalarVariables, std::vector< Variable< array_1d< double, 3 > > > &rComponentVariables) override
Definition: incompressible_hypo_elastic_model.hpp:131
KRATOS_CLASS_POINTER_DEFINITION(IncompressibleHypoElasticModel)
Pointer definition of IncompressibleHypoElasticModel.
void CalculateAndAddVolumetricStressTensor(ElasticDataType &rVariables, VectorType &rStrainVector, VectorType &rStressVector) override
Definition: incompressible_hypo_elastic_model.hpp:199
int Check(const Properties &rProperties, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_hypo_elastic_model.hpp:99
IncompressibleHypoElasticModel()
Default constructor.
Definition: incompressible_hypo_elastic_model.hpp:62
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: incompressible_hypo_elastic_model.hpp:167
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: incompressible_hypo_elastic_model.hpp:75
std::string Info() const override
Turn back information as a string.
Definition: incompressible_hypo_elastic_model.hpp:153
Short class definition.
Definition: isochoric_hypo_elastic_model.hpp:48
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
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
nu
Definition: isotropic_damage_automatic_differentiation.py:135
def load(f)
Definition: ode_solve.py:307
integer i
Definition: TensorModule.f:17
Definition: constitutive_model_data.hpp:383
const double & GetPressure() const
Definition: constitutive_model_data.hpp:446
Definition: hypo_elastic_model.hpp:54
const ModelDataType & GetModelData() const
Definition: hypo_elastic_model.hpp:70