BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IF_PYRA5.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_PYRA5_HPP
13#define BELFEM_CL_IF_PYRA5_HPP
14
15
17
18namespace belfem
19{
20 namespace fem
21 {
22//------------------------------------------------------------------------------
23
24 template<>
32
33//------------------------------------------------------------------------------
34
35 template<>
40 {
41 return ElementType::PYRA5;
42 }
43
44//------------------------------------------------------------------------------
45
46 template<>
47 void
51 {
52 aXiHat.set_size( 3, 5 );
53
54 aXiHat( 0, 0 ) = -1.0;
55 aXiHat( 1, 0 ) = -1.0;
56 aXiHat( 2, 0 ) = 0.0;
57
58 aXiHat( 0, 1 ) = 1.0;
59 aXiHat( 1, 1 ) = -1.0;
60 aXiHat( 2, 1 ) = 0.0;
61
62 aXiHat( 0, 2 ) = 1.0;
63 aXiHat( 1, 2 ) = 1.0;
64 aXiHat( 2, 2 ) = 0.0;
65
66 aXiHat( 0, 3 ) = -1.0;
67 aXiHat( 1, 3 ) = 1.0;
68 aXiHat( 2, 3 ) = 0.0;
69
70 aXiHat( 0, 4 ) = 0.0;
71 aXiHat( 1, 4 ) = 0.0;
72 aXiHat( 2, 4 ) = 1.0;
73 }
74
75//------------------------------------------------------------------------------
76
77 template<>
78 void
82 const Vector< real > & aXi,
83 Matrix< real > & aN ) const
84 {
85 const real xi = aXi( 0 );
86 const real eta = aXi( 1 );
87 const real zeta = aXi( 2 );
88 real xieta = xi*eta ;
89 real tau = 1.0 - zeta ;
90
91 aN.set_size( 1, 5 );
92
93 aN( 0, 0 ) = 0.25 * ( tau + xieta - xi - eta );
94 aN( 0, 1 ) = 0.25 * ( tau - xieta + xi - eta );
95 aN( 0, 2 ) = 0.25 * ( tau + xieta + xi + eta );
96 aN( 0, 3 ) = 0.25 * ( tau - xieta - xi + eta );
97 aN( 0, 4 ) = zeta ;
98 }
99
100//------------------------------------------------------------------------------
101
102 template<>
103 void
107 const Vector< real > & aXi,
108 Matrix< real > & adNdXi ) const
109 {
110 const real xi = aXi( 0 );
111 const real eta = aXi( 1 );
112
113 adNdXi.set_size( 3, 5 );
114
115 adNdXi( 0, 0 ) = 0.25*eta - 0.25;
116 adNdXi( 1, 0 ) = 0.25*xi - 0.25 ;
117 adNdXi( 2, 0 ) = -0.25 ;
118
119 adNdXi( 0, 1 ) = 0.25 - 0.25*eta ;
120 adNdXi( 1, 1 ) = -0.25*xi - 0.25 ;
121 adNdXi( 2, 1 ) = -0.25 ;
122
123 adNdXi( 0, 2 ) = 0.25*eta + 0.25 ;
124 adNdXi( 1, 2 ) = 0.25*xi + 0.250 ;
125 adNdXi( 2, 2 ) = -0.25 ;
126
127 adNdXi( 0, 3 ) = -0.25*eta - 0.25 ;
128 adNdXi( 1, 3 ) = 0.25 - 0.25*xi ;
129 adNdXi( 2, 3 ) = -0.25 ;
130
131 adNdXi( 0, 4 ) = 0.0 ;
132 adNdXi( 1, 4 ) = 0.0 ;
133 adNdXi( 2, 4 ) = 1.0 ;
134 }
135
136//------------------------------------------------------------------------------
137
138 template<>
139 void
142 const Vector< real > & aXi,
143 Matrix< real > & ad2NdXi2 ) const
144 {
145 // xi2 eta2 zeta2 eta*zeta xi*zeta xi*eta
146
147 ad2NdXi2.set_size( 6, 5, 0.0 );
148
149 ad2NdXi2( 5, 0 ) = 0.25 ;
150 ad2NdXi2( 5, 1 ) = -0.25 ;
151 ad2NdXi2( 5, 2 ) = 0.25 ;
152 ad2NdXi2( 5, 3 ) = -0.25 ;
153 }
154
155//------------------------------------------------------------------------------
156 }
157}
158
159
160#endif //BELFEM_CL_IF_PYRA5_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
@ PYRA5
Definition Mesh_Enums.hpp:35
InterpolationOrder
Definition Mesh_Enums.hpp:85
@ LINEAR
Definition Mesh_Enums.hpp:87
double real
Definition typedefs.hpp:36
@ PYRA
Definition Mesh_Enums.hpp:78