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.
membrane_element.hpp
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Klaus B. Sautter
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/element.h"
20 
21 namespace Kratos
22 {
23 
24  class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) MembraneElement
25  : public Element
26  {
27  public:
28 
29  // Counted pointer of MembraneElement
31 
32  // Constructor using an array of nodes
33  MembraneElement(IndexType NewId, GeometryType::Pointer pGeometry);
34 
35  // Constructor using an array of nodes with properties
36  MembraneElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
37 
38  // Destructor
39  ~MembraneElement() = default;
40 
41 
42 
43  enum class VoigtType {
44  Strain,
45  Stress
46  };
47 
48  enum class ConfigurationType {
49  Current,
50  Reference
51  };
52 
53  // Name Operations
54 
62  Element::Pointer Create(
63  IndexType NewId,
64  GeometryType::Pointer pGeom,
65  PropertiesType::Pointer pProperties
66  ) const override;
67 
75  Element::Pointer Create(
76  IndexType NewId,
77  NodesArrayType const& ThisNodes,
78  PropertiesType::Pointer pProperties
79  ) const override;
80 
81  void EquationIdVector(
82  EquationIdVectorType& rResult,
83  const ProcessInfo& rCurrentProcessInfo) const override;
84 
85  void GetDofList(
86  DofsVectorType& ElementalDofList,
87  const ProcessInfo& rCurrentProcessInfo) const override;
88 
89  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
90 
91  void CalculateLeftHandSide(
92  MatrixType& rLeftHandSideMatrix,
93  const ProcessInfo& rCurrentProcessInfo) override;
94 
95  void CalculateRightHandSide(
96  VectorType& rRightHandSideVector,
97  const ProcessInfo& rCurrentProcessInfo) override;
98 
99  void CalculateLocalSystem(
100  MatrixType& rLeftHandSideMatrix,
101  VectorType& rRightHandSideVector,
102  const ProcessInfo& rCurrentProcessInfo) override;
103 
104 
105  void GetValuesVector(
106  Vector& rValues,
107  int Step = 0) const override;
108 
109  void GetFirstDerivativesVector(
110  Vector& rValues,
111  int Step = 0) const override;
112 
113  void GetSecondDerivativesVector(
114  Vector& rValues,
115  int Step = 0) const override;
116 
117  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
118 
120  const Variable<array_1d<double, 3>>& rVariable,
121  std::vector<array_1d<double, 3>>& rOutput,
122  const ProcessInfo& rCurrentProcessInfo) override;
123 
124 
125  void CalculateMassMatrix(MatrixType& rMassMatrix,
126  const ProcessInfo& rCurrentProcessInfo) override;
127 
128  void CalculateConsistentMassMatrix(MatrixType& rMassMatrix,
129  const ProcessInfo& rCurrentProcessInfo) const;
130 
131  void CalculateLumpedMassVector(
132  VectorType& rMassVector,
133  const ProcessInfo& rCurrentProcessInfo) const override;
134 
135  void AddExplicitContribution(
136  const VectorType& rRHSVector, const Variable<VectorType>& rRHSVariable,
137  const Variable<array_1d<double, 3>>& rDestinationVariable,
138  const ProcessInfo& rCurrentProcessInfo) override;
139 
140  void AddExplicitContribution(
141  const VectorType& rRHSVector,
142  const Variable<VectorType>& rRHSVariable,
143  const Variable<double >& rDestinationVariable,
144  const ProcessInfo& rCurrentProcessInfo) override;
145 
146  void Calculate(const Variable<Matrix>& rVariable,
147  Matrix& rOutput, const ProcessInfo& rCurrentProcessInfo) override;
148 
149  void Calculate(const Variable<double>& rVariable,
150  double& rOutput, const ProcessInfo& rCurrentProcessInfo) override;
151 
152 
153  void CalculateDampingMatrix(MatrixType& rDampingMatrix,
154  const ProcessInfo& rCurrentProcessInfo) override;
155 
156  const Parameters GetSpecifications() const override;
157 
158  private:
165  void CovariantBaseVectors(array_1d<Vector,2>& rBaseVectors,
166  const Matrix& rShapeFunctionGradientValues, const ConfigurationType& rConfiguration) const;
167 
173  void CovariantMetric(Matrix& rMetric,const array_1d<Vector,2>& rBaseVectorCovariant);
174 
181  void ContraVariantBaseVectors(array_1d<Vector,2>& rBaseVectors,const Matrix& rContraVariantMetric,
182  const array_1d<Vector,2> rCovariantBaseVectors);
183 
189  void ContravariantMetric(Matrix& rMetric,const Matrix& rCovariantMetric);
190 
191 
198  void DeriveCurrentCovariantBaseVectors(array_1d<Vector,2>& rBaseVectors,
199  const Matrix& rShapeFunctionGradientValues, const SizeType DofR);
200 
201 
209  void Derivative2CurrentCovariantMetric(Matrix& rMetric,
210  const Matrix& rShapeFunctionGradientValues, const SizeType DofR, const SizeType DofS);
211 
212 
218  void JacobiDeterminante(double& rDetJacobi, const array_1d<Vector,2>& rReferenceBaseVectors) const;
219 
220 
229  void Derivative2StrainGreenLagrange(Vector& rStrain,
230  const Matrix& rShapeFunctionGradientValues, const SizeType DofR, const SizeType DofS,
231  const Matrix& rTransformationMatrix);
232 
233 
234 
243  void DerivativeStrainGreenLagrange(Vector& rStrain, const Matrix& rShapeFunctionGradientValues, const SizeType DofR,
244  const array_1d<Vector,2> rCurrentCovariantBaseVectors, const Matrix& rTransformationMatrix);
245 
246 
254  void StrainGreenLagrange(Vector& rStrain, const Matrix& rReferenceCoVariantMetric,const Matrix& rCurrentCoVariantMetric,
255  const Matrix& rTransformationMatrix);
256 
267  void MaterialResponse(Vector& rStress,
268  const Matrix& rReferenceContraVariantMetric,const Matrix& rReferenceCoVariantMetric,const Matrix& rCurrentCoVariantMetric,
269  const array_1d<Vector,2>& rTransformedBaseVectors, const Matrix& rTransformationMatrix, const SizeType& rIntegrationPointNumber,
270  Matrix& rTangentModulus,const ProcessInfo& rCurrentProcessInfo);
271 
272 
278  void AddPreStressPk2(Vector& rStress, const array_1d<Vector,2>& rTransformedBaseVectors);
279 
287  void DerivativeCurrentCovariantMetric(Matrix& rMetric,
288  const Matrix& rShapeFunctionGradientValues, const SizeType DofR, const array_1d<Vector,2> rCurrentCovariantBaseVectors);
289 
290 
296  void InternalForces(Vector& rInternalForces,const IntegrationMethod& ThisMethod,const ProcessInfo& rCurrentProcessInfo);
297 
298 
304  void TotalStiffnessMatrix(Matrix& rStiffnessMatrix,const IntegrationMethod& ThisMethod,const ProcessInfo& rCurrentProcessInfo);
305 
306 
316  void InitialStressStiffnessMatrixEntryIJ(double& rEntryIJ,
317  const Vector& rStressVector,
318  const SizeType& rPositionI, const SizeType& rPositionJ, const Matrix& rShapeFunctionGradientValues,
319  const Matrix& rTransformationMatrix);
320 
321 
322 
333  void MaterialStiffnessMatrixEntryIJ(double& rEntryIJ,
334  const Matrix& rMaterialTangentModulus,
335  const SizeType& rPositionI, const SizeType& rPositionJ, const Matrix& rShapeFunctionGradientValues,
336  const array_1d<Vector,2>& rCurrentCovariantBaseVectors,const Matrix& rTransformationMatrix);
337 
338 
339 
346  void TransformStrains(Vector& rStrains, Vector& rReferenceStrains, const Matrix& rTransformationMatrix);
347 
348 
354  void TransformBaseVectors(array_1d<Vector,2>& rBaseVectors,
355  const array_1d<Vector,2>& rLocalBaseVectors);
356 
357 
364  template <class T>
365  void InPlaneTransformationMatrix(Matrix& rTransformationMatrix, const array_1d<Vector,2>& rTransformedBaseVectors,
366  const T& rLocalReferenceBaseVectors);
367 
368 
374  void PrincipalVector(Vector& rPrincipalVector, const Vector& rNonPrincipalVector);
375 
376 
377  void CalculateOnIntegrationPoints(const Variable<Vector >& rVariable,
378  std::vector< Vector >& rOutput, const ProcessInfo& rCurrentProcessInfo) override;
379 
380  void DeformationGradient(Matrix& rDeformationGradient, double& rDetDeformationGradient,
381  const array_1d<Vector,2>& rCurrentCovariantBase, const array_1d<Vector,2>& rReferenceContraVariantBase);
382 
383 
384  void CalculateAndAddBodyForce(VectorType& rRightHandSideVector,const ProcessInfo& rCurrentProcessInfo) const;
385 
386  void ReferenceLumpingFactors(Vector& rResult) const;
387 
388  std::vector<ConstitutiveLaw::Pointer> mConstitutiveLawVector;
389  double CalculateReferenceArea() const;
390 
394 
395  friend class Serializer;
396 
397  // A private default constructor necessary for serialization
398  MembraneElement() = default;
399 
400  void save(Serializer& rSerializer) const override;
401 
402  void load(Serializer& rSerializer) override;
403 
405 
406  }; // class MembraneElement.
407 
408 } // namespace Kratos.
Base class for all Elements.
Definition: element.h:60
std::size_t IndexType
Definition: flags.h:74
IntegrationMethod
Definition: geometry_data.h:76
Definition: membrane_element.hpp:26
VoigtType
Definition: membrane_element.hpp:43
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(MembraneElement)
ConfigurationType
Definition: membrane_element.hpp:48
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
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
TDataType Calculate(GeometryType &dummy, const Variable< TDataType > &rVariable)
Definition: add_geometries_to_python.cpp:103
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
@ Current
Definition: structural_mechanics_math_utilities.hpp:30
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
list Strain
Definition: isotropic_damage_automatic_differentiation.py:193
Stress
Definition: isotropic_damage_automatic_differentiation.py:135
def load(f)
Definition: ode_solve.py:307