BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IFG_TET10A.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_TET10A_HPP
13#define BELFEM_CL_IFG_TET10A_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 ) = 0.0 ;
68
69 // point 1
70 aXiHat( 1, 0 ) = 1./6. ;
71 aXiHat( 1, 1 ) = 2./3. ;
72 aXiHat( 1, 2 ) = 0.0 ;
73
74 // point 2
75 aXiHat( 2, 0 ) = 1./6. ;
76 aXiHat( 2, 1 ) = 1./6. ;
77 aXiHat( 2, 2 ) = 0.0 ;
78
79
80 }
81
82//------------------------------------------------------------------------------
83
84 template<>
85 void
88 const Vector <real> & aXi,
89 Matrix <real> & aN ) const
90 {
91 const real xi = aXi( 0 );
92 const real eta = aXi( 1 );
93 const real zeta = aXi( 2 );
94 const real tau = 1. - xi - eta - zeta ;
95
96 real K = 64.8 ;
97
98 real xi2 = xi*xi ;
99 real eta2 = eta*eta ;
100 real tau2 = tau*tau ;
101
102 real a = 2.*eta2 - xi2 - tau2 ;
103 real b = 2.*xi2 - eta2 - tau2 ;
104 real c = 2.*tau2 - xi2 - eta2 ;
105 real d = xi * eta * tau ;
106
107 aN.set_size( 1, 3 );
108 aN( 0, 0 ) = K * d * a ;
109 aN( 0, 1 ) = K * d * b ;
110 aN( 0, 2 ) = K * d * c ;
111 }
112
113
114//------------------------------------------------------------------------------
115
116 template<>
117 void
120 const Vector <real> & aXi,
121 Matrix <real> & adNdXi ) const
122 {
123 const real xi = aXi( 0 );
124 const real eta = aXi( 1 );
125 const real zeta = aXi( 2 );
126 const real tau = 1. - xi - eta - zeta ;
127
128 real K = 64.8 ;
129
130 real xi2 = xi*xi ;
131 real eta2 = eta*eta ;
132 real tau2 = tau*tau ;
133
134 real a = 2.*eta2 - xi2 - tau2 ;
135 real b = 2.*xi2 - eta2 - tau2 ;
136 real c = 2.*tau2 - xi2 - eta2 ;
137 real d = xi * eta * tau ;
138
139 real a_xi = 2.*( tau - xi );
140 real a_eta = 2.*( tau + 2.*eta );
141 real a_zeta = 2.*tau ;
142
143 real b_xi = 2. * ( tau + 2.*xi );
144 real b_eta = 2. * ( tau - eta );
145 real b_zeta = 2.* tau ;
146
147 real c_xi = -2. * ( xi + 2.*tau ) ;
148 real c_eta = -2. * ( eta + 2.*tau ) ;
149 real c_zeta = -4.*tau ;
150
151 real d_xi = eta*(tau-xi) ;
152 real d_eta = xi*( tau - eta );
153 real d_zeta = -xi*eta ;
154
155
156 adNdXi.set_size( 3, 3 );
157
158 adNdXi( 0, 0 ) = K * ( d_xi * a + d * a_xi ); // dN1/dxi
159 adNdXi( 0, 1 ) = K * ( d_eta * a + d * a_eta ); // dN1/deta
160 adNdXi( 0, 2 ) = K * ( d_zeta * a + d * a_zeta ); // dN1/dzeta
161
162 adNdXi( 1, 0 ) = K * ( d_xi * b + d * b_xi ); // dN2/dxi
163 adNdXi( 1, 1 ) = K * ( d_eta * b + d * b_eta ); // dN2/deta
164 adNdXi( 1, 2 ) = K * ( d_zeta * b + d * b_zeta ); // dN2/dzeta
165
166 adNdXi( 2, 0 ) = K * ( d_xi * c + d * c_xi ); // dN3/dxi
167 adNdXi( 2, 1 ) = K * ( d_eta * c + d * c_eta ); // dN3/deta
168 adNdXi( 2, 2 ) = K * ( d_zeta * c + d * c_zeta ); // dN3/dzeta
169
170 }
171
172//------------------------------------------------------------------------------
173
174
175 template<>
176 void
179 const Vector <real> & aXi,
180 Matrix <real> & ad2NdXi2 ) const
181 {
182 const real xi = aXi( 0 );
183 const real eta = aXi( 1 );
184 const real zeta = aXi( 2 );
185 const real tau = 1. - xi - eta - zeta ;
186
187 real K = 64.8 ;
188
189 real xi2 = xi*xi ;
190 real eta2 = eta*eta ;
191 real tau2 = tau*tau ;
192
193 real a = 2.*eta2 - xi2 - tau2 ;
194 real b = 2.*xi2 - eta2 - tau2 ;
195 real c = 2.*tau2 - xi2 - eta2 ;
196 real d = xi * eta * tau ;
197
198 real a_xi = 2.*( tau - xi );
199 real a_eta = 2.*( tau + 2.*eta );
200 real a_zeta = 2.*tau ;
201
202 real b_xi = 2. * ( tau + 2.*xi );
203 real b_eta = 2. * ( tau - eta );
204 real b_zeta = 2.* tau ;
205
206 real c_xi = -2. * ( xi + 2.*tau ) ;
207 real c_eta = -2. * ( eta + 2.*tau ) ;
208 real c_zeta = -4.*tau ;
209
210 real d_xi = eta*(tau-xi) ;
211 real d_eta = xi*( tau - eta );
212 real d_zeta = -xi*eta ;
213
214 ad2NdXi2.set_size( 6,3 );
215
216 // d²N1/dxi²
217 ad2NdXi2( 0, 0 ) = 2.*K*(a_xi*d_xi - a*eta-2.*d);
218
219 // d²N1/deta²
220 ad2NdXi2( 1, 0 ) = 2.*K*(d + a_eta*d_eta - a*xi);
221
222 // d²N1/dzeta²
223 ad2NdXi2( 2, 0 ) = 2.*K*(a_zeta*d_zeta-d);
224
225 // d²N1/(deta*dzeta)
226 ad2NdXi2( 3, 0 ) = K*( a_eta*d_zeta + a_zeta*d_eta - a*xi-2.*d );
227
228 // d²N1/(dxi*dzeta)
229 ad2NdXi2( 4, 0 ) = K*( a_xi*d_zeta + a_zeta*d_xi - a*eta-2.*d );
230
231 // d²N1/(dxi*deta)
232 ad2NdXi2( 5, 0 ) = K*( a_eta*d_xi + a_xi*d_eta - a*(xi+eta-tau)-2.*d );
233
234 // d²N2/dxi²
235 ad2NdXi2( 0, 1 ) = 2.*K*(d + b_xi*d_xi - b*eta);
236
237 // d²N2/deta²
238 ad2NdXi2( 1, 1 ) = 2.*K*(b_eta*d_eta - b*xi-2.*d);
239
240 // d²N2/dzeta²
241 ad2NdXi2( 2, 1 ) = 2.*K*(b_zeta*d_zeta-d);
242
243 // d²N2/(deta*dzeta)
244 ad2NdXi2( 3, 1 ) = K*(b_eta*d_zeta + b_zeta*d_eta - b*xi-2.*d);
245
246 // d²N2/(dxi*dzeta)
247 ad2NdXi2( 4, 1 ) = K*(b_xi*d_zeta + b_zeta*d_xi - b*eta -2.*d);
248
249 // d²N2/(dxi*deta)
250 ad2NdXi2( 5, 1 ) = K*(b_eta*d_xi + b_xi*d_eta - b*(xi+eta-tau ) -2.*d);
251
252 // d²N3/dxi²
253 ad2NdXi2( 0, 2 ) = 2.*K*(d + c_xi*d_xi - c*eta);
254
255 // d²N3/deta²
256 ad2NdXi2( 1, 2 ) = 2.*K*(d + c_eta*d_eta - c*xi);
257
258 // d²N3/dzeta²
259 ad2NdXi2( 2, 2 ) = 2.*K*(2.*d + c_zeta*d_zeta);
260
261 // d²N3/(deta*dzeta)
262 ad2NdXi2( 3, 2 ) = K*(4.*d + c_eta*d_zeta + c_zeta*d_eta - c*xi);
263
264 // d²N3/(dxi*dzeta)
265 ad2NdXi2( 4, 2 ) = K*(4.*d + c_xi*d_zeta + c_zeta*d_xi - c*eta);
266
267 // d²N3/(dxi*deta)
268 ad2NdXi2( 5, 2 ) = K*(4.*d + c_eta*d_xi + c_xi*d_eta - c*(xi+eta-tau)) ;
269
270 }
271
272//------------------------------------------------------------------------------
273 }
274}
275#endif //BELFEM_CL_IFG_TET10A_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
@ BubbleFace0
Definition Mesh_Enums.hpp:106
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