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.
d_plus_d_minus_damage_masonry_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: Philip Kalkbrenner
12 // Alejandro Cornejo
13 //
14 //
15 #pragma once
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
22 #include "custom_constitutive/elastic_isotropic_3d.h"
23 
24 namespace Kratos
25 {
28 
32 
33  // The size type definition
34  typedef std::size_t SizeType;
35 
36 
40 
44 
48 
52  class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) DamageDPlusDMinusMasonry3DLaw
53  : public ElasticIsotropic3D
54 {
55 public:
58 
59 
61  static constexpr SizeType Dimension = 3;
62 
64  static constexpr SizeType VoigtSize = 6;
65 
68 
69  // Adding the respective using to avoid overload conflicts
70  //using BaseType::Has;
71  //using BaseType::GetValue;
72 
75 
77  typedef Node NodeType;
78 
81 
83  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
84 
86  double DamageTension = 0.0;
87  double DamageCompression = 0.0;
88  double ThresholdTension = 0.0;
89  double ThresholdCompression = 0.0;
92  double UniaxialTensionStress = 0.0;
93  double UniaxialCompressionStress = 0.0;
94  };
98 
103 
104 
108  ConstitutiveLaw::Pointer Clone() const override
109  {
110  return Kratos::make_shared<DamageDPlusDMinusMasonry3DLaw>(*this);
111  }
116  {
117  return Dimension;
118  };
119 
123  SizeType GetStrainSize() const override
124  {
125  return VoigtSize;
126  };
127 
132  : BaseType(rOther),
133  mTensionDamage(rOther.mTensionDamage),
134  mTensionThreshold(rOther.mTensionThreshold),
135  mNonConvTensionDamage(rOther.mNonConvTensionDamage),
136  mNonConvTensionThreshold(rOther.mNonConvTensionThreshold),
137  mCompressionDamage(rOther.mCompressionDamage),
138  mCompressionThreshold(rOther.mCompressionThreshold),
139  mNonConvCompressionDamage(rOther.mNonConvCompressionDamage),
140  mNonConvCompressionThreshold(rOther.mNonConvCompressionThreshold)
141  {
142  }
143 
148  {
149  }
150 
155  void CalculateMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;
156 
161  void CalculateMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;
162 
167  void CalculateMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;
168 
173  void CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;
174 
179  bool IntegrateStressTensionIfNecessary(
180  const double F_tension,
181  DamageParameters& Parameters,
182  array_1d<double, VoigtSize>& IntegratedStressVectorTension,
183  const array_1d<double, VoigtSize> rIntegratedStressVector,
185  );
186 
191  bool IntegrateStressCompressionIfNecessary(
192  const double F_compression,
193  DamageParameters& Parameters,
194  array_1d<double, VoigtSize>& IntegratedStressVectorCompression,
195  array_1d<double, VoigtSize> rIntegratedStressVector,
197  );
198 
202  void CalculateIntegratedStressVector(
203  Vector& IntegratedStressVectorTension,
204  const DamageParameters& Parameters,
206  );
207 
215  void InitializeMaterial(
216  const Properties& rMaterialProperties,
217  const GeometryType& rElementGeometry,
218  const Vector& rShapeFunctionsValues
219  ) override;
220 
229  void FinalizeSolutionStep(
230  const Properties &rMaterialProperties,
231  const GeometryType &rElementGeometry,
232  const Vector& rShapeFunctionsValues,
233  const ProcessInfo& rCurrentProcessInfo
234  ) override;
235 
240  void FinalizeMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;
241 
246  void FinalizeMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;
247 
252  void FinalizeMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;
257  void FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;
258 
264  bool Has(const Variable<double> &rThisVariable) override;
265 
271  bool Has(const Variable<Vector> &rThisVariable) override;
272 
278  bool Has(const Variable<Matrix> &rThisVariable) override;
279 
286  void SetValue(
287  const Variable<double> &rThisVariable,
288  const double& rValue,
289  const ProcessInfo& rCurrentProcessInfo
290  ) override;
291 
298  void SetValue(
299  const Variable<Vector> &rThisVariable,
300  const Vector& rValue,
301  const ProcessInfo& rCurrentProcessInfo
302  ) override;
303 
310  double& GetValue(
311  const Variable<double> &rThisVariable,
312  double& rValue
313  ) override;
314 
321  Vector& GetValue(
322  const Variable<Vector> &rThisVariable,
323  Vector& rValue
324  ) override;
325 
332  Matrix& GetValue(
333  const Variable<Matrix>& rThisVariable,
334  Matrix& rValue
335  ) override;
336 
344  double& CalculateValue(
345  ConstitutiveLaw::Parameters& rParameterValues,
346  const Variable<double>& rThisVariable,
347  double& rValue) override;
348 
356  Vector& CalculateValue(
357  ConstitutiveLaw::Parameters& rParameterValues,
358  const Variable<Vector>& rThisVariable,
359  Vector& rValue
360  ) override;
361 
369  Matrix& CalculateValue(
370  ConstitutiveLaw::Parameters& rParameterValues,
371  const Variable<Matrix>& rThisVariable,
372  Matrix& rValue
373  ) override;
374 
384  int Check(
385  const Properties& rMaterialProperties,
386  const GeometryType& rElementGeometry,
387  const ProcessInfo& rCurrentProcessInfo
388  ) const override;
389 
393 
397 
401 
405 
407 
408 protected:
411 
415 
419 
423  // Tension values
424  double& GetTensionThreshold() { return mTensionThreshold; }
425  double& GetTensionDamage() { return mTensionDamage; }
426  double& GetNonConvTensionThreshold() { return mNonConvTensionThreshold; }
427  double& GetNonConvTensionDamage() { return mNonConvTensionDamage; }
428 
429  void SetTensionThreshold(const double toThreshold) { mTensionThreshold = toThreshold; }
430  void SetTensionDamage(const double toDamage) { mTensionDamage = toDamage; }
431  void SetNonConvTensionThreshold(const double toThreshold) { mNonConvTensionThreshold = toThreshold; }
432  void SetNonConvTensionDamage(const double toDamage) { mNonConvTensionDamage = toDamage; }
433 
434  // Compression values
435  double& GetCompressionThreshold() { return mCompressionThreshold; }
436  double& GetCompressionDamage() { return mCompressionDamage; }
437  double& GetNonConvCompressionThreshold() { return mNonConvCompressionThreshold; }
438  double& GetNonConvCompressionDamage() { return mNonConvCompressionDamage; }
439 
440  void SetCompressionThreshold(const double toThreshold) { mCompressionThreshold = toThreshold; }
441  void SetCompressionDamage(const double toDamage) { mCompressionDamage = toDamage; }
442  void SetNonConvCompressionThreshold(const double toThreshold) { mNonConvCompressionThreshold = toThreshold; }
443  void SetNonConvCompressionDamage(const double toDamage) { mNonConvCompressionDamage = toDamage; }
444 
445  void SetTensionStress(const double toS){mTensionUniaxialStress = toS;}
446  void SetCompressionStress(const double toS){mCompressionUniaxialStress = toS;}
447 
451 
455 
459 
461 
462 private:
465 
469 
470  // Converged values
471  double mTensionDamage = 0.0;
472  double mTensionThreshold = 0.0;
473 
474  // Non Converged values
475  double mNonConvTensionDamage = 0.0;
476  double mNonConvTensionThreshold = 0.0;
477 
478  double mCompressionDamage = 0.0;
479  double mCompressionThreshold = 0.0;
480  // double mUniaxialStress = 0.0;
481 
482  // Non Converged values
483  double mNonConvCompressionDamage = 0.0;
484  double mNonConvCompressionThreshold = 0.0;
485 
486  double mTensionUniaxialStress = 0.0;
487  double mCompressionUniaxialStress = 0.0;
491 
495 
500  void CalculateTangentTensor(ConstitutiveLaw::Parameters &rValues);
501 
506  void CalculateSecantTensor(ConstitutiveLaw::Parameters& rValues, Matrix& rSecantTensor);
507 
508 
509  // Serialization
510 
511  friend class Serializer;
512 
513  void save(Serializer &rSerializer) const override
514  {
516  rSerializer.save("TensionDamage", mTensionDamage);
517  rSerializer.save("TensionThreshold", mTensionThreshold);
518  rSerializer.save("NonConvTensionDamage", mNonConvTensionDamage);
519  rSerializer.save("NonConvTensionThreshold", mNonConvTensionThreshold);
520  rSerializer.save("CompressionDamage", mCompressionDamage);
521  rSerializer.save("CompressionThreshold", mCompressionThreshold);
522  rSerializer.save("NonConvCompressionnDamage", mNonConvCompressionDamage);
523  rSerializer.save("NonConvCompressionThreshold", mNonConvCompressionThreshold);
524  }
525 
526  void load(Serializer &rSerializer) override
527  {
529  rSerializer.load("TensionDamage", mTensionDamage);
530  rSerializer.load("TensionThreshold", mTensionThreshold);
531  rSerializer.load("NonConvTensionDamage", mNonConvTensionDamage);
532  rSerializer.load("NonConvTensionThreshold", mNonConvTensionThreshold);
533  rSerializer.load("CompressionDamage", mCompressionDamage);
534  rSerializer.load("CompressionThreshold", mCompressionThreshold);
535  rSerializer.load("NonConvCompressionnDamage", mNonConvCompressionDamage);
536  rSerializer.load("NonConvCompressionThreshold", mNonConvCompressionThreshold);
537  }
538 
545  void CalculateEquivalentStressTension(
546  array_1d<double, VoigtSize>& rPredictiveStressVector,
547  double& rEquivalentStress,
548  ConstitutiveLaw::Parameters& rValues);
549 
556  void CalculateEquivalentStressCompression(
557  array_1d<double, VoigtSize>& rPredictiveStressVector,
558  double& rEquivalentStress,
559  ConstitutiveLaw::Parameters& rValues);
560 
570  void IntegrateStressVectorTension(
571  array_1d<double,VoigtSize>& rPredictiveStressVector,
572  const double UniaxialStress,
573  double& rDamage,
574  double& rThreshold,
575  ConstitutiveLaw::Parameters& rValues,
576  const double CharacteristicLength);
577 
584  void CalculateDamageParameterTension(
585  ConstitutiveLaw::Parameters& rValues,
586  double& rAParameter,
587  const double CharacteristicLength);
588 
599  void CalculateExponentialDamageTension(
600  const double UniaxialStress,
601  const double Threshold,
602  const double DamageParameter,
603  const double CharacteristicLength,
604  ConstitutiveLaw::Parameters& rValues,
605  double& rDamage);
606 
616  void IntegrateStressVectorCompression(
617  array_1d<double,VoigtSize>& rPredictiveStressVector,
618  const double UniaxialStress,
619  double& rDamage,
620  double& rThreshold,
621  ConstitutiveLaw::Parameters& rValues,
622  const double CharacteristicLength);
623 
671  void CalculateBezier3DamageCompression(
672  const double UniaxialStress,
673  double& rDamage,
674  double& rThreshold,
675  const double CharacteristicLength,
676  ConstitutiveLaw::Parameters& rValues);
677 
685  void RegulateBezierDeterminators(
686  const double specific_dissipated_fracture_energy,
687  const double sp, const double sk, const double sr, const double ep,
688  double& ej, double& ek, double& er, double& eu);
689 
695  void ComputeBezierEnergy(
696  double& BezierG,
697  const double x1, const double x2, const double x3,
698  const double y1, const double y2, const double y3);
699 
706  double EvaluateBezierCurve(
707  const double Xi,
708  const double x1, double x2, const double x3,
709  const double y1, const double y2, const double y3);
710 
711 
715 
719 
723 
724 
725 
727 
728 }; // Class DamageDPlusDMinusMasonry3DLaw
729 }// namespace Kratos
730 
Definition: constitutive_law.h:47
Definition: d_plus_d_minus_damage_masonry_3d.h:54
DamageDPlusDMinusMasonry3DLaw(const DamageDPlusDMinusMasonry3DLaw &rOther)
Definition: d_plus_d_minus_damage_masonry_3d.h:131
void SetCompressionThreshold(const double toThreshold)
Definition: d_plus_d_minus_damage_masonry_3d.h:440
double & GetNonConvTensionDamage()
Definition: d_plus_d_minus_damage_masonry_3d.h:427
void SetNonConvTensionDamage(const double toDamage)
Definition: d_plus_d_minus_damage_masonry_3d.h:432
void SetCompressionStress(const double toS)
Definition: d_plus_d_minus_damage_masonry_3d.h:446
double & GetTensionDamage()
Definition: d_plus_d_minus_damage_masonry_3d.h:425
void SetTensionDamage(const double toDamage)
Definition: d_plus_d_minus_damage_masonry_3d.h:430
double & GetNonConvCompressionThreshold()
Definition: d_plus_d_minus_damage_masonry_3d.h:437
double & GetNonConvCompressionDamage()
Definition: d_plus_d_minus_damage_masonry_3d.h:438
double & GetCompressionDamage()
Definition: d_plus_d_minus_damage_masonry_3d.h:436
void SetTensionThreshold(const double toThreshold)
Definition: d_plus_d_minus_damage_masonry_3d.h:429
void SetNonConvCompressionThreshold(const double toThreshold)
Definition: d_plus_d_minus_damage_masonry_3d.h:442
double & GetTensionThreshold()
Definition: d_plus_d_minus_damage_masonry_3d.h:424
void SetNonConvCompressionDamage(const double toDamage)
Definition: d_plus_d_minus_damage_masonry_3d.h:443
void SetCompressionDamage(const double toDamage)
Definition: d_plus_d_minus_damage_masonry_3d.h:441
void SetTensionStress(const double toS)
Definition: d_plus_d_minus_damage_masonry_3d.h:445
double & GetNonConvTensionThreshold()
Definition: d_plus_d_minus_damage_masonry_3d.h:426
SizeType GetStrainSize() const override
Voigt tensor size:
Definition: d_plus_d_minus_damage_masonry_3d.h:123
ElasticIsotropic3D BaseType
Definition of the base class.
Definition: d_plus_d_minus_damage_masonry_3d.h:67
Node NodeType
The node definition.
Definition: d_plus_d_minus_damage_masonry_3d.h:77
KRATOS_CLASS_POINTER_DEFINITION(DamageDPlusDMinusMasonry3DLaw)
Counted pointer of GenericYieldSurface.
void SetNonConvTensionThreshold(const double toThreshold)
Definition: d_plus_d_minus_damage_masonry_3d.h:431
double & GetCompressionThreshold()
Definition: d_plus_d_minus_damage_masonry_3d.h:435
Geometry< NodeType > GeometryType
The geometry definition.
Definition: d_plus_d_minus_damage_masonry_3d.h:80
SizeType WorkingSpaceDimension() override
Dimension of the law:
Definition: d_plus_d_minus_damage_masonry_3d.h:115
ConstitutiveLaw::Pointer Clone() const override
Definition: d_plus_d_minus_damage_masonry_3d.h:108
~DamageDPlusDMinusMasonry3DLaw() override
Definition: d_plus_d_minus_damage_masonry_3d.h:147
Definition: elastic_isotropic_3d.h:53
Geometry base class.
Definition: geometry.h:71
This class defines the node.
Definition: node.h:65
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
#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
x2
Definition: generate_frictional_mortar_condition.py:122
x1
Definition: generate_frictional_mortar_condition.py:121
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_law.h:189
Definition: d_plus_d_minus_damage_masonry_3d.h:85
array_1d< double, VoigtSize > TensionStressVector
Definition: d_plus_d_minus_damage_masonry_3d.h:90
array_1d< double, VoigtSize > CompressionStressVector
Definition: d_plus_d_minus_damage_masonry_3d.h:91