BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IF_TRI3.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_TRI3_HPP
13#define BELFEM_CL_IF_TRI3_HPP
14
16
17namespace belfem
18{
19 namespace fem
20 {
21//------------------------------------------------------------------------------
22
28
29//------------------------------------------------------------------------------
30
31 template<>
39
40//------------------------------------------------------------------------------
41
42 template<>
47 {
48 return ElementType::TRI3;
49 }
50
51//------------------------------------------------------------------------------
52
53 template<>
54 void
58 {
59 aXiHat.set_size( 2, 3 );
60
61 aXiHat( 0, 0 ) = 1.0;
62 aXiHat( 1, 0 ) = 0.0;
63
64 aXiHat( 0, 1 ) = 0.0;
65 aXiHat( 1, 1 ) = 1.0;
66
67 aXiHat( 0, 2 ) = 0.0;
68 aXiHat( 1, 2 ) = 0.0;
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
83 aN.set_size( 1, 3 );
84 aN( 0, 0 ) = xi;
85 aN( 0, 1 ) = eta;
86 aN( 0, 2 ) = 1.0 - xi - eta;
87 }
88
89//------------------------------------------------------------------------------
90
91 template<>
92 void
95 const Vector< real > & aXi,
96 Matrix< real > & adNdXi ) const
97 {
98 adNdXi.set_size( 2, 3 );
99 adNdXi( 0, 0 ) = 1.0;
100 adNdXi( 1, 0 ) = 0.0;
101
102 adNdXi( 0, 1 ) = 0.0;
103 adNdXi( 1, 1 ) = 1.0;
104
105 adNdXi( 0, 2 ) = -1.0;
106 adNdXi( 1, 2 ) = -1.0;
107 }
108
109//------------------------------------------------------------------------------
110
111 template<>
112 void
115 const Vector< real > & aXi,
116 Matrix< real > & ad2NdXi2 ) const
117 {
118 ad2NdXi2.set_size( 3, 3, 0.0 );
119 }
120
121//------------------------------------------------------------------------------
122 }
123}
124
125#endif //BELFEM_CL_IF_TRI3_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
@ TRI3
Definition Mesh_Enums.hpp:30
InterpolationOrder
Definition Mesh_Enums.hpp:85
@ LINEAR
Definition Mesh_Enums.hpp:87
double real
Definition typedefs.hpp:36
@ TRI
Definition Mesh_Enums.hpp:73