BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IFB_LINE3.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_IFB_LINE3_HPP
13#define BELFEM_CL_IFB_LINE3_HPP
14
15
17
18namespace belfem
19{
20 namespace fem
21 {
22//------------------------------------------------------------------------------
23
24 template<>
32
33//------------------------------------------------------------------------------
34
35 template<>
40 {
41 return ElementType::LINE3;
42 }
43
44//------------------------------------------------------------------------------
45
46 template<>
47 void
50 ::param_coords( Matrix <real> & aXiHat ) const
51 {
52 aXiHat.set_size( 1, 3 );
53
54 aXiHat( 0, 0 ) = -1.0;
55 aXiHat( 0, 1 ) = 1.0;
56 aXiHat( 0, 2 ) = 0.0;
57
58 }
59
60//------------------------------------------------------------------------------
61
62 template<>
63 void
66 const Vector <real> & aXi,
67 Matrix <real> & aN ) const
68 {
69 const real xi = aXi( 0 );
70 const real xi2 = xi * xi;
71
72 aN.set_size( 1, 3 );
73 aN( 0, 0 ) = 0.25 * ( xi2 - xi );
74 aN( 0, 1 ) = 0.25 * ( xi2 + xi );
75 aN( 0, 2 ) = 0.5 - 0.5 * xi2;
76 }
77
78//------------------------------------------------------------------------------
79
80 template<>
81 void
84 const Vector <real> & aXi,
85 Matrix <real> & adNdXi ) const
86 {
87 const real xi = aXi( 0 );
88 adNdXi.set_size( 1, 3 );
89 adNdXi( 0, 0 ) = 0.5*xi - 0.5;
90 adNdXi( 0, 1 ) = 0.5*xi + 0.5;
91 adNdXi( 0, 2 ) = -xi;
92 }
93
94//------------------------------------------------------------------------------
95
96 template<>
97 void
100 const Vector <real> & aXi,
101 Matrix <real> & ad2NdXi2 ) const
102 {
103 ad2NdXi2.set_size( 1, 3, 0.0 );
104 ad2NdXi2( 0, 0 ) = 0.5;
105 ad2NdXi2( 0, 1 ) = 0.5;
106 ad2NdXi2( 0, 2 ) = -1.0;
107 }
108
109//------------------------------------------------------------------------------
110 }
111}
112
113#endif //BELFEM_CL_IFB_LINE3_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
@ BERNSTEIN
Definition Mesh_Enums.hpp:102
ElementType element_type(const std::string &aStr)
Definition Mesh_Enums.hpp:370
ElementType
Element types.
Definition Mesh_Enums.hpp:27
@ LINE3
Definition Mesh_Enums.hpp:36
InterpolationOrder
Definition Mesh_Enums.hpp:85
@ QUADRATIC
Definition Mesh_Enums.hpp:88
double real
Definition typedefs.hpp:36
@ LINE
Definition Mesh_Enums.hpp:72