BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IFG_TET10D.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_IFG_TET10D_HPP
13#define BELFEM_CL_IFG_TET10D_HPP
14
16
17namespace belfem
18{
19 namespace fem
20 {
21//------------------------------------------------------------------------------
22
30
31//------------------------------------------------------------------------------
32
33 template<>
41
42//------------------------------------------------------------------------------
43
44 template<>
49 {
50 return ElementType::TET10;
51 }
52
53//------------------------------------------------------------------------------
54
55
56 template<>
57 void
60 ::param_coords( Matrix <real> & aXiHat ) const
61 {
62 aXiHat.set_size( 3, 3 );
63
64 // point 0
65 aXiHat( 0, 0 ) = 2./3. ;
66 aXiHat( 0, 1 ) = 1./6. ;
67 aXiHat( 0, 2 ) = 1./6. ;
68
69 // point 1
70 aXiHat( 1, 0 ) = 1./6. ;
71 aXiHat( 1, 1 ) = 1./6. ;
72 aXiHat( 1, 2 ) = 2./3. ;
73
74 // point 2
75 aXiHat( 2, 0 ) = 1./6. ;
76 aXiHat( 2, 1 ) = 2./3. ;
77 aXiHat( 2, 2 ) = 1./6. ;
78 }
79
80//------------------------------------------------------------------------------
81
82 template<>
83 void
86 const Vector <real> & aXi,
87 Matrix <real> & aN ) const
88 {
89 const real xi = aXi( 0 );
90 const real eta = aXi( 1 );
91 const real zeta = aXi( 2 );
92
93 real K = 64.8 ;
94
95 real xi2 = xi*xi ;
96 real eta2 = eta*eta ;
97 real zeta2 = zeta*zeta ;
98
99 real a = 2*zeta2-xi2-eta2 ;
100 real b = 2*xi2 - eta2-zeta2 ;
101 real c = 2*eta2 - xi2-zeta2 ;
102 real d = xi*eta*zeta ;
103
104 aN.set_size( 1, 3 );
105 aN( 0, 0 ) = K * d * a ;
106 aN( 0, 1 ) = K * d * b ;
107 aN( 0, 2 ) = K * d * c ;
108 }
109
110
111//------------------------------------------------------------------------------
112
113 template<>
114 void
117 const Vector <real> & aXi,
118 Matrix <real> & adNdXi ) const
119 {
120 const real xi = aXi( 0 );
121 const real eta = aXi( 1 );
122 const real zeta = aXi( 2 );
123
124 real K = 64.8 ;
125
126 real xi2 = xi*xi ;
127 real eta2 = eta*eta ;
128 real zeta2 = zeta*zeta ;
129
130 real a = 2.*zeta2-xi2-eta2 ;
131 real b = 2.*xi2 - eta2-zeta2 ;
132 real c = 2.*eta2 - xi2-zeta2 ;
133 real d = xi*eta*zeta ;
134
135 real a_xi = -2.*xi ;
136 real a_eta = -2.*eta ;
137 real a_zeta = 4.*zeta ;
138
139 real b_xi = 4.* xi ;
140 real b_eta = -2.* eta ;
141 real b_zeta = -2.*zeta ;
142
143 real c_xi = -2.*xi ;
144 real c_eta = 4.*eta ;
145 real c_zeta = -2.*zeta;
146
147 real d_xi = eta*zeta;
148 real d_eta = xi*zeta ;
149 real d_zeta = xi*eta;
150
151 adNdXi.set_size( 3, 3 );
152
153 adNdXi( 0, 0 ) = K * ( d_xi * a + d * a_xi ); // dN1/dxi
154 adNdXi( 0, 1 ) = K * ( d_eta * a + d * a_eta ); // dN1/deta
155 adNdXi( 0, 2 ) = K * ( d_zeta * a + d * a_zeta ); // dN1/dzeta
156
157 adNdXi( 1, 0 ) = K * ( d_xi * b + d * b_xi ); // dN2/dxi
158 adNdXi( 1, 1 ) = K * ( d_eta * b + d * b_eta ); // dN2/deta
159 adNdXi( 1, 2 ) = K * ( d_zeta * b + d * b_zeta ); // dN2/dzeta
160
161 adNdXi( 2, 0 ) = K * ( d_xi * c + d * c_xi ); // dN3/dxi
162 adNdXi( 2, 1 ) = K * ( d_eta * c + d * c_eta ); // dN3/deta
163 adNdXi( 2, 2 ) = K * ( d_zeta * c + d * c_zeta ); // dN3/dzeta
164
165 }
166
167//------------------------------------------------------------------------------
168
169
170 template<>
171 void
174 const Vector <real> & aXi,
175 Matrix <real> & ad2NdXi2 ) const
176 {
177 const real xi = aXi( 0 );
178 const real eta = aXi( 1 );
179 const real zeta = aXi( 2 );
180
181 real K = 64.8 ;
182
183 real xi2 = xi*xi ;
184 real eta2 = eta*eta ;
185 real zeta2 = zeta*zeta ;
186
187 real a = 2.*zeta2-xi2-eta2 ;
188 real b = 2.*xi2 - eta2-zeta2 ;
189 real c = 2.*eta2 - xi2-zeta2 ;
190 real d = xi*eta*zeta ;
191
192 real a_xi = -2.*xi ;
193 real a_eta = -2.*eta ;
194 real a_zeta = 4.*zeta ;
195
196 real b_xi = 4.* xi ;
197 real b_eta = -2.* eta ;
198 real b_zeta = -2.*zeta ;
199
200 real c_xi = -2.*xi ;
201 real c_eta = 4.*eta ;
202 real c_zeta = -2.*zeta;
203
204 real d_xi = eta*zeta;
205 real d_eta = xi*zeta ;
206 real d_zeta = xi*eta;
207
208 ad2NdXi2.set_size( 6,3 );
209
210 // d²N1/dxi²
211 ad2NdXi2( 0, 0 ) = 2.*K*(a_xi*d_xi-d);
212
213 // d²N1/deta²
214 ad2NdXi2( 1, 0 ) = 2.*K*(a_eta*d_eta-d);
215
216 // d²N1/dzeta²
217 ad2NdXi2( 2, 0 ) = 2.*K*(a_zeta*d_zeta+2.*d);
218
219 // d²N1/(deta*dzeta)
220 ad2NdXi2( 3, 0 ) = K*(a_eta*d_zeta + a_zeta*d_eta + a*xi);
221
222 // d²N1/(dxi*dzeta)
223 ad2NdXi2( 4, 0 ) = K*(a_xi*d_zeta + a_zeta*d_xi + a*eta);
224
225 // d²N1/(dxi*deta)
226 ad2NdXi2( 5, 0 ) = K*(a_eta*d_xi + a_xi*d_eta + a*zeta);
227
228 // d²N2/dxi²
229 ad2NdXi2( 0, 1 ) = 2.*K*(b_xi*d_xi+2.*d);
230
231 // d²N2/deta²
232 ad2NdXi2( 1, 1 ) = 2.*K*(b_eta*d_eta-d);
233
234 // d²N2/dzeta²
235 ad2NdXi2( 2, 1 ) = 2.*K*(b_zeta*d_zeta-d);
236
237 // d²N2/(deta*dzeta)
238 ad2NdXi2( 3, 1 ) = K*(b_eta*d_zeta + b_zeta*d_eta + b*xi);
239
240 // d²N2/(dxi*dzeta)
241 ad2NdXi2( 4, 1 ) = K*(b_xi*d_zeta + b_zeta*d_xi + b*eta);
242
243 // d²N2/(dxi*deta)
244 ad2NdXi2( 5, 1 ) = K*(b_eta*d_xi + b_xi*d_eta + b*zeta);
245
246 // d²N3/dxi²
247 ad2NdXi2( 0, 2 ) = 2.*K*(c_xi*d_xi-d);
248
249 // d²N3/deta²
250 ad2NdXi2( 1, 2 ) = 2.*K*(c_eta*d_eta+2.*d);
251
252 // d²N3/dzeta²
253 ad2NdXi2( 2, 2 ) = 2.*K*(c_zeta*d_zeta-d);
254
255 // d²N3/(deta*dzeta)
256 ad2NdXi2( 3, 2 ) = K*(c_eta*d_zeta + c_zeta*d_eta + c*xi);
257
258 // d²N3/(dxi*dzeta)
259 ad2NdXi2( 4, 2 ) = K*(c_xi*d_zeta + c_zeta*d_xi + c*eta);
260
261 // d²N3/(dxi*deta)
262 ad2NdXi2( 5, 2 ) = K*(c_eta*d_xi + c_xi*d_eta + c*zeta);
263
264 }
265
266//------------------------------------------------------------------------------
267 }
268}
269#endif //BELFEM_CL_IFG_TET4D_HPP
void set_size(const size_t aNumRows, const size_t aNumCols)
Definition cl_AR_Matrix.hpp:186
shape function templated class G : Geometry T : Type D : Dimension B : Number of Basis
Definition cl_IF_InterpolationFunctionTemplate.hpp:25
void param_coords(Matrix< real > &aXiHat) const override
returns a matrix containing the parameter coordinates of the nodes < number of dimensions x number of...
Definition cl_IF_InterpolationFunctionTemplate.hpp:49
InterpolationOrder interpolation_order() const override
returns the interpolation order
Definition cl_IF_InterpolationFunctionTemplate.hpp:145
void d2NdXi2(const Vector< real > &aXi, Matrix< real > &ad2NdXi2) const override
calculates the second derivative of the shape function in parameter space
Definition cl_IF_InterpolationFunctionTemplate.hpp:110
void dNdXi(const Vector< real > &aXi, Matrix< real > &adNdXi) const override
calculates the first derivative of the shape function in parameter space
Definition cl_IF_InterpolationFunctionTemplate.hpp:89
void N(const Vector< real > &aXi, Matrix< real > &aN) const override
evaluates the shape function at a given point
Definition cl_IF_InterpolationFunctionTemplate.hpp:68
Definition cl_IFB_LINE3.hpp:21
@ K
Stiffness matrix.
Definition cl_TimestepMatrices.hpp:35
USER GUIDES:
Definition cl_Capacitor.cpp:16
@ BubbleFace3
Definition Mesh_Enums.hpp:109
ElementType element_type(const std::string &aStr)
Definition Mesh_Enums.hpp:370
ElementType
Element types.
Definition Mesh_Enums.hpp:27
@ TET10
Definition Mesh_Enums.hpp:39
InterpolationOrder
Definition Mesh_Enums.hpp:85
@ CUBIC
Definition Mesh_Enums.hpp:90
double real
Definition typedefs.hpp:36
@ TET
Definition Mesh_Enums.hpp:75