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_plane_strain_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_PLANE_STRAIN_2D_LAW_H_INCLUDED )
11 #define KRATOS_SMALL_STRAIN_PLANE_STRAIN_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) SmallStrainPlaneStrain2DLaw : 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<SmallStrainPlaneStrain2DLaw>(*this);
80  }
81 
84 
85 
89 
91  SizeType WorkingSpaceDimension() override { return 2; }
92 
94  SizeType GetStrainSize() const override { return 3; }
95 
97  void GetLawFeatures(Features& rFeatures) override
98  {
100 
101  //Set the type of law
102  rFeatures.mOptions.Set( PLANE_STRAIN_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 << "SmallStrainPlaneStrain2DLaw" ;
146  return buffer.str();
147  }
148 
150  void PrintInfo(std::ostream& rOStream) const override {rOStream << "SmallStrainPlaneStrain2DLaw";}
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  // Plane strain constitutive matrix
195  rConstitutiveMatrix ( 0 , 0 ) = (rYoungModulus*(1.0-rPoissonCoefficient)/((1.0+rPoissonCoefficient)*(1.0-2.0*rPoissonCoefficient)));
196  rConstitutiveMatrix ( 1 , 1 ) = rConstitutiveMatrix ( 0 , 0 );
197 
198  rConstitutiveMatrix ( 2 , 2 ) = rConstitutiveMatrix ( 0 , 0 )*(1.0-2.0*rPoissonCoefficient)/(2.0*(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 ) = 0.0;
204  rConstitutiveMatrix ( 2 , 0 ) = 0.0;
205  rConstitutiveMatrix ( 1 , 2 ) = 0.0;
206  rConstitutiveMatrix ( 2 , 1 ) = 0.0;
207 
208  KRATOS_CATCH(" ")
209  }
210 
211 
215 
216 
220 
221 
225 
226 
230 
231 
233 
234  private:
237 
238 
242 
243 
247 
248 
252 
253 
257 
258 
262 
263 
267  friend class Serializer;
268 
269  void save(Serializer& rSerializer) const override
270  {
272  }
273 
274  void load(Serializer& rSerializer) override
275  {
277  }
278 
279 
283 
285 
286  }; // Class SmallStrainPlaneStrain2DLaw
287 
289 
292 
293 
297 
298 
300 
302 
303 } // namespace Kratos.
304 
305 #endif // KRATOS_SMALL_STRAIN_PLANE_STRAIN_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_plane_strain_2D_law.hpp:48
SmallStrainPlaneStrain2DLaw(const SmallStrainPlaneStrain2DLaw &rOther)
Copy constructor.
Definition: small_strain_plane_strain_2D_law.hpp:67
SmallStrainPlaneStrain2DLaw & operator=(SmallStrainPlaneStrain2DLaw const &rOther)
Assignment operator.
Definition: small_strain_plane_strain_2D_law.hpp:70
void GetLawFeatures(Features &rFeatures) override
Law Features.
Definition: small_strain_plane_strain_2D_law.hpp:97
std::string Info() const override
Turn back information as a string.
Definition: small_strain_plane_strain_2D_law.hpp:142
~SmallStrainPlaneStrain2DLaw() override
Destructor.
Definition: small_strain_plane_strain_2D_law.hpp:83
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: small_strain_plane_strain_2D_law.hpp:153
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: small_strain_plane_strain_2D_law.hpp:150
ConstitutiveLaw::Pointer Clone() const override
Clone.
Definition: small_strain_plane_strain_2D_law.hpp:77
SmallStrainPlaneStrain2DLaw(ModelTypePointer pModel)
Constructor.
Definition: small_strain_plane_strain_2D_law.hpp:64
SmallStrainPlaneStrain2DLaw()
Default constructor.
Definition: small_strain_plane_strain_2D_law.hpp:61
SizeType GetStrainSize() const override
Law Voigt Strain Size.
Definition: small_strain_plane_strain_2D_law.hpp:94
void CalculateConstitutiveMatrix(Matrix &rConstitutiveMatrix, const Properties &rProperties) override
Definition: small_strain_plane_strain_2D_law.hpp:185
SizeType WorkingSpaceDimension() override
Law Dimension.
Definition: small_strain_plane_strain_2D_law.hpp:91
KRATOS_CLASS_POINTER_DEFINITION(SmallStrainPlaneStrain2DLaw)
Pointer definition of SmallStrainPlaneStrain2DLaw.
#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