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_orthotropic_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
12 //
13 
14 #pragma once
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "custom_constitutive/linear_plane_strain.h"
22 
23 namespace Kratos
24 {
27 
31 
32 // The size type definition
33 typedef std::size_t SizeType;
34 
38 
42 
46 
56 template <class TConstLawIntegratorType>
57 class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericSmallStrainOrthotropicDamage
58  : public std::conditional<TConstLawIntegratorType::VoigtSize == 6, ElasticIsotropic3D, LinearPlaneStrain >::type
59 {
60 public:
63 
65  static constexpr SizeType Dimension = TConstLawIntegratorType::Dimension;
66 
68  static constexpr SizeType VoigtSize = TConstLawIntegratorType::VoigtSize;
69 
72 
75 
77  typedef Node NodeType;
78 
81 
83  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
84 
88 
93  {
94  }
95 
99  ConstitutiveLaw::Pointer Clone() const override
100  {
101  return Kratos::make_shared<GenericSmallStrainOrthotropicDamage<TConstLawIntegratorType>>(*this);
102  }
103 
108  : BaseType(rOther),
109  mDamages(rOther.mDamages),
110  mThresholds(rOther.mThresholds)
111  {
112  }
113 
118  {
119  }
120 
124 
128 
133  void CalculateMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;
134 
139  void CalculateMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;
140 
145  void CalculateMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;
146 
151  void CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;
152 
160  void InitializeMaterial(
161  const Properties& rMaterialProperties,
162  const GeometryType& rElementGeometry,
163  const Vector& rShapeFunctionsValues
164  ) override;
165 
170  void FinalizeMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;
171 
176  void FinalizeMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;
177 
182  void FinalizeMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;
187  void FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;
188 
194  bool Has(const Variable<double> &rThisVariable) override;
195 
201  bool Has(const Variable<Vector> &rThisVariable) override;
202 
208  bool Has(const Variable<Matrix> &rThisVariable) override;
209 
216  void SetValue(
217  const Variable<Vector> &rThisVariable,
218  const Vector& rValue,
219  const ProcessInfo& rCurrentProcessInfo
220  ) override;
221 
228  double& GetValue(
229  const Variable<double> &rThisVariable,
230  double& rValue
231  ) override;
232 
239  Vector& GetValue(
240  const Variable<Vector> &rThisVariable,
241  Vector& rValue
242  ) override;
243 
250  Matrix& GetValue(
251  const Variable<Matrix>& rThisVariable,
252  Matrix& rValue
253  ) override;
254 
259  {
260  return true;
261  }
262 
267  {
268  return false;
269  }
270 
278  double& CalculateValue(
279  ConstitutiveLaw::Parameters& rParameterValues,
280  const Variable<double>& rThisVariable,
281  double& rValue) override;
282 
290  Vector& CalculateValue(
291  ConstitutiveLaw::Parameters& rParameterValues,
292  const Variable<Vector>& rThisVariable,
293  Vector& rValue
294  ) override;
295 
303  Matrix& CalculateValue(
304  ConstitutiveLaw::Parameters& rParameterValues,
305  const Variable<Matrix>& rThisVariable,
306  Matrix& rValue
307  ) override;
308 
318  int Check(
319  const Properties& rMaterialProperties,
320  const GeometryType& rElementGeometry,
321  const ProcessInfo& rCurrentProcessInfo
322  ) const override;
323 
324 
329  void CalculateTangentTensor(ConstitutiveLaw::Parameters& rValues);
330 
337  void CalculateSecantTensor(Matrix& rSecantTensor, ConstitutiveLaw::Parameters& rValues, const Vector& rDamages);
338 
345  void CalculateRotationMatrix(Matrix& rRotationTensor, Matrix rEigenVectorsMatrix, const Matrix& rEigenValuesMatrix);
346 
350 
354 
358 
362 
364 
365 protected:
368 
372 
376 
380 
381  Vector& GetThresholds() { return mThresholds; }
382  Vector& GetDamages() { return mDamages; }
383 
384  void SetThresholds(const Vector& rToThresholds) { mThresholds = rToThresholds; }
385  void SetDamages(const Vector& rToDamages) { mDamages = rToDamages; }
386 
390 
394 
398 
400 private:
403 
407 
408  // The damage and threshold of each principal direction
409  Vector mDamages = ZeroVector(Dimension);
410  Vector mThresholds = ZeroVector(Dimension);
411 
415 
419 
423 
427 
431 
432  // Serialization
433 
434  friend class Serializer;
435 
436  void save(Serializer &rSerializer) const override
437  {
439  rSerializer.save("Damages", mDamages);
440  rSerializer.save("Thresholds", mThresholds);
441  }
442 
443  void load(Serializer &rSerializer) override
444  {
446  rSerializer.load("Damages", mDamages);
447  rSerializer.load("Thresholds", mThresholds);
448  }
449 
451 
452 }; // Class GenericYieldSurface
453 
454 } // namespace Kratos
Definition: constitutive_law.h:47
This class defines an small strain orthotropic damage model developed by Cervera et....
Definition: generic_small_strain_orthotropic_damage.h:59
Vector & GetDamages()
Definition: generic_small_strain_orthotropic_damage.h:382
~GenericSmallStrainOrthotropicDamage() override
Definition: generic_small_strain_orthotropic_damage.h:117
std::conditional< VoigtSize==6, ElasticIsotropic3D, LinearPlaneStrain >::type BaseType
Definition of the base class.
Definition: generic_small_strain_orthotropic_damage.h:71
bool RequiresFinalizeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: generic_small_strain_orthotropic_damage.h:258
bool RequiresInitializeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: generic_small_strain_orthotropic_damage.h:266
Geometry< NodeType > GeometryType
The geometry definition.
Definition: generic_small_strain_orthotropic_damage.h:80
Vector & GetThresholds()
Definition: generic_small_strain_orthotropic_damage.h:381
Node NodeType
The node definition.
Definition: generic_small_strain_orthotropic_damage.h:77
void SetThresholds(const Vector &rToThresholds)
Definition: generic_small_strain_orthotropic_damage.h:384
GenericSmallStrainOrthotropicDamage()
Definition: generic_small_strain_orthotropic_damage.h:92
GenericSmallStrainOrthotropicDamage(const GenericSmallStrainOrthotropicDamage &rOther)
Definition: generic_small_strain_orthotropic_damage.h:107
void SetDamages(const Vector &rToDamages)
Definition: generic_small_strain_orthotropic_damage.h:385
ConstitutiveLaw::Pointer Clone() const override
Definition: generic_small_strain_orthotropic_damage.h:99
KRATOS_CLASS_POINTER_DEFINITION(GenericSmallStrainOrthotropicDamage)
Counted pointer of GenericYieldSurface.
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
void CalculateRotationMatrix(const double Theta, MatrixType &rMatrix, const DenseVector< double > &rAxisOfRotationVector, const DenseVector< double > &rCenterOfRotation)
Calculate the transformation matrix which rotates the given vector around mAxisOfRotationVector and m...
Definition: geometrical_transformation_utilities.cpp:41
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
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
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