BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IFB_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_IFB_TRI6_HPP
13#define BELFEM_CL_IFB_TRI6_HPP
14
15
17
18namespace belfem
19{
20 namespace fem
21 {
22//------------------------------------------------------------------------------
23
24 template<>
32
33//------------------------------------------------------------------------------
34
35 template<>
40 {
41 return ElementType::TRI6;
42 }
43
44//------------------------------------------------------------------------------
45
46 template<>
47 void
51 {
52 aXiHat.set_size( 2, 6 );
53
54 aXiHat( 0, 0 ) = 1.0;
55 aXiHat( 1, 0 ) = 0.0;
56
57 aXiHat( 0, 1 ) = 0.0;
58 aXiHat( 1, 1 ) = 1.0;
59
60 aXiHat( 0, 2 ) = 0.0;
61 aXiHat( 1, 2 ) = 0.0;
62
63 aXiHat( 0, 3 ) = 0.5;
64 aXiHat( 1, 3 ) = 0.5;
65
66 aXiHat( 0, 4 ) = 0.0;
67 aXiHat( 1, 4 ) = 0.5;
68
69 aXiHat( 0, 5 ) = 0.5;
70 aXiHat( 1, 5 ) = 0.0;
71 }
72
73//------------------------------------------------------------------------------
74
75 template<>
76 void
79 const Vector< real > & aXi,
80 Matrix< real > & aN ) const
81 {
82 const real xi = aXi( 0 );
83 const real eta = aXi( 1 );
84 const real zeta = 1. - xi - eta ;
85
86 aN.set_size( 1, 6 );
87
88 aN( 0, 0 ) = xi*xi ;
89 aN( 0, 1 ) = eta*eta ;
90 aN( 0, 2 ) = zeta*zeta ;
91 aN( 0, 3 ) = 2. * eta * xi ;
92 aN( 0, 4 ) = 2. * eta * zeta ;
93 aN( 0, 5 ) = 2. * xi * zeta ;
94 }
95
96//------------------------------------------------------------------------------
97
98 template<>
99 void
102 const Vector< real > & aXi,
103 Matrix< real > & adNdXi ) const
104 {
105 const real xi = aXi( 0 );
106 const real eta = aXi( 1 );
107 const real zeta = 1. - xi - eta ;
108
109 adNdXi.set_size( 2, 6 );
110
111 adNdXi( 0, 0 ) = xi + xi ;
112 adNdXi( 1, 0 ) = 0 ;
113
114 adNdXi( 0, 1 ) = 0 ;
115 adNdXi( 1, 1 ) = eta + eta ;
116
117 adNdXi( 0, 2 ) = - zeta - zeta ;
118 adNdXi( 1, 2 ) = - zeta - zeta ;
119
120 adNdXi( 0, 3 ) = eta + eta ;
121 adNdXi( 1, 3 ) = xi + xi ;
122
123 adNdXi( 0, 4 ) = - eta - eta ;
124 adNdXi( 1, 4 ) = 2.-xi-xi-eta-eta-eta-eta;
125
126 adNdXi( 0, 5 ) = 2.-xi-xi-xi-xi-eta-eta;
127 adNdXi( 1, 5 ) = -xi - xi ;
128
129 }
130
131//------------------------------------------------------------------------------
132
133 template<>
134 void
137 const Vector< real > & aXi,
138 Matrix< real > & ad2NdXi2 ) const
139 {
140 ad2NdXi2.set_size( 3, 6 );
141
142 ad2NdXi2( 0, 0 ) = 2. ;
143 ad2NdXi2( 1, 0 ) = 0. ;
144 ad2NdXi2( 2, 0 ) = 0. ;
145
146 ad2NdXi2( 0, 1 ) = 0. ;
147 ad2NdXi2( 1, 1 ) = 2. ;
148 ad2NdXi2( 2, 1 ) = 0. ;
149
150 ad2NdXi2( 0, 2 ) = 2. ;
151 ad2NdXi2( 1, 2 ) = 2. ;
152 ad2NdXi2( 2, 2 ) = 2. ;
153
154 ad2NdXi2( 0, 3 ) = 0. ;
155 ad2NdXi2( 1, 3 ) = 0. ;
156 ad2NdXi2( 2, 3 ) = 2. ;
157
158 ad2NdXi2( 0, 4 ) = 0. ;
159 ad2NdXi2( 1, 4 ) = -4. ;
160 ad2NdXi2( 2, 4 ) = -2. ;
161
162 ad2NdXi2( 0, 5 ) = -4. ;
163 ad2NdXi2( 1, 5 ) = 0. ;
164 ad2NdXi2( 2, 5 ) = -2. ;
165 }
166
167//------------------------------------------------------------------------------
168 }
169}
170
171#endif //BELFEM_CL_IFB_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
@ BERNSTEIN
Definition Mesh_Enums.hpp:102
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