BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
cl_IFG_TET4B.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_TET4B_HPP
13
#define BELFEM_CL_IFG_TET4B_HPP
14
15
#include "
cl_IF_InterpolationFunctionTemplate.hpp
"
16
17
namespace
belfem
18
{
19
namespace
fem
20
{
21
//------------------------------------------------------------------------------
22
28
29
//------------------------------------------------------------------------------
30
31
template
<>
32
InterpolationOrder
33
InterpolationFunctionTemplate
<
34
GeometryType::TET
,
InterpolationType::BubbleFace1
, 3, 1 >
35
::interpolation_order
()
const
36
{
37
return
InterpolationOrder::QUADRATIC
;
38
}
39
40
//------------------------------------------------------------------------------
41
42
template
<>
43
ElementType
44
InterpolationFunctionTemplate
<
45
GeometryType::TET
,
InterpolationType::BubbleFace1
, 3, 1 >
46
::element_type
()
const
47
{
48
return
ElementType::TET4
;
49
}
50
51
//------------------------------------------------------------------------------
52
53
54
template
<>
55
void
56
InterpolationFunctionTemplate
<
57
GeometryType::TET
,
InterpolationType::BubbleFace1
, 3, 1 >
58
::param_coords
( Matrix <real> & aXiHat )
const
59
{
60
aXiHat.
set_size
( 1, 3 );
61
62
aXiHat( 0, 0 ) = 0.0 ;
63
aXiHat( 0, 1 ) = 1./3. ;
64
aXiHat( 0, 2 ) = 1./3. ;
65
66
}
67
68
//------------------------------------------------------------------------------
69
70
template
<>
71
void
72
InterpolationFunctionTemplate
<
73
GeometryType::TET
,
InterpolationType::BubbleFace1
, 3, 1 >
::N
(
74
const
Vector <real> & aXi,
75
Matrix <real> & aN )
const
76
{
77
const
real
eta = aXi( 1 );
78
const
real
zeta = aXi( 2 );
79
80
aN.
set_size
( 1, 1 );
81
aN( 0, 0 ) = 27.*eta*zeta*(1.-eta-zeta) ;
82
}
83
84
85
//------------------------------------------------------------------------------
86
87
template
<>
88
void
89
InterpolationFunctionTemplate
<
90
GeometryType::TET
,
InterpolationType::BubbleFace1
, 3, 1 >
::dNdXi
(
91
const
Vector <real> & aXi,
92
Matrix <real> & adNdXi )
const
93
{
94
const
real
eta = aXi( 1 );
95
const
real
zeta = aXi( 2 );
96
97
adNdXi.
set_size
( 3, 1 );
98
adNdXi( 0, 0 ) = 0.0 ;
// dN/dxi
99
adNdXi( 1, 0 ) = 27. * zeta * ( 1. - 2.*eta - zeta) ;
// dN/deta
100
adNdXi( 2, 0 ) = 27. * eta * ( 1. - eta - 2.*zeta );
// dN/dzeta
101
}
102
103
//------------------------------------------------------------------------------
104
105
106
template
<>
107
void
108
InterpolationFunctionTemplate
<
109
GeometryType::TET
,
InterpolationType::BubbleFace1
, 3, 1 >
::d2NdXi2
(
110
const
Vector <real> & aXi,
111
Matrix <real> & ad2NdXi2 )
const
112
{
113
const
real
eta = aXi( 1 );
114
const
real
zeta = aXi( 2 );
115
116
ad2NdXi2.
set_size
( 6,1 );
117
118
// d²N/dxi²
119
ad2NdXi2( 0, 0 ) = 0.0 ;
120
121
// d²N/deta²
122
ad2NdXi2( 1, 0 ) = -54. * zeta ;
123
124
// d²N/dzeta²
125
ad2NdXi2( 2, 0 ) = -54. * eta ;
126
127
// d²N/(deta*dzeta)
128
ad2NdXi2( 3, 0 ) = 27. - 54. * ( eta + zeta );
129
130
// d²N/(dxi*dzeta)
131
ad2NdXi2( 4, 0 ) = 0.0 ;
132
133
// d²N/(dxi*deta)
134
ad2NdXi2( 5, 0 ) = 0.0 ;
135
136
}
137
138
//------------------------------------------------------------------------------
139
}
140
}
141
#endif
//BELFEM_CL_IFG_TET4B_HPP
cl_IF_InterpolationFunctionTemplate.hpp
belfem::Matrix::set_size
void set_size(const size_t aNumRows, const size_t aNumCols)
Definition
cl_AR_Matrix.hpp:186
belfem::fem::InterpolationFunctionTemplate
shape function templated class G : Geometry T : Type D : Dimension B : Number of Basis
Definition
cl_IF_InterpolationFunctionTemplate.hpp:25
belfem::fem::InterpolationFunctionTemplate::param_coords
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
belfem::fem::InterpolationFunctionTemplate::interpolation_order
InterpolationOrder interpolation_order() const override
returns the interpolation order
Definition
cl_IF_InterpolationFunctionTemplate.hpp:145
belfem::fem::InterpolationFunctionTemplate::d2NdXi2
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
belfem::fem::InterpolationFunctionTemplate::dNdXi
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
belfem::fem::InterpolationFunctionTemplate::N
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
belfem::fem
Definition
cl_IFB_LINE3.hpp:21
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
belfem::InterpolationType::BubbleFace1
@ BubbleFace1
Definition
Mesh_Enums.hpp:107
belfem::element_type
ElementType element_type(const std::string &aStr)
Definition
Mesh_Enums.hpp:370
belfem::ElementType
ElementType
Element types.
Definition
Mesh_Enums.hpp:27
belfem::ElementType::TET4
@ TET4
Definition
Mesh_Enums.hpp:32
belfem::InterpolationOrder
InterpolationOrder
Definition
Mesh_Enums.hpp:85
belfem::InterpolationOrder::QUADRATIC
@ QUADRATIC
Definition
Mesh_Enums.hpp:88
belfem::real
double real
Definition
typedefs.hpp:36
belfem::GeometryType::TET
@ TET
Definition
Mesh_Enums.hpp:75
src
fem
interpolation
bubble
cl_IFG_TET4B.hpp
Generated by
1.18.0