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.
truss_plasticity_constitutive_law.h
Go to the documentation of this file.
1 // KRATOS ___ _ _ _ _ _ __ _
2 // / __\___ _ __ ___| |_(_) |_ _ _| |_(_)_ _____ / / __ ___ _____ /_\ _ __ _ __
3 // / / / _ \| '_ \/ __| __| | __| | | | __| \ \ / / _ \/ / / _` \ \ /\ / / __| //_\\| '_ \| '_ |
4 // / /__| (_) | | | \__ \ |_| | |_| |_| | |_| |\ V / __/ /__| (_| |\ V V /\__ \/ _ \ |_) | |_) |
5 // \____/\___/|_| |_|___/\__|_|\__|\__,_|\__|_| \_/ \___\____/\__,_| \_/\_/ |___/\_/ \_/ .__/| .__/
6 // |_| |_|
7 //
8 // License: BSD License
9 // license: structural_mechanics_application/license.txt
10 //
11 // Main authors: Klaus B. Sautter
12 //
13 
14 #pragma once
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
22 #include "includes/checks.h"
23 
24 namespace Kratos
25 {
26 
36 class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) TrussPlasticityConstitutiveLaw : public ConstitutiveLaw
37 {
38 public:
44  typedef std::size_t SizeType;
50 
59 
60  ConstitutiveLaw::Pointer Clone() const override;
61 
66 
67 
72 
85  void GetLawFeatures(Features& rFeatures) override;
86 
87  void SetValue(const Variable<double>& rThisVariable,
88  const double& rValue,
89  const ProcessInfo& rCurrentProcessInfo) override;
90 
91  double& GetValue(const Variable<double>& rThisVariable,
92  double& rValue) override;
93 
95  array_1d<double, 3 > & rValue) override;
96 
97  double& CalculateValue(ConstitutiveLaw::Parameters& rParameterValues,
98  const Variable<double>& rThisVariable,
99  double& rValue) override;
100 
106  double TrialYieldFunction(const Properties& rMaterialProperties,
107  const double& rCurrentStress);
108 
114  bool CheckIfIsPlasticRegime(Parameters& rValues,const double& rCurrentStress);
115 
116  void FinalizeMaterialResponsePK2(Parameters& rValues) override;
117 
118  void CalculateMaterialResponsePK2(Parameters& rValues) override;
119 
120  void CalculateMaterialResponsePK2Custom(Parameters& rValues, double& rCurrentAccumulatedPlasticStrain, double& rCurrentPlasticAlpha);
121 
123  {
124  return false;
125  }
126 
130  SizeType GetStrainSize() const override
131  {
132  return 1;
133  }
134 
144  int Check(
145  const Properties& rMaterialProperties,
146  const GeometryType& rElementGeometry,
147  const ProcessInfo& rCurrentProcessInfo
148  ) const override;
149 
150 protected:
151 
154 
158 
162 
167 
168 private:
169 
172 
176  //the following members are
177  bool mCurrentInElasticFlag = false;
178  double mPlasticAlpha = 0.0;
179  double mAccumulatedPlasticStrain = 0.0;
180 
184 
189 
190 
195 
199  friend class Serializer;
200 
201  void save(Serializer& rSerializer) const override
202  {
204  rSerializer.save("PlasticAlpha", mPlasticAlpha);
205  rSerializer.save("AccumulatedPlasticStrain", mAccumulatedPlasticStrain);
206  rSerializer.save("CurrentInElasticFlag", mCurrentInElasticFlag);
207  }
208 
209  void load(Serializer& rSerializer) override
210  {
212  rSerializer.load("PlasticAlpha", mPlasticAlpha);
213  rSerializer.load("AccumulatedPlasticStrain", mAccumulatedPlasticStrain);
214  rSerializer.load("CurrentInElasticFlag", mCurrentInElasticFlag);
215  }
216 
217 
218 }; // Class TrussPlasticityConstitutiveLaw
219 } // namespace Kratos.
Definition: constitutive_law.h:47
std::size_t SizeType
Definition: constitutive_law.h:82
Geometry base class.
Definition: geometry.h:71
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
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
ConstitutiveLaw BaseType
Definition: truss_plasticity_constitutive_law.h:43
ProcessInfo ProcessInfoType
Definition: truss_plasticity_constitutive_law.h:42
bool RequiresInitializeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: truss_plasticity_constitutive_law.h:122
SizeType GetStrainSize() const override
Definition: truss_plasticity_constitutive_law.h:130
KRATOS_CLASS_POINTER_DEFINITION(TrussPlasticityConstitutiveLaw)
std::size_t SizeType
Definition: truss_plasticity_constitutive_law.h:44
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
This constitutive law represents a linear hardening plasticity 1D law.
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_law.h:137
Definition: constitutive_law.h:189