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.
generic_small_strain_viscoplasticity_3d.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: Alejandro Cornejo & Lucia Barbu
12 // Collaborator: Vicente Mataix Ferrandiz
13 //
14 
15 #pragma once
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
23 
24 namespace Kratos
25 {
28 
32 
36 
40 
44 
51 class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericSmallStrainViscoplasticity3D
52  : public ConstitutiveLaw
53 {
54  public:
57 
60 
64 
69  {
70  }
71 
76  ConstitutiveLaw::Pointer pPlasticityLaw,
77  ConstitutiveLaw::Pointer pViscousLaw) : mpPlasticityConstitutiveLaw(pPlasticityLaw), mpViscousConstitutiveLaw(pViscousLaw)
78  {
79  }
80 
84  ConstitutiveLaw::Pointer Clone() const override
85  {
86  auto p_law = Kratos::make_shared<GenericSmallStrainViscoplasticity3D>(*this);
87 
88  p_law->SetPlasticityConstitutiveLaw(mpPlasticityConstitutiveLaw->Clone());
89  p_law->SetViscousConstitutiveLaw(mpViscousConstitutiveLaw->Clone());
90 
91  return p_law;
92  }
93 
94  // Copy constructor
96  : ConstitutiveLaw(rOther), mpPlasticityConstitutiveLaw(rOther.mpPlasticityConstitutiveLaw), mpViscousConstitutiveLaw(rOther.mpViscousConstitutiveLaw)
97  {
98  }
99 
104  {
105  }
106 
110 
114 
120  ConstitutiveLaw::Pointer Create(Kratos::Parameters NewParameters) const override;
121 
126  {
127  return 3;
128  };
129 
133  SizeType GetStrainSize() const override
134  {
135  return 6;
136  };
137 
142  void CalculateMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;
143 
148  void CalculateMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;
149 
154  void CalculateMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;
155 
160  void CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;
161 
170  void FinalizeSolutionStep(
171  const Properties &rMaterialProperties,
172  const GeometryType &rElementGeometry,
173  const Vector &rShapeFunctionsValues,
174  const ProcessInfo &rCurrentProcessInfo) override;
175 
180  void FinalizeMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;
181 
186  void FinalizeMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;
187 
192  void FinalizeMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;
193 
198  void FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;
199 
200  Vector &GetValue(const Variable<Vector> &rThisVariable, Vector &rValue) override;
201 
202  double &GetValue(const Variable<double> &rThisVariable, double &rValue) override;
203 
204  bool Has(const Variable<double> &rThisVariable) override;
205 
210  {
211  return true;
212  }
213 
218  {
219  return false;
220  }
221 
222  double &CalculateValue(
223  Parameters &rParameterValues,
224  const Variable<double> &rThisVariable,
225  double &rValue) override;
226 
230 
234 
238 
242 
244 
245  protected:
248 
252 
256 
257  ConstitutiveLaw::Pointer GetPlasticityConstitutiveLaw()
258  {
259  return mpPlasticityConstitutiveLaw;
260  }
261 
262  void SetPlasticityConstitutiveLaw(ConstitutiveLaw::Pointer pPlasticityConstitutiveLaw)
263  {
264  mpPlasticityConstitutiveLaw = pPlasticityConstitutiveLaw;
265  }
266 
267  ConstitutiveLaw::Pointer GetViscousConstitutiveLaw()
268  {
269  return mpViscousConstitutiveLaw;
270  }
271 
272  void SetViscousConstitutiveLaw(ConstitutiveLaw::Pointer pViscousConstitutiveLaw)
273  {
274  mpViscousConstitutiveLaw = pViscousConstitutiveLaw;
275  }
276 
280 
284 
288 
292 
294  private:
297 
301 
302  ConstitutiveLaw::Pointer mpPlasticityConstitutiveLaw;
303  ConstitutiveLaw::Pointer mpViscousConstitutiveLaw;
304 
308 
312 
318  void CalculateElasticMatrix(
319  Matrix &rElasticityTensor,
320  const Properties &rMaterialProperties);
321 
325 
329 
333 
334  // Serialization
335 
336  friend class Serializer;
337 
338  void save(Serializer &rSerializer) const override
339  {
341  rSerializer.save("PlasticityConstitutiveLaw", mpPlasticityConstitutiveLaw);
342  rSerializer.save("ViscousConstitutiveLaw", mpViscousConstitutiveLaw);
343  }
344 
345  void load(Serializer &rSerializer) override
346  {
348  rSerializer.load("PlasticityConstitutiveLaw", mpPlasticityConstitutiveLaw);
349  rSerializer.load("ViscousConstitutiveLaw", mpViscousConstitutiveLaw);
350  }
351 
353 
354 }; // Class GenericYieldSurface
355 
356 } // namespace Kratos
Definition: constitutive_law.h:47
std::size_t SizeType
Definition: constitutive_law.h:82
Definition: generic_small_strain_viscoplasticity_3d.h:53
ConstitutiveLaw::Pointer GetViscousConstitutiveLaw()
Definition: generic_small_strain_viscoplasticity_3d.h:267
bool RequiresInitializeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: generic_small_strain_viscoplasticity_3d.h:217
KRATOS_CLASS_POINTER_DEFINITION(GenericSmallStrainViscoplasticity3D)
Counted pointer of GenericSmallStrainViscoplasticity3D.
GenericSmallStrainViscoplasticity3D(GenericSmallStrainViscoplasticity3D const &rOther)
Definition: generic_small_strain_viscoplasticity_3d.h:95
ConstitutiveLaw::Pointer GetPlasticityConstitutiveLaw()
Definition: generic_small_strain_viscoplasticity_3d.h:257
GenericSmallStrainViscoplasticity3D()
Definition: generic_small_strain_viscoplasticity_3d.h:68
ConstitutiveLaw::Pointer Clone() const override
Definition: generic_small_strain_viscoplasticity_3d.h:84
SizeType WorkingSpaceDimension() override
Dimension of the law:
Definition: generic_small_strain_viscoplasticity_3d.h:125
GenericSmallStrainViscoplasticity3D(ConstitutiveLaw::Pointer pPlasticityLaw, ConstitutiveLaw::Pointer pViscousLaw)
Definition: generic_small_strain_viscoplasticity_3d.h:75
void SetPlasticityConstitutiveLaw(ConstitutiveLaw::Pointer pPlasticityConstitutiveLaw)
Definition: generic_small_strain_viscoplasticity_3d.h:262
bool RequiresFinalizeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: generic_small_strain_viscoplasticity_3d.h:209
void SetViscousConstitutiveLaw(ConstitutiveLaw::Pointer pViscousConstitutiveLaw)
Definition: generic_small_strain_viscoplasticity_3d.h:272
~GenericSmallStrainViscoplasticity3D() override
Definition: generic_small_strain_viscoplasticity_3d.h:103
SizeType GetStrainSize() const override
Voigt tensor size:
Definition: generic_small_strain_viscoplasticity_3d.h:133
Geometry base class.
Definition: geometry.h:71
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
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
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_law.h:189