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_isotropic_damage.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
22 #include "custom_constitutive/linear_plane_strain.h"
23 
24 namespace Kratos
25 {
28 
32 
33  // The size type definition
34  typedef std::size_t SizeType;
35 
39 
43 
47 
55 template <class TConstLawIntegratorType>
56 class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericSmallStrainIsotropicDamage
57  : public std::conditional<TConstLawIntegratorType::VoigtSize == 6, ElasticIsotropic3D, LinearPlaneStrain >::type
58 {
59 public:
62 
64  static constexpr SizeType Dimension = TConstLawIntegratorType::Dimension;
65 
67  static constexpr SizeType VoigtSize = TConstLawIntegratorType::VoigtSize;
68 
71 
73 
76 
78  typedef Node NodeType;
79 
82 
84  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
85  static constexpr double threshold_tolerance = 1.0e-5;
86 
90 
95  {
96  }
97 
101  ConstitutiveLaw::Pointer Clone() const override
102  {
103  return Kratos::make_shared<GenericSmallStrainIsotropicDamage<TConstLawIntegratorType>>(*this);
104  }
105 
110  : BaseType(rOther),
111  mDamage(rOther.mDamage),
112  mThreshold(rOther.mThreshold)
113  {
114  }
115 
120  {
121  }
122 
126 
130 
135  void CalculateMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;
136 
141  void CalculateMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;
142 
147  void CalculateMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;
148 
153  void CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;
154 
162  void InitializeMaterial(
163  const Properties& rMaterialProperties,
164  const GeometryType& rElementGeometry,
165  const Vector& rShapeFunctionsValues
166  ) override;
167 
172  void FinalizeMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;
173 
178  void FinalizeMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;
179 
184  void FinalizeMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;
189  void FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;
190 
196  bool Has(const Variable<double> &rThisVariable) override;
197 
203  bool Has(const Variable<Vector> &rThisVariable) override;
204 
210  bool Has(const Variable<Matrix> &rThisVariable) override;
211 
218  void SetValue(
219  const Variable<double> &rThisVariable,
220  const double& rValue,
221  const ProcessInfo& rCurrentProcessInfo
222  ) override;
223 
230  void SetValue(
231  const Variable<Vector> &rThisVariable,
232  const Vector& rValue,
233  const ProcessInfo& rCurrentProcessInfo
234  ) override;
235 
242  double& GetValue(
243  const Variable<double> &rThisVariable,
244  double& rValue
245  ) override;
246 
253  Vector& GetValue(
254  const Variable<Vector> &rThisVariable,
255  Vector& rValue
256  ) override;
257 
262  {
263  return true;
264  }
265 
270  {
271  return false;
272  }
273 
281  double& CalculateValue(
282  ConstitutiveLaw::Parameters& rParameterValues,
283  const Variable<double>& rThisVariable,
284  double& rValue) override;
285 
293  Vector& CalculateValue(
294  ConstitutiveLaw::Parameters& rParameterValues,
295  const Variable<Vector>& rThisVariable,
296  Vector& rValue
297  ) override;
298 
306  Matrix& CalculateValue(
307  ConstitutiveLaw::Parameters& rParameterValues,
308  const Variable<Matrix>& rThisVariable,
309  Matrix& rValue
310  ) override;
311 
321  int Check(
322  const Properties& rMaterialProperties,
323  const GeometryType& rElementGeometry,
324  const ProcessInfo& rCurrentProcessInfo
325  ) const override;
326 
327 
332  void CalculateTangentTensor(ConstitutiveLaw::Parameters &rValues);
333 
337 
341 
345 
349 
351 
352 protected:
355 
359 
363 
367 
368  double& GetThreshold() { return mThreshold; }
369  double& GetDamage() { return mDamage; }
370 
371  void SetThreshold(const double toThreshold) { mThreshold = toThreshold; }
372  void SetDamage(const double toDamage) { mDamage = toDamage; }
373 
377 
381 
385 
387 private:
390 
394 
395  // Converged values
396  double mDamage = 0.0;
397  double mThreshold = 0.0;
398 
402 
406 
410 
414 
418 
419  // Serialization
420 
421  friend class Serializer;
422 
423  void save(Serializer &rSerializer) const override
424  {
426  rSerializer.save("Damage", mDamage);
427  rSerializer.save("Threshold", mThreshold);
428  }
429 
430  void load(Serializer &rSerializer) override
431  {
433  rSerializer.load("Damage", mDamage);
434  rSerializer.load("Threshold", mThreshold);
435  }
436 
438 
439 }; // Class GenericYieldSurface
440 
441 } // namespace Kratos
Definition: constitutive_law.h:47
This class is the base class which define all the constitutive laws for damage in small deformation.
Definition: generic_small_strain_isotropic_damage.h:58
Node NodeType
The node definition.
Definition: generic_small_strain_isotropic_damage.h:78
double & GetDamage()
Definition: generic_small_strain_isotropic_damage.h:369
bool RequiresInitializeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: generic_small_strain_isotropic_damage.h:269
std::conditional< VoigtSize==6, ElasticIsotropic3D, LinearPlaneStrain >::type BaseType
Definition of the base class.
Definition: generic_small_strain_isotropic_damage.h:70
void SetThreshold(const double toThreshold)
Definition: generic_small_strain_isotropic_damage.h:371
double & GetThreshold()
Definition: generic_small_strain_isotropic_damage.h:368
array_1d< double, VoigtSize > BoundedArrayType
Definition: generic_small_strain_isotropic_damage.h:72
~GenericSmallStrainIsotropicDamage() override
Definition: generic_small_strain_isotropic_damage.h:119
void SetDamage(const double toDamage)
Definition: generic_small_strain_isotropic_damage.h:372
GenericSmallStrainIsotropicDamage(const GenericSmallStrainIsotropicDamage &rOther)
Definition: generic_small_strain_isotropic_damage.h:109
GenericSmallStrainIsotropicDamage()
Definition: generic_small_strain_isotropic_damage.h:94
KRATOS_CLASS_POINTER_DEFINITION(GenericSmallStrainIsotropicDamage)
Counted pointer of GenericYieldSurface.
bool RequiresFinalizeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: generic_small_strain_isotropic_damage.h:261
Geometry< NodeType > GeometryType
The geometry definition.
Definition: generic_small_strain_isotropic_damage.h:81
ConstitutiveLaw::Pointer Clone() const override
Definition: generic_small_strain_isotropic_damage.h:101
Geometry base class.
Definition: geometry.h:71
This class defines the node.
Definition: node.h:65
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
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
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
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
type
Definition: generate_gid_list_file.py:35
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_law.h:189