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.
small_strain_axisymmetric_2D_law.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_SMALL_STRAIN_AXISYMMETRIC_2D_LAW_H_INCLUDED)
11 #define KRATOS_SMALL_STRAIN_AXISYMMETRIC_2D_LAW_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) SmallStrainAxisymmetric2DLaw : public SmallStrain3DLaw
48  {
49  public:
52 
55 
59 
62 
65 
68 
71  {
73  return *this;
74  }
75 
77  ConstitutiveLaw::Pointer Clone() const override
78  {
79  return Kratos::make_shared<SmallStrainAxisymmetric2DLaw>(*this);
80  }
81 
84 
85 
89 
91  SizeType WorkingSpaceDimension() override { return 2; }
92 
94  SizeType GetStrainSize() const override { return 4; }
95 
97  void GetLawFeatures(Features& rFeatures) override
98  {
100 
101  //Set the type of law
102  rFeatures.mOptions.Set( AXISYMMETRIC_LAW );
103  rFeatures.mOptions.Set( INFINITESIMAL_STRAINS );
104  rFeatures.mOptions.Set( ISOTROPIC );
105 
106  //Get model features
107  GetModelFeatures(rFeatures);
108 
109  //Set strain measure required by the consitutive law
110  rFeatures.mStrainMeasures.push_back(StrainMeasure_Infinitesimal);
111  rFeatures.mStrainMeasures.push_back(StrainMeasure_Deformation_Gradient);
112 
113  //Set the strain size
114  rFeatures.mStrainSize = GetStrainSize();
115 
116  //Set the spacedimension
117  rFeatures.mSpaceDimension = WorkingSpaceDimension();
118 
119  KRATOS_CATCH(" ")
120  }
121 
125 
126 
130 
131 
135 
136 
140 
142  std::string Info() const override
143  {
144  std::stringstream buffer;
145  buffer << "SmallStrainAxisymmetric2DLaw" ;
146  return buffer.str();
147  }
148 
150  void PrintInfo(std::ostream& rOStream) const override {rOStream << "SmallStrainAxisymmetric2DLaw";}
151 
153  void PrintData(std::ostream& rOStream) const override {}
154 
155 
159 
160 
162 
163  protected:
166 
167 
171 
172 
176 
177 
185  void CalculateConstitutiveMatrix(Matrix& rConstitutiveMatrix,
186  const Properties& rProperties) override
187  {
188  KRATOS_TRY
189 
190  // Lame constants
191  const double& rYoungModulus = rProperties[YOUNG_MODULUS];
192  const double& rPoissonCoefficient = rProperties[POISSON_RATIO];
193 
194  rConstitutiveMatrix ( 0 , 0 ) = (rYoungModulus*(1.0-rPoissonCoefficient)/((1.0+rPoissonCoefficient)*(1.0-2*rPoissonCoefficient)));
195  rConstitutiveMatrix ( 1 , 1 ) = rConstitutiveMatrix ( 0 , 0 );
196  rConstitutiveMatrix ( 2 , 2 ) = rConstitutiveMatrix ( 0 , 0 );
197 
198  rConstitutiveMatrix ( 3 , 3 ) = rConstitutiveMatrix ( 0 , 0 )*(1-2*rPoissonCoefficient)/(2*(1.0-rPoissonCoefficient));
199 
200  rConstitutiveMatrix ( 0 , 1 ) = rConstitutiveMatrix ( 0 , 0 )*rPoissonCoefficient/(1.0-rPoissonCoefficient);
201  rConstitutiveMatrix ( 1 , 0 ) = rConstitutiveMatrix ( 0 , 1 );
202 
203  rConstitutiveMatrix ( 0 , 2 ) = rConstitutiveMatrix ( 0 , 1 );
204 
205  rConstitutiveMatrix ( 2 , 0 ) = rConstitutiveMatrix ( 0 , 1 );
206 
207  rConstitutiveMatrix ( 1 , 2 ) = rConstitutiveMatrix ( 0 , 1 );
208 
209  rConstitutiveMatrix ( 2 , 1 ) = rConstitutiveMatrix ( 0 , 1 );
210 
211  KRATOS_CATCH(" ")
212  }
213 
214 
218 
219 
223 
224 
228 
229 
233 
234 
236 
237  private:
240 
241 
245 
246 
250 
251 
255 
256 
260 
261 
265 
266 
270  friend class Serializer;
271 
272  void save(Serializer& rSerializer) const override
273  {
275  }
276 
277  void load(Serializer& rSerializer) override
278  {
280  }
281 
282 
286 
287 
289 
290  }; // Class SmallStrainAxisymmetric2DLaw
291 
293 
296 
297 
301 
302 
304 
306 
307 } // namespace Kratos.
308 
309 #endif // KRATOS_SMALL_STRAIN_AXISYMMETRIC_2D_LAW_H_INCLUDED defined
std::size_t SizeType
Definition: constitutive_law.h:82
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
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
Definition: small_strain_3D_law.hpp:33
SmallStrain3DLaw & operator=(const SmallStrain3DLaw &rOther)
Assignment operator.
Definition: small_strain_3D_law.cpp:59
ModelType::Pointer ModelTypePointer
Definition: small_strain_3D_law.hpp:40
Short class definition.
Definition: small_strain_axisymmetric_2D_law.hpp:48
SizeType GetStrainSize() const override
Law Voigt Strain Size.
Definition: small_strain_axisymmetric_2D_law.hpp:94
SmallStrainAxisymmetric2DLaw(ModelTypePointer pModel)
Constructor.
Definition: small_strain_axisymmetric_2D_law.hpp:64
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: small_strain_axisymmetric_2D_law.hpp:150
SmallStrainAxisymmetric2DLaw & operator=(SmallStrainAxisymmetric2DLaw const &rOther)
Assignment operator.
Definition: small_strain_axisymmetric_2D_law.hpp:70
SmallStrainAxisymmetric2DLaw()
Default constructor.
Definition: small_strain_axisymmetric_2D_law.hpp:61
void CalculateConstitutiveMatrix(Matrix &rConstitutiveMatrix, const Properties &rProperties) override
Definition: small_strain_axisymmetric_2D_law.hpp:185
SizeType WorkingSpaceDimension() override
Law Dimension.
Definition: small_strain_axisymmetric_2D_law.hpp:91
KRATOS_CLASS_POINTER_DEFINITION(SmallStrainAxisymmetric2DLaw)
Pointer definition of SmallStrainAxisymmetric2DLaw.
void GetLawFeatures(Features &rFeatures) override
Law Features.
Definition: small_strain_axisymmetric_2D_law.hpp:97
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: small_strain_axisymmetric_2D_law.hpp:153
SmallStrainAxisymmetric2DLaw(const SmallStrainAxisymmetric2DLaw &rOther)
Copy constructor.
Definition: small_strain_axisymmetric_2D_law.hpp:67
ConstitutiveLaw::Pointer Clone() const override
Clone.
Definition: small_strain_axisymmetric_2D_law.hpp:77
std::string Info() const override
Turn back information as a string.
Definition: small_strain_axisymmetric_2D_law.hpp:142
~SmallStrainAxisymmetric2DLaw() override
Destructor.
Definition: small_strain_axisymmetric_2D_law.hpp:83
#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_law.h:137
SizeType mStrainSize
Definition: constitutive_law.h:152
std::vector< StrainMeasure > mStrainMeasures
Definition: constitutive_law.h:154
SizeType mSpaceDimension
Definition: constitutive_law.h:153
Flags mOptions
Definition: constitutive_law.h:151