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.
base_shell_element.h
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: Philipp Bucher (https://github.com/philbucher)
10 // Based on the work of Massimo Petracca and Peter Wilson
11 //
12 
13 #pragma once
14 
15 
16 // System includes
17 
18 // External includes
19 
20 
21 // Project includes
22 #include "includes/element.h"
23 #include "utilities/quaternion.h"
24 #include "custom_utilities/shell_cross_section.hpp"
26 
27 
28 namespace Kratos
29 {
32 
36 
40 
41 enum class ShellKinematics
42 {
43  LINEAR,
45 };
46 
50 
51 template <class TCoordinateTransformation>
52 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) BaseShellElement
53  : public Element
54 {
55 public:
58 
59  typedef Element BaseType;
60 
65 
66  typedef std::vector< ShellCrossSection::Pointer > CrossSectionContainerType;
67 
69 
71 
72  using SizeType = std::size_t;
73 
75 
79 
84  GeometryType::Pointer pGeometry);
85 
90  GeometryType::Pointer pGeometry,
91  PropertiesType::Pointer pProperties);
92 
96  ~BaseShellElement() override = default;
97 
101 
102 
106 
113  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& CurrentProcessInfo) const override;
114 
120  void GetDofList(DofsVectorType& rElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override;
121 
122 
123  void GetValuesVector(Vector& rValues, int Step = 0) const override;
124 
125  void GetFirstDerivativesVector(Vector& rValues, int Step = 0) const override;
126 
127  void GetSecondDerivativesVector(Vector& rValues, int Step = 0) const override;
128 
129  void ResetConstitutiveLaw() override;
130 
131  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
132 
133  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
134 
135  void FinalizeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
136 
137  void InitializeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
138 
139  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
140 
141  void CalculateMassMatrix(MatrixType& rMassMatrix, const ProcessInfo& rCurrentProcessInfo) override;
142 
143  void CalculateDampingMatrix(MatrixType& rDampingMatrix, const ProcessInfo& rCurrentProcessInfo) override;
144 
145  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
146  VectorType& rRightHandSideVector,
147  const ProcessInfo& rCurrentProcessInfo) override;
148 
149  void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix,
150  const ProcessInfo& rCurrentProcessInfo) override;
151 
152  void CalculateRightHandSide(VectorType& rRightHandSideVector,
153  const ProcessInfo& rCurrentProcessInfo) override;
154 
156  std::vector<array_1d<double, 3> >& rOutput,
157  const ProcessInfo& rCurrentProcessInfo) override;
158 
160  std::vector<ConstitutiveLaw::Pointer>& rValues,
161  const ProcessInfo& rCurrentProcessInfo) override;
162 
163  // Calculate functions
164  void Calculate(const Variable<Matrix >& rVariable,
165  Matrix& Output,
166  const ProcessInfo& rCurrentProcessInfo) override;
167 
168 
178  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
179 
187  {
188  return mIntegrationMethod;
189  }
193 
194  void SetCrossSectionsOnIntegrationPoints(std::vector< ShellCrossSection::Pointer >& crossSections);
195 
196 
200 
201 
205 
206  const Parameters GetSpecifications() const override;
207 
209  virtual std::string Info() const override;
210 
212  virtual void PrintInfo(std::ostream& rOStream) const override;
213 
215  virtual void PrintData(std::ostream& rOStream) const override;
216 
220 
222 
223 protected:
224 
227 
231 
233 
234  CoordinateTransformationPointerType mpCoordinateTransformation = nullptr;
235 
241 
245 
249  {
250  }
251 
252  SizeType GetNumberOfDofs() const;
253 
254  SizeType GetNumberOfGPs() const;
255 
264  virtual void CalculateAll(
265  MatrixType& rLeftHandSideMatrix,
266  VectorType& rRightHandSideVector,
267  const ProcessInfo& rCurrentProcessInfo,
268  const bool CalculateStiffnessMatrixFlag,
269  const bool CalculateResidualVectorFlag
270  );
271 
272  void SetupOrientationAngles();
273 
274  void CheckDofs() const;
275  void CheckProperties(const ProcessInfo& rCurrentProcessInfo) const;
276  void CheckSpecificProperties() const;
277 
284  void ComputeLocalAxis(const Variable<array_1d<double, 3> >& rVariable,
285  std::vector<array_1d<double, 3> >& rOutput) const;
286 
293  void ComputeLocalMaterialAxis(const Variable<array_1d<double, 3> >& rVariable,
294  std::vector<array_1d<double, 3> >& rOutput) const;
295 
296  // check if this function is really necessary
297  void DecimalCorrection(Vector& a);
298 
303  virtual ShellCrossSection::SectionBehaviorType GetSectionBehavior() const;
304 
308 
312 
316 
318 
319 private:
320 
323 
324 
328 
329 
330 
334 
338 
342 
343  friend class Serializer;
344 
345  void save(Serializer& rSerializer) const override;
346  void load(Serializer& rSerializer) override;
347 
351 
355 
359 
361 
362 }; // Class BaseShellElement
363 
365 
368 
372 
374 
375 } // namespace Kratos.
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Definition: base_shell_element.h:54
BaseShellElement()
Definition: base_shell_element.h:248
Element BaseType
Definition: base_shell_element.h:59
CrossSectionContainerType mSections
Definition: base_shell_element.h:236
~BaseShellElement() override=default
Quaternion< double > QuaternionType
Definition: base_shell_element.h:68
Kratos::unique_ptr< TCoordinateTransformation > CoordinateTransformationPointerType
Definition: base_shell_element.h:70
std::vector< ShellCrossSection::Pointer > CrossSectionContainerType
Definition: base_shell_element.h:66
IntegrationMethod GetIntegrationMethod() const override
Definition: base_shell_element.h:186
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(BaseShellElement)
Base class for all Elements.
Definition: element.h:60
std::size_t SizeType
Definition: element.h:94
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
IntegrationMethod
Definition: geometry_data.h:76
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
SectionBehaviorType
Definition: shell_cross_section.hpp:68
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
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
std::unique_ptr< T > unique_ptr
Definition: smart_pointers.h:33
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
ShellKinematics
Definition: base_shell_element.h:42
a
Definition: generate_stokes_twofluid_element.py:77
def load(f)
Definition: ode_solve.py:307