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.
von_mises_linear_elastic_plasticity_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_VON_MISES_LINEAR_ELASTIC_PLASTICITY_MODEL_H_INCLUDED )
11 #define KRATOS_VON_MISES_LINEAR_ELASTIC_PLASTICITY_MODEL_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
22 
23 namespace Kratos
24 {
27 
30 
34 
38 
42 
46 
48 
50  class KRATOS_API(CONSTITUTIVE_MODELS_APPLICATION) VonMisesLinearElasticPlasticityModel : public NonLinearAssociativePlasticityModel<LinearElasticModel, MisesHuberYieldSurface<SimoExponentialHardeningRule> >
51  {
52  public:
53 
56 
57  //elasticity model
59  typedef ElasticityModelType::Pointer ElasticityModelPointer;
60 
61  //yield surface
64  typedef YieldSurfaceType::Pointer YieldSurfacePointer;
65 
66  //base type
68 
69  //common types
70  typedef BaseType::Pointer BaseTypePointer;
78 
79 
82 
86 
89  {
90  mPlasticStrainVector.clear();
91  }
92 
95  :BaseType(rOther)
96  ,mPlasticStrainVector(rOther.mPlasticStrainVector){}
97 
100  {
101  BaseType::operator=(rOther);
102  mPlasticStrainVector = rOther.mPlasticStrainVector;
103  return *this;
104  }
105 
107  ConstitutiveModel::Pointer Clone() const override
108  {
109  return Kratos::make_shared<VonMisesLinearElasticPlasticityModel>(*this);
110  }
111 
114 
115 
119 
120 
124 
125 
129 
133  bool Has(const Variable<double>& rThisVariable) override
134  {
135  if(rThisVariable == PLASTIC_STRAIN || rThisVariable == DELTA_PLASTIC_STRAIN )
136  return true;
137 
138  return false;
139  }
140 
141 
145  double& GetValue(const Variable<double>& rThisVariable, double& rValue) override
146  {
147 
148  rValue=0;
149 
150  if (rThisVariable==PLASTIC_STRAIN)
151  {
152  rValue = this->mInternal.Variables[0];
153  }
154 
155 
156  if (rThisVariable==DELTA_PLASTIC_STRAIN)
157  {
158  rValue = this->mInternal.Variables[0]-mPreviousInternal.Variables[0];
159  }
160 
161 
162  return rValue;
163  }
164 
168 
169 
173 
175  std::string Info() const override
176  {
177  std::stringstream buffer;
178  buffer << "VonMisesLinearElasticPlasticityModel" ;
179  return buffer.str();
180  }
181 
183  void PrintInfo(std::ostream& rOStream) const override
184  {
185  rOStream << "VonMisesLinearElasticPlasticityModel";
186  }
187 
189  void PrintData(std::ostream& rOStream) const override
190  {
191  rOStream << "VonMisesLinearElasticPlasticityModel Data";
192  }
193 
197 
198 
200 
201  protected:
204 
205 
209 
210 
214 
215 
219 
223  void InitializeVariables(ModelDataType& rValues, PlasticDataType& rVariables) override
224  {
225  KRATOS_TRY
226 
227  BaseType::InitializeVariables(rValues,rVariables);
228 
229  //elastic strain
230  VectorType StrainVector;
232 
233  StrainVector -= mPlasticStrainVector;
234 
236 
237  KRATOS_CATCH(" ")
238  }
239 
243  void UpdateInternalVariables(ModelDataType& rValues, PlasticDataType& rVariables, const MatrixType& rStressMatrix) override
244  {
245  KRATOS_TRY
246 
247  double& rEquivalentPlasticStrainOld = mPreviousInternal.Variables[0];
248  double& rEquivalentPlasticStrain = mInternal.Variables[0];
249  double& rDeltaGamma = rVariables.DeltaInternal.Variables[0];
250 
251  //update mechanical variables
252  rEquivalentPlasticStrainOld = rEquivalentPlasticStrain;
253  rEquivalentPlasticStrain += sqrt(2.0/3.0) * rDeltaGamma;
254 
255  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
256 
257  //update plastic strain measure
258  rValues.StrainMatrix = ConstitutiveModelUtilities::StrainVectorToTensor(mPlasticStrainVector, rValues.StrainMatrix);
259  rValues.StrainMatrix += rDeltaGamma * rStressMatrix / (rVariables.StressNorm - 2.0 * rMaterial.GetLameMuBar() * rDeltaGamma);
260  ConstitutiveModelUtilities::StrainTensorToVector(rValues.StrainMatrix, mPlasticStrainVector);
261 
262  KRATOS_CATCH(" ")
263  }
264 
265 
269 
270 
274 
275 
279 
280 
282 
283  private:
286 
287 
291 
292  VectorType mPlasticStrainVector;
293 
297 
298 
302 
303 
307 
308 
312 
313 
317  friend class Serializer;
318 
319  void save(Serializer& rSerializer) const override
320  {
322  }
323 
324  void load(Serializer& rSerializer) override
325  {
326  KRATOS_SERIALIZE_LOAD_BASE_CLASS( rSerializer, BaseType )
327  }
328 
332 
333 
335 
336  }; // Class VonMisesLinearElasticPlasticityModel
337 
339 
342 
343 
347 
348 
352 
353 
355 
357 
358 
359 } // namespace Kratos.
360 
361 #endif // KRATOS_VON_MISES_LINEAR_ELASTIC_PLASTICITY_MODEL_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
static void StrainTensorToVector(const MatrixType &rMatrix, array_1d< double, 6 > &rVector)
Definition: constitutive_model_utilities.hpp:646
static MatrixType & StrainVectorToTensor(const array_1d< double, 6 > &rVector, MatrixType &rMatrix)
Definition: constitutive_model_utilities.hpp:619
Definition: amatrix_interface.h:41
Short class definition.
Definition: linear_elastic_model.hpp:50
Short class definition.
Definition: mises_huber_yield_surface.hpp:50
Short class definition.
Definition: non_linear_associative_plasticity_model.hpp:50
BaseType::SizeType SizeType
Definition: non_linear_associative_plasticity_model.hpp:67
BaseType::PlasticDataType PlasticDataType
Definition: non_linear_associative_plasticity_model.hpp:72
BaseType::InternalVariablesType InternalVariablesType
Definition: non_linear_associative_plasticity_model.hpp:73
BaseType::VoigtIndexType VoigtIndexType
Definition: non_linear_associative_plasticity_model.hpp:68
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: simo_exponential_hardening_rule.hpp:49
Short class definition.
Definition: von_mises_linear_elastic_plasticity_model.hpp:51
ElasticityModelType::Pointer ElasticityModelPointer
Definition: von_mises_linear_elastic_plasticity_model.hpp:59
BaseType::MaterialDataType MaterialDataType
Definition: von_mises_linear_elastic_plasticity_model.hpp:75
MisesHuberYieldSurface< HardeningRuleType > YieldSurfaceType
Definition: von_mises_linear_elastic_plasticity_model.hpp:63
BaseType::PlasticDataType PlasticDataType
Definition: von_mises_linear_elastic_plasticity_model.hpp:76
void InitializeVariables(ModelDataType &rValues, PlasticDataType &rVariables) override
Definition: von_mises_linear_elastic_plasticity_model.hpp:223
KRATOS_CLASS_POINTER_DEFINITION(VonMisesLinearElasticPlasticityModel)
Pointer definition of VonMisesLinearElasticPlasticityModel.
std::string Info() const override
Turn back information as a string.
Definition: von_mises_linear_elastic_plasticity_model.hpp:175
bool Has(const Variable< double > &rThisVariable) override
Definition: von_mises_linear_elastic_plasticity_model.hpp:133
BaseType::SizeType SizeType
Definition: von_mises_linear_elastic_plasticity_model.hpp:71
VonMisesLinearElasticPlasticityModel()
Default constructor.
Definition: von_mises_linear_elastic_plasticity_model.hpp:88
YieldSurfaceType::Pointer YieldSurfacePointer
Definition: von_mises_linear_elastic_plasticity_model.hpp:64
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: von_mises_linear_elastic_plasticity_model.hpp:107
BaseType::VoigtIndexType VoigtIndexType
Definition: von_mises_linear_elastic_plasticity_model.hpp:72
BaseType::InternalVariablesType InternalVariablesType
Definition: von_mises_linear_elastic_plasticity_model.hpp:77
VonMisesLinearElasticPlasticityModel(VonMisesLinearElasticPlasticityModel const &rOther)
Copy constructor.
Definition: von_mises_linear_elastic_plasticity_model.hpp:94
~VonMisesLinearElasticPlasticityModel() override
Destructor.
Definition: von_mises_linear_elastic_plasticity_model.hpp:113
BaseType::MatrixType MatrixType
Definition: von_mises_linear_elastic_plasticity_model.hpp:73
VonMisesLinearElasticPlasticityModel & operator=(VonMisesLinearElasticPlasticityModel const &rOther)
Assignment operator.
Definition: von_mises_linear_elastic_plasticity_model.hpp:99
LinearElasticModel ElasticityModelType
Definition: von_mises_linear_elastic_plasticity_model.hpp:58
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: von_mises_linear_elastic_plasticity_model.hpp:183
BaseType::ModelDataType ModelDataType
Definition: von_mises_linear_elastic_plasticity_model.hpp:74
void UpdateInternalVariables(ModelDataType &rValues, PlasticDataType &rVariables, const MatrixType &rStressMatrix) override
Definition: von_mises_linear_elastic_plasticity_model.hpp:243
BaseType::Pointer BaseTypePointer
Definition: von_mises_linear_elastic_plasticity_model.hpp:70
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: von_mises_linear_elastic_plasticity_model.hpp:189
NonLinearAssociativePlasticityModel< ElasticityModelType, YieldSurfaceType > BaseType
Definition: von_mises_linear_elastic_plasticity_model.hpp:67
SimoExponentialHardeningRule HardeningRuleType
Definition: von_mises_linear_elastic_plasticity_model.hpp:62
double & GetValue(const Variable< double > &rThisVariable, double &rValue) override
Definition: von_mises_linear_elastic_plasticity_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
void InitializeVariables(TContainerType &rContainer, const Variable< TDataType > &rOutputVariable, const Variable< TDataType > &rReferenceVariable)
Definition: temporal_method_utilities.h:36
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:92
const double & GetLameMuBar() const
Definition: constitutive_model_data.hpp:112
Definition: constitutive_model_data.hpp:383
MatrixType StrainMatrix
Definition: constitutive_model_data.hpp:402