BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IF_PENTA6.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_PENTA6_HPP
13#define BELFEM_CL_IF_PENTA6_HPP
14
16
17namespace belfem
18{
19 namespace fem
20 {
21//------------------------------------------------------------------------------
22
23 template<>
31
32//------------------------------------------------------------------------------
33
34 template<>
39 {
41 }
42
43//------------------------------------------------------------------------------
44
45 template<>
46 void
50 {
51 aXiHat.set_size( 3, 6 );
52
53 aXiHat( 0, 0 ) = 1.0;
54 aXiHat( 1, 0 ) = 0.0;
55 aXiHat( 2, 0 ) = -1.0;
56
57 aXiHat( 0, 1 ) = 0.0;
58 aXiHat( 1, 1 ) = 1.0;
59 aXiHat( 2, 1 ) = -1.0;
60
61 aXiHat( 0, 2 ) = 0.0;
62 aXiHat( 1, 2 ) = 0.0;
63 aXiHat( 2, 2 ) = -1.0;
64
65 aXiHat( 0, 3 ) = 1.0;
66 aXiHat( 1, 3 ) = 0.0;
67 aXiHat( 2, 3 ) = 1.0;
68
69 aXiHat( 0, 4 ) = 0.0;
70 aXiHat( 1, 4 ) = 1.0;
71 aXiHat( 2, 4 ) = 1.0;
72
73 aXiHat( 0, 5 ) = 0.0;
74 aXiHat( 1, 5 ) = 0.0;
75 aXiHat( 2, 5 ) = 1.0;
76 }
77//------------------------------------------------------------------------------
78
79 template<>
80 void
83 const Vector< real > & aXi,
84 Matrix< real > & aN ) const
85 {
86 const real xi = aXi( 0 );
87 const real eta = aXi( 1 );
88 const real zeta = aXi( 2 );
89
90 aN.set_size( 1, 6 );
91 aN( 0, 0 ) = -(xi*(zeta-1.0))*0.5;
92 aN( 0, 1 ) = -(eta*(zeta-1.0))*0.5;
93 aN( 0, 2 ) = ((zeta-1.0)*(eta+xi-1.0))*0.5;
94 aN( 0, 3 ) = (xi*(zeta + 1.0))*0.5;
95 aN( 0, 4 ) = (eta*(zeta + 1.0))*0.5;
96 aN( 0, 5 ) = ((zeta+1.0)*(1.0-xi-eta))*0.5;
97 }
98
99//------------------------------------------------------------------------------
100
101 template<>
102 void
105 const Vector< real > & aXi,
106 Matrix< real > & adNdXi ) const
107 {
108 const real xi = aXi( 0 );
109 const real eta = aXi( 1 );
110 const real zeta = aXi( 2 );
111
112 adNdXi.set_size( 3, 6 );
113
114 adNdXi( 0, 0 ) = 0.5*(1.0-zeta);
115 adNdXi( 1, 0 ) = 0.0;
116 adNdXi( 2, 0 ) = -0.5*xi;
117
118 adNdXi( 0, 1 ) = 0.0;
119 adNdXi( 1, 1 ) = 0.5*(1.0-zeta);
120 adNdXi( 2, 1 ) = -0.5*eta;
121
122 adNdXi( 0, 2 ) = 0.5*(zeta-1.0);
123 adNdXi( 1, 2 ) = 0.5*(zeta-1.0);
124 adNdXi( 2, 2 ) = 0.5*(xi+eta-1.0);
125
126 adNdXi( 0, 3 ) = 0.5*(zeta+1);
127 adNdXi( 1, 3 ) = 0.0;
128 adNdXi( 2, 3 ) = 0.5*xi;
129
130 adNdXi( 0, 4 ) = 0.0;
131 adNdXi( 1, 4 ) = 0.5*(zeta+1.0);
132 adNdXi( 2, 4 ) = 0.5*eta;
133
134 adNdXi( 0, 5 ) = -0.5*(zeta+1.0);
135 adNdXi( 1, 5 ) = -0.5*(zeta+1.0);
136 adNdXi( 2, 5 ) = 0.5*(1.0-xi-eta);
137 }
138
139//------------------------------------------------------------------------------
140
141 template<>
142 void
145 const Vector< real > & aXi,
146 Matrix< real > & ad2NdXi2 ) const
147 {
148 ad2NdXi2.set_size( 6, 6 );
149
150 ad2NdXi2( 0, 0 ) = 0.0;
151 ad2NdXi2( 1, 0 ) = 0.0;
152 ad2NdXi2( 2, 0 ) = 0.0;
153 ad2NdXi2( 3, 0 ) = 0.0;
154 ad2NdXi2( 4, 0 ) = -0.5;
155 ad2NdXi2( 5, 0 ) = 0.0;
156
157 ad2NdXi2( 0, 1 ) = 0.0;
158 ad2NdXi2( 1, 1 ) = 0.0;
159 ad2NdXi2( 2, 1 ) = 0.0;
160 ad2NdXi2( 3, 1 ) = -0.5;
161 ad2NdXi2( 4, 1 ) = 0.0;
162 ad2NdXi2( 5, 1 ) = 0.0;
163
164 ad2NdXi2( 0, 2 ) = 0.0;
165 ad2NdXi2( 1, 2 ) = 0.0;
166 ad2NdXi2( 2, 2 ) = 0.0;
167 ad2NdXi2( 3, 2 ) = 0.5;
168 ad2NdXi2( 4, 2 ) = 0.5;
169 ad2NdXi2( 5, 2 ) = 0.0;
170
171 ad2NdXi2( 0, 3 ) = 0.0;
172 ad2NdXi2( 1, 3 ) = 0.0;
173 ad2NdXi2( 2, 3 ) = 0.0;
174 ad2NdXi2( 3, 3 ) = 0.0;
175 ad2NdXi2( 4, 3 ) = 0.5;
176 ad2NdXi2( 5, 3 ) = 0.0;
177
178 ad2NdXi2( 0, 4 ) = 0.0;
179 ad2NdXi2( 1, 4 ) = 0.0;
180 ad2NdXi2( 2, 4 ) = 0.0;
181 ad2NdXi2( 3, 4 ) = 0.5;
182 ad2NdXi2( 4, 4 ) = 0.0;
183 ad2NdXi2( 5, 4 ) = 0.0;
184
185 ad2NdXi2( 0, 5 ) = 0.0;
186 ad2NdXi2( 1, 5 ) = 0.0;
187 ad2NdXi2( 2, 5 ) = 0.0;
188 ad2NdXi2( 3, 5 ) = -0.5;
189 ad2NdXi2( 4, 5 ) = -0.5;
190 ad2NdXi2( 5, 5 ) = 0.0;
191 }
192
193//------------------------------------------------------------------------------
194 }
195}
196
197#endif //BELFEM_CL_IF_PENTA6_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
@ PENTA6
Definition Mesh_Enums.hpp:34
InterpolationOrder
Definition Mesh_Enums.hpp:85
@ LINEAR
Definition Mesh_Enums.hpp:87
double real
Definition typedefs.hpp:36
@ PENTA
Definition Mesh_Enums.hpp:77