BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IFG_TRI6C.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_TRI6C_HPP
13#define BELFEM_CL_IFG_TRI6C_HPP
14
16
17namespace belfem
18{
19 namespace fem
20 {
21//------------------------------------------------------------------------------
22
23
30
31//------------------------------------------------------------------------------
32
33 template<>
41
42//------------------------------------------------------------------------------
43
44 template<>
49 {
50 return ElementType::TRI6;
51 }
52
53//------------------------------------------------------------------------------
54
55
56 template<>
57 void
60 ::param_coords( Matrix <real> & aXiHat ) const
61 {
62 aXiHat.set_size( 2, 2 );
63
64 aXiHat( 0, 0 ) = 0.25 ;
65 aXiHat( 0, 1 ) = 0.00 ;
66
67 aXiHat( 1, 0 ) = 0.75 ;
68 aXiHat( 1, 1 ) = 0.00 ;
69 }
70
71//------------------------------------------------------------------------------
72
73 template<>
74 void
77 const Vector <real> & aXi,
78 Matrix <real> & aN ) const
79 {
80 const real xi = aXi( 0 );
81 const real eta = aXi( 1 );
82 const real zeta = 1. - xi - eta ;
83
84 aN.set_size( 1, 2 );
85 aN( 0, 0 ) = 32./3 * xi * zeta * ( zeta*zeta - xi * xi );
86 aN( 0, 1 ) = -aN( 0, 0 );
87 }
88
89
90//------------------------------------------------------------------------------
91
92 template<>
93 void
96 const Vector <real> & aXi,
97 Matrix <real> & adNdXi ) const
98 {
99 const real xi = aXi( 0 );
100 const real eta = aXi( 1 );
101 const real zeta = 1. - xi - eta ;
102
103 real K = 32./3. ;
104
105 real xi2 = xi*xi ;
106 real zeta2 = zeta * zeta ;
107
108 adNdXi.set_size( 2, 2 );
109 adNdXi( 0, 0 ) = K*((zeta2 - xi2)*(zeta-xi) + 2.*xi*zeta*(eta-1.) ); // dN1/dxi
110 adNdXi( 0, 1 ) = K*(xi*(xi2-3.*zeta2)); // dN1/deta
111
112 adNdXi( 1, 0 ) = -adNdXi( 0, 0 );
113 adNdXi( 1, 1 ) = -adNdXi( 0, 1 );
114 }
115
116//------------------------------------------------------------------------------
117
118
119 template<>
120 void
123 const Vector <real> & aXi,
124 Matrix <real> & ad2NdXi2 ) const
125 {
126 const real xi = aXi( 0 );
127 const real eta = aXi( 1 );
128 const real zeta = 1. - xi - eta ;
129
130 ad2NdXi2.set_size( 3, 2 );
131
132 // d²N1/dxi²
133 ad2NdXi2( 0, 0 ) = 64./3.*((xi-zeta)*(xi+zeta + 2.*(zeta + xi)) ) ;
134
135 // d²N1/deta²
136 ad2NdXi2( 1, 0 ) = 64.*xi*zeta;
137
138 // d²N1/(dxi*deta)
139 ad2NdXi2( 2, 0 ) = (32./3.)*( (xi-zeta)*(3.*zeta-xi) + 2.*xi*( 2. * xi + zeta));
140
141 ad2NdXi2( 0, 1 ) = -ad2NdXi2( 0, 0 ) ;
142 ad2NdXi2( 1, 1 ) = -ad2NdXi2( 1, 0 ) ;
143 ad2NdXi2( 2, 1 ) = -ad2NdXi2( 2, 0 ) ;
144
145 }
146
147//------------------------------------------------------------------------------
148 }
149}
150#endif //BELFEM_CL_IFG_TRI6A_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
@ BubbleEdge2
Definition Mesh_Enums.hpp:105
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
@ CUBIC
Definition Mesh_Enums.hpp:90
double real
Definition typedefs.hpp:36
@ TRI
Definition Mesh_Enums.hpp:73