BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IF_TRI10.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_IF_TRI10_HPP
13#define BELFEM_CL_IF_TRI10_HPP
14
16
17namespace belfem
18{
19 namespace fem
20 {
21//------------------------------------------------------------------------------
22
23 template<>
31
32//------------------------------------------------------------------------------
33
34 template<>
39 {
40 return ElementType::TRI10;
41 }
42
43//------------------------------------------------------------------------------
44
45 template<>
46 void
50 {
51 const real a = 1.0/3.0;
52 const real b = 2.0/3.0;
53
54 aXiHat.set_size( 2, 10 );
55
56 aXiHat( 0, 0 ) = 1.0;
57 aXiHat( 1, 0 ) = 0.0;
58
59 aXiHat( 0, 1 ) = 0.0;
60 aXiHat( 1, 1 ) = 1.0;
61
62 aXiHat( 0, 2 ) = 0.0;
63 aXiHat( 1, 2 ) = 0.0;
64
65 aXiHat( 0, 3 ) = b;
66 aXiHat( 1, 3 ) = a;
67
68 aXiHat( 0, 4 ) = a;
69 aXiHat( 1, 4 ) = b;
70
71 aXiHat( 0, 5 ) = 0;
72 aXiHat( 1, 5 ) = b;
73
74 aXiHat( 0, 6 ) = 0;
75 aXiHat( 1, 6 ) = a;
76
77 aXiHat( 0, 7 ) = a;
78 aXiHat( 1, 7 ) = 0;
79
80 aXiHat( 0, 8 ) = b;
81 aXiHat( 1, 8 ) = 0;
82
83 aXiHat( 0, 9 ) = a;
84 aXiHat( 1, 9 ) = a;
85 }
86
87//------------------------------------------------------------------------------
88
89 template<>
90 void
93 const Vector< real > & aXi,
94 Matrix< real > & aN ) const
95 {
96 const real xi = aXi( 0 );
97 const real eta = aXi( 1 );
98 const real zeta = 1.0 - xi - eta;
99
100 aN.set_size( 1, 10 );
101
102 aN( 0, 0 ) = (9.0*(xi-1)*xi+2.0)*xi*0.5;
103
104 aN( 0, 1 ) = 0.5*eta*(9.0*eta*(eta-1.0)+2.0);
105
106 aN( 0, 2 ) = 0.5*zeta*(3.0*(xi+eta)-2.0)*(3.0*(xi+eta)-1.0);
107
108 aN( 0, 3 ) = 4.5*eta*xi*(3.0*xi-1.0);
109
110 aN( 0, 4 ) = 4.5*eta*xi*(3.0*eta-1.0);
111
112 aN( 0, 5 ) = 4.5*zeta*eta*(3.0*eta-1.0);
113
114 aN( 0, 6 ) = 4.5*eta*((3.0*(xi+eta)-5.0)*(xi+eta)+2.0);
115
116 aN( 0, 7 ) = 4.5*xi*((3.0*(xi+eta)-5.0)*(xi+eta)+2.0);
117
118 aN( 0, 8 ) = 4.5*xi*zeta*(3.0*xi-1.0);
119
120 aN( 0, 9 ) = 27.0*xi*eta*zeta;
121
122 }
123
124//------------------------------------------------------------------------------
125
126 template<>
127 void
130 const Vector< real > & aXi,
131 Matrix< real > & adNdXi ) const
132 {
133 const real xi = aXi( 0 );
134 const real eta = aXi( 1 );
135
136 adNdXi.set_size( 2, 10 );
137
138 adNdXi(0,0)=1.0+xi*(13.5*xi-9.0);
139 adNdXi(1,0)=0.0;
140
141 adNdXi(0,1)=0.0;
142 adNdXi(1,1)=1.0+eta*(13.5*eta-9.0);
143
144 adNdXi(0,2)=eta*((18.0-27.0*xi)-13.5*eta)+(18.0-13.5*xi)*xi-5.5;
145 adNdXi(1,2)=eta*((18.0-27.0*xi)-13.5*eta)+(18.0-13.5*xi)*xi-5.5;
146
147 adNdXi(0,3)=eta*(27.*xi-4.5);
148 adNdXi(1,3)=xi*(13.5*xi-4.5);
149
150 adNdXi(0,4)=eta*(13.5*eta-4.5);
151 adNdXi(1,4)=xi*(27.0*eta-4.5);
152
153 adNdXi(0,5)=(4.5-13.5*eta)*eta;
154 adNdXi(1,5)=eta*(36.0-40.5*eta-27.0*xi)+4.5*xi-4.5;
155
156 adNdXi(0,6)=eta*(27.0*(eta+xi)-22.5);
157 adNdXi(1,6)=9.0+eta*(40.5*eta+54.0*xi-45.0)+xi*(13.5*xi-22.5);
158
159 adNdXi(0,7)=xi*(40.5*xi-45.0)+eta*(13.5*eta+54.0*xi-22.5)+9.0;
160 adNdXi(1,7)=xi*(27.0*(xi+eta)-22.5);
161
162 adNdXi(0,8)=(36.0-40.5*xi)*xi+eta*(4.5-27.0*xi)-4.5;
163 adNdXi(1,8)=(4.5-13.5*xi)*xi;
164
165 adNdXi(0,9)=27.0*eta*(1.0-eta-2.0*xi);
166 adNdXi(1,9)=27.0*xi*(1.0-2.0*eta-xi);
167 }
168
169//------------------------------------------------------------------------------
170
171 template<>
172 void
175 const Vector< real > & aXi,
176 Matrix< real > & ad2NdXi2 ) const
177 {
178 const real xi = aXi( 0 );
179 const real eta = aXi( 1 );
180
181 ad2NdXi2.set_size( 3, 10 );
182
183 ad2NdXi2(0,0)=27.0*xi-9.0;
184 ad2NdXi2(1,0)=0.0;
185 ad2NdXi2(2,0)=0.0;
186
187 ad2NdXi2(0,1)=0.0;
188 ad2NdXi2(1,1)=27.0*eta-9.0;
189 ad2NdXi2(2,1)=0.0;
190
191 ad2NdXi2(0,2)=18.0-27.0*(xi+eta);
192 ad2NdXi2(1,2)=18.0-27.0*(xi+eta);
193 ad2NdXi2(2,2)=18.0-27.0*(xi+eta);
194
195 ad2NdXi2(0,3)=27.0*eta;
196 ad2NdXi2(1,3)=0.0;
197 ad2NdXi2(2,3)=27.0*xi-4.5;
198
199 ad2NdXi2(0,4)=0.0;
200 ad2NdXi2(1,4)=27.0*xi;
201 ad2NdXi2(2,4)=27.0*eta-4.5;
202
203 ad2NdXi2(0,5)=0.0;
204 ad2NdXi2(1,5)=36.0-81.0*eta-27.0*xi;
205 ad2NdXi2(2,5)=4.5-27.0*eta;
206
207 ad2NdXi2(0,6)=27.0*eta;
208 ad2NdXi2(1,6)=54.0*xi+81.0*eta-45.0;
209 ad2NdXi2(2,6)=27.0*xi+54.0*eta-22.5;
210
211 ad2NdXi2(0,7)=81.0*xi+54.0*eta-45.0;
212 ad2NdXi2(1,7)=27.0*xi;
213 ad2NdXi2(2,7)=54.0*xi+27.0*eta-22.5;
214
215 ad2NdXi2(0,8)=36.-27.0*eta-81.0*xi;
216 ad2NdXi2(1,8)=0.0;
217 ad2NdXi2(2,8)=4.5-27.0*xi;
218
219 ad2NdXi2(0,9)=-54.0*eta;
220 ad2NdXi2(1,9)=-54.0*xi;
221 ad2NdXi2(2,9)=27.0*(1.0-2.0*(xi+eta));
222 }
223
224//------------------------------------------------------------------------------
225 }
226}
227
228#endif //BELFEM_CL_IF_TRI10_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
USER GUIDES:
Definition cl_Capacitor.cpp:16
@ LAGRANGE
Definition Mesh_Enums.hpp:100
ElementType element_type(const std::string &aStr)
Definition Mesh_Enums.hpp:370
ElementType
Element types.
Definition Mesh_Enums.hpp:27
@ TRI10
Definition Mesh_Enums.hpp:48
InterpolationOrder
Definition Mesh_Enums.hpp:85
@ CUBIC
Definition Mesh_Enums.hpp:90
double real
Definition typedefs.hpp:36
@ TRI
Definition Mesh_Enums.hpp:73