BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
cl_IF_TET4.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_TET4_HPP
13
#define BELFEM_CL_IF_TET4_HPP
14
15
16
#include "
cl_IF_InterpolationFunctionTemplate.hpp
"
17
18
namespace
belfem
19
{
20
namespace
fem
21
{
22
23
//------------------------------------------------------------------------------
24
33
34
//------------------------------------------------------------------------------
35
36
template
<>
37
InterpolationOrder
38
InterpolationFunctionTemplate
<
39
GeometryType::TET
,
InterpolationType::LAGRANGE
, 3, 4 >
40
::interpolation_order
()
const
41
{
42
return
InterpolationOrder::LINEAR
;
43
}
44
45
//------------------------------------------------------------------------------
46
47
template
<>
48
ElementType
49
InterpolationFunctionTemplate
<
50
GeometryType::TET
,
InterpolationType::LAGRANGE
, 3, 4 >
51
::element_type
()
const
52
{
53
return
ElementType::TET4
;
54
}
55
56
//------------------------------------------------------------------------------
57
58
template
<>
59
void
60
InterpolationFunctionTemplate
<
61
GeometryType::TET
,
InterpolationType::LAGRANGE
, 3, 4 >
62
::param_coords
(
Matrix< real >
& aXiHat )
const
63
{
64
aXiHat.
set_size
( 3, 4 );
65
66
aXiHat( 0, 0 ) = 1.0;
67
aXiHat( 1, 0 ) = 0.0;
68
aXiHat( 2, 0 ) = 0.0;
69
70
aXiHat( 0, 1 ) = 0.0;
71
aXiHat( 1, 1 ) = 0.0;
72
aXiHat( 2, 1 ) = 1.0;
73
74
aXiHat( 0, 2 ) = 0.0;
75
aXiHat( 1, 2 ) = 1.0;
76
aXiHat( 2, 2 ) = 0.0;
77
78
aXiHat( 0, 3 ) = 0.0;
79
aXiHat( 1, 3 ) = 0.0;
80
aXiHat( 2, 3 ) = 0.0;
81
}
82
83
//------------------------------------------------------------------------------
84
85
template
<>
86
void
87
InterpolationFunctionTemplate
<
88
GeometryType::TET
,
InterpolationType::LAGRANGE
, 3, 4 >
::N
(
89
const
Vector< real >
& aXi,
90
Matrix< real >
& aN )
const
91
{
92
const
real
xi = aXi( 0 );
93
const
real
eta = aXi( 1 );
94
const
real
zeta = aXi( 2 );
95
96
aN.
set_size
( 1, 4 );
97
98
aN( 0, 0 ) = xi;
99
aN( 0, 1 ) = zeta;
100
aN( 0, 2 ) = eta;
101
aN( 0, 3 ) = 1.0 - xi - eta - zeta;
102
}
103
104
//------------------------------------------------------------------------------
105
106
template
<>
107
void
108
InterpolationFunctionTemplate
<
109
GeometryType::TET
,
InterpolationType::LAGRANGE
, 3, 4 >
::dNdXi
(
110
const
Vector< real >
& aXi,
111
Matrix< real >
& adNdXi )
const
112
{
113
adNdXi.
set_size
( 3, 4 );
114
115
adNdXi( 0, 0 ) = 1.0;
116
adNdXi( 1, 0 ) = 0.0;
117
adNdXi( 2, 0 ) = 0.0;
118
119
adNdXi( 0, 1 ) = 0.0;
120
adNdXi( 1, 1 ) = 0.0;
121
adNdXi( 2, 1 ) = 1.0;
122
123
adNdXi( 0, 2 ) = 0.0;
124
adNdXi( 1, 2 ) = 1.0;
125
adNdXi( 2, 2 ) = 0.0;
126
127
adNdXi( 0, 3 ) = -1.0;
128
adNdXi( 1, 3 ) = -1.0;
129
adNdXi( 2, 3 ) = -1.0;
130
}
131
132
//------------------------------------------------------------------------------
133
134
template
<>
135
void
136
InterpolationFunctionTemplate
<
137
GeometryType::TET
,
InterpolationType::LAGRANGE
, 3, 4 >
::d2NdXi2
(
138
const
Vector< real >
& aXi,
139
Matrix< real >
& ad2NdXi2 )
const
140
{
141
ad2NdXi2.
set_size
( 6, 4, 0.0 );
142
}
143
144
//------------------------------------------------------------------------------
145
}
146
}
147
148
#endif
//BELFEM_CL_IF_TET4_HPP
cl_IF_InterpolationFunctionTemplate.hpp
belfem::Matrix< real >
belfem::Matrix::set_size
void set_size(const size_t aNumRows, const size_t aNumCols)
Definition
cl_AR_Matrix.hpp:186
belfem::Vector< real >
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::LAGRANGE
@ LAGRANGE
Definition
Mesh_Enums.hpp:100
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::LINEAR
@ LINEAR
Definition
Mesh_Enums.hpp:87
belfem::real
double real
Definition
typedefs.hpp:36
belfem::GeometryType::TET
@ TET
Definition
Mesh_Enums.hpp:75
src
fem
interpolation
lagrange
cl_IF_TET4.hpp
Generated by
1.18.0