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.
shell_thin_element_3D4N.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: Peter Wilson
10 // Contact: A.Winterstein[at]tum.de
11 //
12 
13 #pragma once
14 
15 // System includes
16 #include <type_traits>
17 
18 // External includes
19 
20 // Project includes
23 #include "custom_utilities/shellq4_corotational_coordinate_transformation.hpp"
24 #include "custom_utilities/shellq4_local_coordinate_system.hpp"
25 
26 namespace Kratos
27 {
31 
35 
39 
43 
46 
59 /*
60 Shell formulation references:
61 
62 ANDES formulation:
63 Bjorn Haugen. "Buckling and Stability Problems for Thin Shell Structures
64 Using High Performance Finite Elements". Dissertation. Colorado: University
65 of Colorado, 1994.
66 
67 ANDES filter matrix H modification as per:
68 Carlos A Felippa. "Supernatural QUAD4: a template formulation". In: Computer
69 methods in applied mechanics and engineering 195.41 (2006), pp. 5316-5342.
70 
71 DKQ original formulation:
72 Jean-Louis Batoz and Mabrouk Ben Tahar. "Evaluation of a new quadrilateral
73 thin plate bending element". In: International Journal for Numerical Methods
74 in Engineering 18.11 (1982), pp. 1655-1677.
75 
76 Clearly presented DKQ formulation:
77 Fabian Rojas Barrales. "Development of a nonlinear quadrilateral layered
78 membrane element with drilling degrees of freedom and a nonlinear
79 quadrilateral thin flat layered shell element for the modeling of reinforced
80 concrete walls". Dissertation. Los Angeles, California: University of
81 Southern California, 2012. */
82 
83 template <ShellKinematics TKinematics>
84 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) ShellThinElement3D4N : public
85  BaseShellElement<typename std::conditional<TKinematics==ShellKinematics::NONLINEAR_COROTATIONAL,
86  ShellQ4_CorotationalCoordinateTransformation,
87  ShellQ4_CoordinateTransformation>::type>
88 {
89 public:
90 
94 
95  using BaseType = BaseShellElement<typename std::conditional<TKinematics==ShellKinematics::NONLINEAR_COROTATIONAL,
98 
100 
102 
104 
106 
108 
110 
112 
113  using Element::GetGeometry;
114 
116 
117  using Vector3Type = typename BaseType::Vector3Type;
118 
120 
124  GeometryType::Pointer pGeometry);
125 
127  GeometryType::Pointer pGeometry,
128  PropertiesType::Pointer pProperties);
129 
130  ~ShellThinElement3D4N() override = default;
131 
133 
136  // Basic
137 
145  Element::Pointer Create(
146  IndexType NewId,
147  GeometryType::Pointer pGeom,
148  PropertiesType::Pointer pProperties
149  ) const override;
150 
158  Element::Pointer Create(
159  IndexType NewId,
160  NodesArrayType const& ThisNodes,
161  PropertiesType::Pointer pProperties
162  ) const override;
163 
164 
165  // More results calculation on integration points to interface with python
166 
168 
169  void CalculateOnIntegrationPoints(const Variable<double>& rVariable,
170  std::vector<double>& rOutput, const ProcessInfo& rCurrentProcessInfo) override;
171 
172  void CalculateOnIntegrationPoints(const Variable<Matrix>& rVariable,
173  std::vector<Matrix>& rOutput, const ProcessInfo& rCurrentProcessInfo) override;
174 
184  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
185 
187 
191 
192 protected:
193 
196 
200  {
201  }
202 
204 
205 private:
206 
209  class CalculationData
210  {
211  public:
212 
213  // ---------------------------------------
214  // calculation-constant data
215  // ----------------------------------------
216  // these data are allocated and constructed
217  // at the beginning of the calculation
218 
222  // Unit vectors (in cartesian coords)
223  Vector s_xi = ZeroVector(3);
224  Vector s_eta = ZeroVector(3);
226  // Geometry data
227  array_1d<Vector, 4> r_cartesian;
230  // Displacements
231  VectorType globalDisplacements = ZeroVector(24);
232  VectorType localDisplacements = ZeroVector(24);
234  // Element flags
235  bool CalculateRHS;
236  bool CalculateLHS;
238  // ---------------------------------------
239  // Testing flags
240  // ---------------------------------------
241  // These should both be FALSE unless you are testing, or
242  // investigating the effects of element enhancements!
243 
244  const bool basicQuad = false;
248  // ---------------------------------------
249  // calculation-variable data
250  // ---------------------------------------
251  // these data are updated during the
252  // calculations
253 
255  SizeType gpIndex;
257  // ---------------------------------------
258  // calculation-variable data
259  // ---------------------------------------
260  // these data are updated during the
261  // calculations, but they are allocated
262  // only once(the first time they are used)
263  // to avoid useless re-allocations
264 
265  // ANDES membrane data
266  const double alpha = 1.5;
267  MatrixType L_mem = ZeroMatrix(3, 12);
268  MatrixType H_mem_mod = ZeroMatrix(7, 12);
269  MatrixType Z = ZeroMatrix(12, 12);
270  MatrixType B_h_1 = ZeroMatrix(3, 7);
271  MatrixType B_h_2 = ZeroMatrix(3, 7);
272  MatrixType B_h_3 = ZeroMatrix(3, 7);
273  MatrixType B_h_4 = ZeroMatrix(3, 7);
274  MatrixType B_h_bar = ZeroMatrix(3, 7);
275  MatrixType T_13 = ZeroMatrix(3, 3);
276  MatrixType T_24 = ZeroMatrix(3, 3);
277 
278  // DKQ bending data
279  array_1d<double, 4> DKQ_a;
280  array_1d<double, 4> DKQ_b;
281  array_1d<double, 4> DKQ_c;
282  array_1d<double, 4> DKQ_d;
283  array_1d<double, 4> DKQ_e;
284  MatrixType DKQ_indices = ZeroMatrix(4, 2);
285  array_1d<Matrix, 4> DKQ_invJac;
286  array_1d<Matrix, 4> DKQ_jac;
287  array_1d<double, 4> DKQ_jac_det;
288 
289 
290  // General total element data
291  MatrixType B = ZeroMatrix(6, 24);
292  MatrixType D = ZeroMatrix(6, 6);
293  MatrixType BTD = ZeroMatrix(24, 6);
295  VectorType generalizedStrains = ZeroVector(6);
296  VectorType generalizedStresses = ZeroVector(6);
297  std::vector<VectorType> rlaminateStrains;
298  std::vector<VectorType> rlaminateStresses;
301  ShellCrossSection::SectionParameters SectionParameters;
303  public:
304 
305  const ProcessInfo& CurrentProcessInfo;
306 
307  public:
308 
309  CalculationData(const ShellQ4_LocalCoordinateSystem& localcoordsys,
310  const ShellQ4_LocalCoordinateSystem& refcoordsys,
311  const ProcessInfo& rCurrentProcessInfo);
312  };
313 
315 
318  void CalculateStressesFromForceResultants
319  (VectorType& rstresses,
320  const double& rthickness);
321 
322  void CalculateLaminaStrains(CalculationData& data);
323 
324  void CalculateLaminaStresses(CalculationData& data);
325 
326  double CalculateTsaiWuPlaneStress(const CalculationData& data, const Matrix& rLamina_Strengths, const unsigned int& rCurrent_Ply);
327 
328  void CalculateVonMisesStress(const CalculationData& data, const Variable<double>& rVariable, double& rVon_Mises_Result);
329 
330  void CalculateShellElementEnergy(const CalculationData& data, const Variable<double>& rVariable, double& rEnergy_Result);
331 
332  void CheckGeneralizedStressOrStrainOutput(const Variable<Matrix>& rVariable, int& iJob, bool& bGlobal);
333 
334  void InitializeCalculationData(CalculationData& data);
335 
336  void CalculateBMatrix(CalculationData& data);
337 
338  void CalculateSectionResponse(CalculationData& data);
339 
340  void CalculateGaussPointContribution(CalculationData& data,
341  MatrixType& LHS, VectorType& RHS);
342 
343  void AddBodyForces(CalculationData& data,
344  VectorType& rRightHandSideVector); //not required for dyn
345 
346  void CalculateAll(MatrixType& rLeftHandSideMatrix,
347  VectorType& rRightHandSideVector,
348  const ProcessInfo& rCurrentProcessInfo,
349  const bool CalculateStiffnessMatrixFlag,
350  const bool CalculateResidualVectorFlag) override;
351 
352  bool TryCalculateOnIntegrationPoints_GeneralizedStrainsOrStresses(const Variable<Matrix>& rVariable,
353  std::vector<Matrix>& rValues,
354  const ProcessInfo& rCurrentProcessInfo);
355 
360  ShellCrossSection::SectionBehaviorType GetSectionBehavior() const override;
361 
363 
367 
370 
372 
375  friend class Serializer;
376 
377  void save(Serializer& rSerializer) const override;
378 
379  void load(Serializer& rSerializer) override;
380 
382 
386 
390 
394 };
395 }
Definition: base_shell_element.h:54
PropertiesType & GetProperties()
Definition: element.h:1024
Vector VectorType
Definition: element.h:88
std::size_t SizeType
Definition: element.h:94
Properties PropertiesType
Definition: element.h:80
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: element.h:86
Matrix MatrixType
Definition: element.h:90
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: element.h:83
std::size_t IndexType
Definition: flags.h:74
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
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
SectionParameters.
Definition: shell_cross_section.hpp:101
SectionBehaviorType
Definition: shell_cross_section.hpp:68
ShellQ4_CoordinateTransformation.
Definition: shellq4_coordinate_transformation.hpp:28
EICR ShellQ4_CorotationalCoordinateTransformation.
Definition: shellq4_corotational_coordinate_transformation.hpp:45
ShellQ4_LocalCoordinateSystem.
Definition: shellq4_local_coordinate_system.hpp:23
ShellThinElement3D4N.
Definition: shell_thin_element_3D4N.hpp:88
~ShellThinElement3D4N() override=default
ShellThinElement3D4N()
Definition: shell_thin_element_3D4N.hpp:199
typename BaseType::Vector3Type Vector3Type
Definition: shell_thin_element_3D4N.hpp:117
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(ShellThinElement3D4N)
Quaternion< double > QuaternionType
Definition: shell_thin_element_3D4N.hpp:99
JacobianOperator.
Definition: shell_utilities.h:41
Short class definition.
Definition: array_1d.h:61
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
array_1d< double, 3 > VectorType
Definition: solid_mechanics_application_variables.cpp:19
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
type
Definition: generate_gid_list_file.py:35
data
Definition: mesh_to_mdpa_converter.py:59
def load(f)
Definition: ode_solve.py:307
N
Definition: sensitivityMatrix.py:29
B
Definition: sensitivityMatrix.py:76