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.
interface_element_utilities.hpp
Go to the documentation of this file.
1 
2 // | / |
3 // ' / __| _` | __| _ \ __|
4 // . \ | ( | | ( |\__ `
5 // _|\_\_| \__,_|\__|\___/ ____/
6 // Multi-Physics
7 //
8 // License: BSD License
9 // Kratos default license: kratos/license.txt
10 //
11 // Main authors: Ignasi de Pouplana
12 //
13 
14 
15 #if !defined(KRATOS_INTERFACE_ELEMENT_UTILITIES )
16 #define KRATOS_INTERFACE_ELEMENT_UTILITIES
17 
18 // Project includes
19 #include "includes/element.h"
20 
21 namespace Kratos
22 {
23 
24 class InterfaceElementUtilities
25 {
26 
27 public:
28 
29 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
30 
31  // NOTE:
32  // Taking into account that we evaluate the shape functions associated to displacements (Nu) at the lobatto integration points of order 1 (at the mid plane of the interface),
33  // and that we need to reduce the dimension of those shape functions in order to interpolate the actual relative displacement at the interface, we must multiply Nu by 2.0. In essence:
34  // 2D-quadrilateral: the displacement is interpolated as in a line, but the pore pressure is interpolated as in a quadrilateral
35  // 3D-wedge: the displacement is interpolated as in a triangle, but the pore pressure is interpolated as in a wedge
36  // 3D-hexahedra: the displacement is interpolated as in a quadrilateral, but the pore pressure is interpolated as in a hexahedra
37 
38  static inline void CalculateNuMatrix(BoundedMatrix<double,2,4>& rNu, const Matrix& Ncontainer, const unsigned int& GPoint)
39  {
40  //Line_interface_2d_2
41  rNu(0,0) = -2.0*Ncontainer(GPoint,0); rNu(0,2) = 2.0*Ncontainer(GPoint,1);
42  rNu(1,1) = -2.0*Ncontainer(GPoint,0); rNu(1,3) = 2.0*Ncontainer(GPoint,1);
43  }
44 
45  //----------------------------------------------------------------------------------------
46 
47  static inline void CalculateNuMatrix(BoundedMatrix<double,2,8>& rNu, const Matrix& Ncontainer, const unsigned int& GPoint)
48  {
49  //Quadrilateral_interface_2d_4
50  rNu(0,0) = -2.0*Ncontainer(GPoint,0); rNu(0,2) = -2.0*Ncontainer(GPoint,1);
51  rNu(1,1) = -2.0*Ncontainer(GPoint,0); rNu(1,3) = -2.0*Ncontainer(GPoint,1);
52 
53  rNu(0,4) = 2.0*Ncontainer(GPoint,2); rNu(0,6) = 2.0*Ncontainer(GPoint,3);
54  rNu(1,5) = 2.0*Ncontainer(GPoint,2); rNu(1,7) = 2.0*Ncontainer(GPoint,3);
55  }
56 
57  //----------------------------------------------------------------------------------------
58 
59  static inline void CalculateNuMatrix(BoundedMatrix<double,3,12>& rNu, const Matrix& Ncontainer, const unsigned int& GPoint)
60  {
61  //Quadrilateral_interface_3d_4
62  rNu(0,0) = -2.0*Ncontainer(GPoint,0); rNu(0,3) = -2.0*Ncontainer(GPoint,1);
63  rNu(1,1) = -2.0*Ncontainer(GPoint,0); rNu(1,4) = -2.0*Ncontainer(GPoint,1);
64  rNu(2,2) = -2.0*Ncontainer(GPoint,0); rNu(2,5) = -2.0*Ncontainer(GPoint,1);
65 
66  rNu(0,6) = 2.0*Ncontainer(GPoint,2); rNu(0,9) = 2.0*Ncontainer(GPoint,3);
67  rNu(1,7) = 2.0*Ncontainer(GPoint,2); rNu(1,10) = 2.0*Ncontainer(GPoint,3);
68  rNu(2,8) = 2.0*Ncontainer(GPoint,2); rNu(2,11) = 2.0*Ncontainer(GPoint,3);
69  }
70 
71  //----------------------------------------------------------------------------------------
72 
73  static inline void CalculateNuMatrix(BoundedMatrix<double,3,18>& rNu, const Matrix& Ncontainer, const unsigned int& GPoint)
74  {
75  //Prism_interface_3d_6
76  rNu(0,0) = -2.0*Ncontainer(GPoint,0); rNu(0,3) = -2.0*Ncontainer(GPoint,1); rNu(0,6) = -2.0*Ncontainer(GPoint,2);
77  rNu(1,1) = -2.0*Ncontainer(GPoint,0); rNu(1,4) = -2.0*Ncontainer(GPoint,1); rNu(1,7) = -2.0*Ncontainer(GPoint,2);
78  rNu(2,2) = -2.0*Ncontainer(GPoint,0); rNu(2,5) = -2.0*Ncontainer(GPoint,1); rNu(2,8) = -2.0*Ncontainer(GPoint,2);
79 
80  rNu(0,9) = 2.0*Ncontainer(GPoint,3); rNu(0,12) = 2.0*Ncontainer(GPoint,4); rNu(0,15) = 2.0*Ncontainer(GPoint,5);
81  rNu(1,10) = 2.0*Ncontainer(GPoint,3); rNu(1,13) = 2.0*Ncontainer(GPoint,4); rNu(1,16) = 2.0*Ncontainer(GPoint,5);
82  rNu(2,11) = 2.0*Ncontainer(GPoint,3); rNu(2,14) = 2.0*Ncontainer(GPoint,4); rNu(2,17) = 2.0*Ncontainer(GPoint,5);
83  }
84 
85  //----------------------------------------------------------------------------------------
86 
87  static inline void CalculateNuMatrix(BoundedMatrix<double,3,24>& rNu, const Matrix& Ncontainer, const unsigned int& GPoint)
88  {
89  //Hexahedral_interface_3d_8
90  rNu(0,0) = -2.0*Ncontainer(GPoint,0); rNu(0,3) = -2.0*Ncontainer(GPoint,1); rNu(0,6) = -2.0*Ncontainer(GPoint,2); rNu(0,9) = -2.0*Ncontainer(GPoint,3);
91  rNu(1,1) = -2.0*Ncontainer(GPoint,0); rNu(1,4) = -2.0*Ncontainer(GPoint,1); rNu(1,7) = -2.0*Ncontainer(GPoint,2); rNu(1,10) = -2.0*Ncontainer(GPoint,3);
92  rNu(2,2) = -2.0*Ncontainer(GPoint,0); rNu(2,5) = -2.0*Ncontainer(GPoint,1); rNu(2,8) = -2.0*Ncontainer(GPoint,2); rNu(2,11) = -2.0*Ncontainer(GPoint,3);
93 
94  rNu(0,12) = 2.0*Ncontainer(GPoint,4); rNu(0,15) = 2.0*Ncontainer(GPoint,5); rNu(0,18) = 2.0*Ncontainer(GPoint,6); rNu(0,21) = 2.0*Ncontainer(GPoint,7);
95  rNu(1,13) = 2.0*Ncontainer(GPoint,4); rNu(1,16) = 2.0*Ncontainer(GPoint,5); rNu(1,19) = 2.0*Ncontainer(GPoint,6); rNu(1,22) = 2.0*Ncontainer(GPoint,7);
96  rNu(2,14) = 2.0*Ncontainer(GPoint,4); rNu(2,17) = 2.0*Ncontainer(GPoint,5); rNu(2,20) = 2.0*Ncontainer(GPoint,6); rNu(2,23) = 2.0*Ncontainer(GPoint,7);
97  }
98 
99 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
100 
101  static inline void CalculateNuElementMatrix(BoundedMatrix<double,3,12>& rNut, const Matrix& Ncontainer, const unsigned int& GPoint)
102  {
103  //Quadrilateral_interface_2d_4
104  rNut(0,0) = -2.0*Ncontainer(GPoint,0); rNut(0,3) = -2.0*Ncontainer(GPoint,1);
105  rNut(1,1) = -2.0*Ncontainer(GPoint,0); rNut(1,4) = -2.0*Ncontainer(GPoint,1);
106 
107  rNut(0,6) = 2.0*Ncontainer(GPoint,2); rNut(0,9) = 2.0*Ncontainer(GPoint,3);
108  rNut(1,7) = 2.0*Ncontainer(GPoint,2); rNut(1,10) = 2.0*Ncontainer(GPoint,3);
109  }
110 
111  //----------------------------------------------------------------------------------------
112 
113  static inline void CalculateNuElementMatrix(BoundedMatrix<double,4,24>& rNut, const Matrix& Ncontainer, const unsigned int& GPoint)
114  {
115  //Prism_interface_3d_6
116  rNut(0,0) = -2.0*Ncontainer(GPoint,0); rNut(0,4) = -2.0*Ncontainer(GPoint,1); rNut(0,8) = -2.0*Ncontainer(GPoint,2);
117  rNut(1,1) = -2.0*Ncontainer(GPoint,0); rNut(1,5) = -2.0*Ncontainer(GPoint,1); rNut(1,9) = -2.0*Ncontainer(GPoint,2);
118  rNut(2,2) = -2.0*Ncontainer(GPoint,0); rNut(2,6) = -2.0*Ncontainer(GPoint,1); rNut(2,10) = -2.0*Ncontainer(GPoint,2);
119 
120  rNut(0,12) = 2.0*Ncontainer(GPoint,3); rNut(0,16) = 2.0*Ncontainer(GPoint,4); rNut(0,20) = 2.0*Ncontainer(GPoint,5);
121  rNut(1,13) = 2.0*Ncontainer(GPoint,3); rNut(1,17) = 2.0*Ncontainer(GPoint,4); rNut(1,21) = 2.0*Ncontainer(GPoint,5);
122  rNut(2,14) = 2.0*Ncontainer(GPoint,3); rNut(2,18) = 2.0*Ncontainer(GPoint,4); rNut(2,22) = 2.0*Ncontainer(GPoint,5);
123  }
124 
125  //----------------------------------------------------------------------------------------
126 
127  static inline void CalculateNuElementMatrix(BoundedMatrix<double,4,32>& rNut, const Matrix& Ncontainer, const unsigned int& GPoint)
128  {
129  //Hexahedral_interface_3d_8
130  rNut(0,0) = -2.0*Ncontainer(GPoint,0); rNut(0,4) = -2.0*Ncontainer(GPoint,1); rNut(0,8) = -2.0*Ncontainer(GPoint,2); rNut(0,12) = -2.0*Ncontainer(GPoint,3);
131  rNut(1,1) = -2.0*Ncontainer(GPoint,0); rNut(1,5) = -2.0*Ncontainer(GPoint,1); rNut(1,9) = -2.0*Ncontainer(GPoint,2); rNut(1,13) = -2.0*Ncontainer(GPoint,3);
132  rNut(2,2) = -2.0*Ncontainer(GPoint,0); rNut(2,6) = -2.0*Ncontainer(GPoint,1); rNut(2,10) = -2.0*Ncontainer(GPoint,2); rNut(2,14) = -2.0*Ncontainer(GPoint,3);
133 
134  rNut(0,16) = 2.0*Ncontainer(GPoint,4); rNut(0,20) = 2.0*Ncontainer(GPoint,5); rNut(0,24) = 2.0*Ncontainer(GPoint,6); rNut(0,28) = 2.0*Ncontainer(GPoint,7);
135  rNut(1,17) = 2.0*Ncontainer(GPoint,4); rNut(1,21) = 2.0*Ncontainer(GPoint,5); rNut(1,25) = 2.0*Ncontainer(GPoint,6); rNut(1,29) = 2.0*Ncontainer(GPoint,7);
136  rNut(2,18) = 2.0*Ncontainer(GPoint,4); rNut(2,22) = 2.0*Ncontainer(GPoint,5); rNut(2,26) = 2.0*Ncontainer(GPoint,6); rNut(2,30) = 2.0*Ncontainer(GPoint,7);
137  }
138 
139 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
140 
141  static inline void CalculatePermeabilityMatrix(BoundedMatrix<double,2,2>& rPermeabilityMatrix,
142  const double& JointWidth, const double& Transversal_Permeability_Coeff)
143  {
144  //Quadrilateral_interface_2d_4
145  rPermeabilityMatrix(0,0) = JointWidth*JointWidth/12.0;
146  rPermeabilityMatrix(1,1) = Transversal_Permeability_Coeff;
147  }
148 
149  //----------------------------------------------------------------------------------------
150 
151  static inline void CalculatePermeabilityMatrix(BoundedMatrix<double,3,3>& rPermeabilityMatrix,
152  const double& JointWidth, const double& Transversal_Permeability_Coeff)
153  {
154  //Prism_interface_3d_6 & Hexahedral_interface_3d_8
155  rPermeabilityMatrix(0,0) = JointWidth*JointWidth/12.0;
156  rPermeabilityMatrix(1,1) = JointWidth*JointWidth/12.0;
157  rPermeabilityMatrix(2,2) = Transversal_Permeability_Coeff;
158  }
159 
160 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
161 
162  static inline void CalculateVoigtVector(array_1d<double,2>& rVoigtVector)
163  {
164  //Quadrilateral_interface_2d_4
165  rVoigtVector[0] = 0.0;
166  rVoigtVector[1] = 1.0;
167  }
168 
169  //----------------------------------------------------------------------------------------
170 
171  static inline void CalculateVoigtVector(array_1d<double,3>& rVoigtVector)
172  {
173  //Prism_interface_3d_6 & Hexahedral_interface_3d_8
174  rVoigtVector[0] = 0.0;
175  rVoigtVector[1] = 0.0;
176  rVoigtVector[2] = 1.0;
177  }
178 
179 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
180 
181  static inline void CalculateLinkPermeabilityMatrix(BoundedMatrix<double,2,2>& rPermeabilityMatrix,
182  const double& JointWidth)
183  {
184  //Quadrilateral_interface_2d_4
185  rPermeabilityMatrix(0,0) = JointWidth*JointWidth/12.0;
186  rPermeabilityMatrix(1,1) = JointWidth*JointWidth/12.0;
187  }
188 
189  //----------------------------------------------------------------------------------------
190 
191  static inline void CalculateLinkPermeabilityMatrix(BoundedMatrix<double,3,3>& rPermeabilityMatrix,
192  const double& JointWidth)
193  {
194  //Prism_interface_3d_6 & Hexahedral_interface_3d_8
195  rPermeabilityMatrix(0,0) = JointWidth*JointWidth/12.0;
196  rPermeabilityMatrix(1,1) = JointWidth*JointWidth/12.0;
197  rPermeabilityMatrix(2,2) = JointWidth*JointWidth/12.0;
198  }
199 
200 }; /* Class InterfaceElementUtilities*/
201 } /* namespace Kratos.*/
202 
203 #endif /* KRATOS_INTERFACE_ELEMENT_UTILITIES defined */
static void CalculateNuMatrix(BoundedMatrix< double, 3, 24 > &rNu, const Matrix &Ncontainer, const unsigned int &GPoint)
Definition: interface_element_utilities.hpp:87
static void CalculateLinkPermeabilityMatrix(BoundedMatrix< double, 3, 3 > &rPermeabilityMatrix, const double &JointWidth)
Definition: interface_element_utilities.hpp:191
static void CalculateNuMatrix(BoundedMatrix< double, 3, 18 > &rNu, const Matrix &Ncontainer, const unsigned int &GPoint)
Definition: interface_element_utilities.hpp:73
static void CalculateNuMatrix(BoundedMatrix< double, 2, 8 > &rNu, const Matrix &Ncontainer, const unsigned int &GPoint)
Definition: interface_element_utilities.hpp:47
static void CalculateLinkPermeabilityMatrix(BoundedMatrix< double, 2, 2 > &rPermeabilityMatrix, const double &JointWidth)
Definition: interface_element_utilities.hpp:181
static void CalculateNuElementMatrix(BoundedMatrix< double, 3, 12 > &rNut, const Matrix &Ncontainer, const unsigned int &GPoint)
Definition: interface_element_utilities.hpp:101
static void CalculateNuMatrix(BoundedMatrix< double, 3, 12 > &rNu, const Matrix &Ncontainer, const unsigned int &GPoint)
Definition: interface_element_utilities.hpp:59
static void CalculatePermeabilityMatrix(BoundedMatrix< double, 2, 2 > &rPermeabilityMatrix, const double &JointWidth, const double &Transversal_Permeability_Coeff)
Definition: interface_element_utilities.hpp:141
static void CalculateNuElementMatrix(BoundedMatrix< double, 4, 32 > &rNut, const Matrix &Ncontainer, const unsigned int &GPoint)
Definition: interface_element_utilities.hpp:127
static void CalculateNuMatrix(BoundedMatrix< double, 2, 4 > &rNu, const Matrix &Ncontainer, const unsigned int &GPoint)
Definition: interface_element_utilities.hpp:38
static void CalculateNuElementMatrix(BoundedMatrix< double, 4, 24 > &rNut, const Matrix &Ncontainer, const unsigned int &GPoint)
Definition: interface_element_utilities.hpp:113
static void CalculatePermeabilityMatrix(BoundedMatrix< double, 3, 3 > &rPermeabilityMatrix, const double &JointWidth, const double &Transversal_Permeability_Coeff)
Definition: interface_element_utilities.hpp:151
static void CalculateVoigtVector(array_1d< double, 3 > &rVoigtVector)
Definition: interface_element_utilities.hpp:171
static void CalculateVoigtVector(array_1d< double, 2 > &rVoigtVector)
Definition: interface_element_utilities.hpp:162
Definition: amatrix_interface.h:41
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21