BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IF_TRI6.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_TRI6_HPP
13#define BELFEM_CL_IF_TRI6_HPP
14
15
17
18namespace belfem
19{
20 namespace fem
21 {
22//------------------------------------------------------------------------------
23
34
35//------------------------------------------------------------------------------
36
37 template<>
45
46//------------------------------------------------------------------------------
47
48 template<>
53 {
54 return ElementType::TRI6;
55 }
56
57//------------------------------------------------------------------------------
58
59 template<>
60 void
64 {
65 aXiHat.set_size( 2, 6 );
66
67 aXiHat( 0, 0 ) = 1.0;
68 aXiHat( 1, 0 ) = 0.0;
69
70 aXiHat( 0, 1 ) = 0.0;
71 aXiHat( 1, 1 ) = 1.0;
72
73 aXiHat( 0, 2 ) = 0.0;
74 aXiHat( 1, 2 ) = 0.0;
75
76 aXiHat( 0, 3 ) = 0.5;
77 aXiHat( 1, 3 ) = 0.5;
78
79 aXiHat( 0, 4 ) = 0.0;
80 aXiHat( 1, 4 ) = 0.5;
81
82 aXiHat( 0, 5 ) = 0.5;
83 aXiHat( 1, 5 ) = 0.0;
84 }
85
86//------------------------------------------------------------------------------
87
88 template<>
89 void
92 const Vector< real > & aXi,
93 Matrix< real > & aN ) const
94 {
95 const real xi = aXi( 0 );
96 const real eta = aXi( 1 );
97 const real zeta = 1.0 - xi - eta ;
98
99 aN.set_size( 1, 6 );
100
101 aN( 0, 0 ) = xi * ( 2.0 * xi - 1.0 );
102 aN( 0, 1 ) = eta * ( 2.0 * eta - 1.0 );
103 aN( 0, 2 ) = zeta * ( 2.0 * zeta - 1.0 );
104 aN( 0, 3 ) = 4.0 * xi * eta;
105 aN( 0, 4 ) = 4.0 * eta * zeta ;
106 aN( 0, 5 ) = 4.0 * xi * zeta;
107 }
108
109//------------------------------------------------------------------------------
110
111 template<>
112 void
115 const Vector< real > & aXi,
116 Matrix< real > & adNdXi ) const
117 {
118 const real xi = aXi( 0 );
119 const real eta = aXi( 1 );
120 const real zeta = 1.0 - xi - eta ;
121
122 adNdXi.set_size( 2, 6 );
123
124
125 adNdXi( 0, 0 ) = xi * 4.0 - 1.0; // dN1/dxi
126 adNdXi( 1, 0 ) = 0.0; // dN1/deta
127
128
129 adNdXi( 0, 1 ) = 0.0; // dN2/dxi
130 adNdXi( 1, 1 ) = eta * 4.0 - 1.0; // dN2/deta
131
132 adNdXi( 0, 2 ) = 4.0 * ( xi + eta ) - 3.0; // dN3/dxi
133 adNdXi( 1, 2 ) = 4.0 * ( xi + eta ) - 3.0; // dN3/deta
134
135 adNdXi( 0, 3 ) = 4.0 * eta; // dN4/dxi
136 adNdXi( 1, 3 ) = 4.0 * xi; // dN4/deta
137
138 adNdXi( 0, 4 ) = - 4.0 * eta; // dN5/dxi
139 adNdXi( 1, 4 ) = 4.0 * ( zeta - eta ); // dN5/deta
140
141 adNdXi( 0, 5 ) = 4.0 * ( zeta - xi ); // dN6/dxi
142 adNdXi( 1, 5 ) = - 4.0 * xi; // dN6/deta
143
144 }
145
146//------------------------------------------------------------------------------
147
148 template<>
149 void
152 const Vector< real > & aXi,
153 Matrix< real > & ad2NdXi2 ) const
154 {
155 ad2NdXi2.set_size( 3, 6 );
156
157 ad2NdXi2( 0, 0 ) = 4.0; // d²N1/dxi²
158 ad2NdXi2( 1, 0 ) = 0.0; // d²N1/deta²
159 ad2NdXi2( 2, 0 ) = 0.0; // d²N1/(dxi*deta)
160
161 ad2NdXi2( 0, 1 ) = 0.0; // d²N2/dxi²
162 ad2NdXi2( 1, 1 ) = 4.0; // d²N2/deta²
163 ad2NdXi2( 2, 1 ) = 0.0; // d²N2/(dxi*deta)
164
165 ad2NdXi2( 0, 2 ) = 4.0; // d²N3/dxi²
166 ad2NdXi2( 1, 2 ) = 4.0; // d²N3/deta²
167 ad2NdXi2( 2, 2 ) = 4.0; // d²N3/(dxi*deta)
168
169 ad2NdXi2( 0, 3 ) = 0.0; // d²N4/dxi²
170 ad2NdXi2( 1, 3 ) = 0.0; // d²N4/deta²
171 ad2NdXi2( 2, 3 ) = 4.0; // d²N4/(dxi*deta)
172
173 ad2NdXi2( 0, 4 ) = 0.0; // d²N5/dxi²
174 ad2NdXi2( 1, 4 ) = -8.0; // d²N5/deta²
175 ad2NdXi2( 2, 4 ) = -4.0; // d²N5/(dxi*deta)
176
177 ad2NdXi2( 0, 5 ) = -8.0; // d²N6/dxi²
178 ad2NdXi2( 1, 5 ) = 0.0; // d²N6/deta²
179 ad2NdXi2( 2, 5 ) = -4.0; // d²N6/(dxi*deta)
180 }
181
182//------------------------------------------------------------------------------
183 }
184}
185
186#endif //BELFEM_CL_IF_TRI6_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
@ TRI6
Definition Mesh_Enums.hpp:37
InterpolationOrder
Definition Mesh_Enums.hpp:85
@ QUADRATIC
Definition Mesh_Enums.hpp:88
double real
Definition typedefs.hpp:36
@ TRI
Definition Mesh_Enums.hpp:73