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.
viscous_generalized_kelvin.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 // Project includes
21 #include "custom_constitutive/elastic_isotropic_3d.h"
22 
23 namespace Kratos
24 {
27 
31 
35 
39 
43 
60 template<class TElasticBehaviourLaw>
61 class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) ViscousGeneralizedKelvin
62  : public TElasticBehaviourLaw
63 {
64 public:
67 
70 
72  typedef TElasticBehaviourLaw BaseType;
73 
75  typedef std::size_t IndexType;
76 
78  typedef std::size_t SizeType;
79 
81  static constexpr SizeType Dimension = TElasticBehaviourLaw::Dimension;
82 
84  static constexpr SizeType VoigtSize = TElasticBehaviourLaw::VoigtSize;
85 
88 
90  typedef Node NodeType;
91 
94 
96  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
97 
101 
106 
110  ConstitutiveLaw::Pointer Clone() const override;
111 
116 
120  ~ViscousGeneralizedKelvin() override;
121 
125 
129 
134  void CalculateMaterialResponsePK1(ConstitutiveLaw::Parameters& rValues) override;
135 
140  void CalculateMaterialResponsePK2(ConstitutiveLaw::Parameters& rValues) override;
141 
146  void CalculateMaterialResponseKirchhoff(ConstitutiveLaw::Parameters& rValues) override;
147 
152  void CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues) override;
153 
161  void FinalizeSolutionStep(
162  const Properties& rMaterialProperties,
163  const GeometryType& rElementGeometry,
164  const Vector& rShapeFunctionsValues,
165  const ProcessInfo& rCurrentProcessInfo
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;
185 
190  void FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues) override;
191 
199  Vector& CalculateValue(
200  ConstitutiveLaw::Parameters& rParameterValues,
201  const Variable<Vector>& rThisVariable,
202  Vector& rValue
203  ) override;
204 
212  Matrix& CalculateValue(
213  ConstitutiveLaw::Parameters& rParameterValues,
214  const Variable<Matrix>& rThisVariable,
215  Matrix& rValue
216  ) override;
217 
227  int Check(
228  const Properties& rMaterialProperties,
229  const GeometryType& rElementGeometry,
230  const ProcessInfo& rCurrentProcessInfo
231  ) const override;
232 
237  {
238  return false;
239  }
240 
245  {
246  return true;
247  }
248 
252 
256 
260 
264 
266 
267 protected:
270 
274 
278 
282 
286 
290 
294 
296 private:
299 
303 
304  // Converged values
305  Vector mPrevStressVector = ZeroVector(VoigtSize);
306  Vector mPrevInelasticStrainVector = ZeroVector(VoigtSize);
307 
311 
315 
316  Vector& GetPreviousStressVector() { return mPrevStressVector; }
317  void SetPreviousStressVector(const Vector& PrevStressVector) { mPrevStressVector = PrevStressVector; }
318 
319  Vector& GetPreviousInelasticStrainVector() { return mPrevInelasticStrainVector; }
320  void SetPreviousInelasticStrainVector(const Vector& PrevInelasticStrainVector) { mPrevInelasticStrainVector = PrevInelasticStrainVector; }
321 
325  void ComputeViscoElasticity(ConstitutiveLaw::Parameters& rValues);
326 
330 
334 
338 
339  // Serialization
340 
341  friend class Serializer;
342 
343  void save(Serializer& rSerializer) const override
344  {
346  rSerializer.save("PrevStressVector", mPrevStressVector);
347  rSerializer.save("PrevInelasticStrainVector", mPrevInelasticStrainVector);
348  }
349 
350  void load(Serializer& rSerializer) override
351  {
353  rSerializer.load("PrevStressVector", mPrevStressVector);
354  rSerializer.load("PrevInelasticStrainVector", mPrevInelasticStrainVector);
355  }
356 
358 
359 }; // Class GenericYieldSurface
360 
361 } // namespace Kratos
Definition: constitutive_law.h:47
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
This is a constitutive law that reproduces the behaviour of viscous Kelvin material.
Definition: viscous_generalized_kelvin.h:63
bool RequiresFinalizeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: viscous_generalized_kelvin.h:244
Geometry< NodeType > GeometryType
The geometry definition.
Definition: viscous_generalized_kelvin.h:93
Node NodeType
The node definition.
Definition: viscous_generalized_kelvin.h:90
bool RequiresInitializeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: viscous_generalized_kelvin.h:236
TElasticBehaviourLaw BaseType
Definition of the base class.
Definition: viscous_generalized_kelvin.h:72
KRATOS_CLASS_POINTER_DEFINITION(ViscousGeneralizedKelvin)
Counted pointer of GenericYieldSurface.
std::size_t IndexType
The index definition.
Definition: viscous_generalized_kelvin.h:75
ConstitutiveLaw CLBaseType
Definition of the base CL class.
Definition: viscous_generalized_kelvin.h:69
std::size_t SizeType
The size definition.
Definition: viscous_generalized_kelvin.h:78
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_law.h:189