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_utilities.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: Riccardo Rossi (porting from utility made by Fabio Petracca and Peter Wilson)
10 // Philipp Bucher (https://github.com/philbucher)
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/define.h"
21 #include "includes/properties.h"
22 #include "containers/array_1d.h"
23 
24 namespace Kratos {
25 
26 class ShellQ4_LocalCoordinateSystem; // forward declare to avoid circular includes
27 
28 namespace ShellUtilities {
29 
30 using SizeType = std::size_t;
31 using IndexType = std::size_t;
32 
41 {
42 public:
43 
45 
46  template<class TLocalCoordinateSystem>
47  void Calculate(const TLocalCoordinateSystem& CS, const Matrix& dN)
48  {
49  KRATOS_ERROR << "This function should not be called, this type of coordinate transformation is unknown!" << std::endl;
50  }
51 
52  void Calculate(const ShellQ4_LocalCoordinateSystem& CS, const Matrix& dN);
53 
54  inline const Matrix& Jacobian()const
55  {
56  return mJac;
57  }
58 
59  inline const Matrix& Inverse()const
60  {
61  return mInv;
62  }
63 
64  inline const Matrix& XYDerivatives()const
65  {
66  return mXYDeriv;
67  }
68 
69  inline double Determinant()const
70  {
71  return mDet;
72  }
73 
74 private:
75 
76  Matrix mJac;
77  Matrix mInv;
78  Matrix mXYDeriv;
79  double mDet;
80 };
81 
82 template<class TVec>
83 inline void ShapeFunc(double Xi, double Eta, TVec& rN)
84 {
85  rN(0) = 0.25 * (1.0 - Xi) * (1.0 - Eta); // node 1
86  rN(1) = 0.25 * (1.0 + Xi) * (1.0 - Eta); // node 2
87  rN(2) = 0.25 * (1.0 + Xi) * (1.0 + Eta); // node 3
88  rN(3) = 0.25 * (1.0 - Xi) * (1.0 + Eta); // node 4
89 }
90 
91 template<class TMat>
92 inline void ShapeFunc_NaturalDerivatives(double Xi, const double Eta, TMat& rDN)
93 {
94  rDN(0, 0) = -(1.0 - Eta) * 0.25;
95  rDN(1, 0) = (1.0 - Eta) * 0.25;
96  rDN(2, 0) = (1.0 + Eta) * 0.25;
97  rDN(3, 0) = -(1.0 + Eta) * 0.25;
98 
99  rDN(0, 1) = -(1.0 - Xi) * 0.25;
100  rDN(1, 1) = -(1.0 + Xi) * 0.25;
101  rDN(2, 1) = (1.0 + Xi) * 0.25;
102  rDN(3, 1) = (1.0 - Xi) * 0.25;
103 }
104 
105 double dN_seren_dxi(const int nNode, const double Xi, const double Eta);
106 
107 double dN_seren_deta(const int nNode, const double Xi, const double Eta);
108 
109 void InterpToStandardGaussPoints(double& rV1, double& rV2, double& rV3);
110 
111 void InterpToStandardGaussPoints(std::vector< double >& rV);
112 
113 void InterpToStandardGaussPoints(std::vector< array_1d<double, 3> >& rV);
114 
115 void InterpToStandardGaussPoints(std::vector< array_1d<double, 6> >& rV);
116 
117 void InterpToStandardGaussPoints(std::vector< Vector >& rV);
118 
119 void InterpToStandardGaussPoints(std::vector< Matrix >& rV);
120 
121 bool IsOrthotropic(const Properties& rProps);
122 
123 double GetThickness(const Properties& rProps);
124 
125 double GetThickness(const Properties& rProps, const IndexType Index);
126 
127 double GetDensity(const Properties& rProps, const IndexType Index);
128 
129 double GetOrientationAngle(const Properties& rProps, const IndexType Index);
130 
131 double GetOffset(const Properties& rProps);
132 
133 } // namespace Shell Utilities.
134 
135 } // namespace Kratos.
136 
137 
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
ShellQ4_LocalCoordinateSystem.
Definition: shellq4_local_coordinate_system.hpp:23
JacobianOperator.
Definition: shell_utilities.h:41
const Matrix & Jacobian() const
Definition: shell_utilities.h:54
JacobianOperator()
Definition: shell_utilities.cpp:28
double Determinant() const
Definition: shell_utilities.h:69
void Calculate(const TLocalCoordinateSystem &CS, const Matrix &dN)
Definition: shell_utilities.h:47
const Matrix & XYDerivatives() const
Definition: shell_utilities.h:64
const Matrix & Inverse() const
Definition: shell_utilities.h:59
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_ERROR
Definition: exception.h:161
double dN_seren_dxi(const int nNode, const double Xi, const double Eta)
Definition: shell_utilities.cpp:54
std::size_t IndexType
Definition: shell_utilities.cpp:25
bool IsOrthotropic(const Properties &rProps)
Definition: shell_utilities.cpp:192
void ShapeFunc_NaturalDerivatives(double Xi, const double Eta, TMat &rDN)
Definition: shell_utilities.h:92
std::size_t SizeType
Definition: shell_utilities.cpp:24
double dN_seren_deta(const int nNode, const double Xi, const double Eta)
Definition: shell_utilities.cpp:85
void ShapeFunc(double Xi, double Eta, TVec &rN)
Definition: shell_utilities.h:83
double GetThickness(const Properties &rProps)
Definition: shell_utilities.cpp:197
double GetOrientationAngle(const Properties &rProps, const IndexType Index)
Definition: shell_utilities.cpp:234
double GetDensity(const Properties &rProps, const IndexType Index)
Definition: shell_utilities.cpp:223
double GetOffset(const Properties &rProps)
Definition: shell_utilities.cpp:251
void InterpToStandardGaussPoints(double &rV1, double &rV2, double &rV3)
Definition: shell_utilities.cpp:116
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def Index()
Definition: hdf5_io_tools.py:38