BELFEM 0.9.3
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_EF_EdgeFunction.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_EF_EDGEFUNCTION_HPP
13#define BELFEM_CL_EF_EDGEFUNCTION_HPP
14
15#include "typedefs.hpp"
16#include "Mesh_Enums.hpp"
17#include "cl_Vector.hpp"
18#include "cl_Matrix.hpp"
19#include "assert.hpp"
20
21namespace belfem
22{
23 namespace mesh
24 {
25 class Element ;
26 }
27
28 namespace fem
29 {
30 class Element ;
31
39 {
40//------------------------------------------------------------------------------
41 protected:
42//------------------------------------------------------------------------------
43
46
49
52
55
56 // values for the shape function
58
61
98
102
103//------------------------------------------------------------------------------
104 public:
105//------------------------------------------------------------------------------
106
110 EdgeFunction() = default;
111
112//------------------------------------------------------------------------------
113
117 virtual ~EdgeFunction() = default;
118
119//------------------------------------------------------------------------------
120
125 virtual void
126 link( Element * aElement ) = 0 ;
127
128//------------------------------------------------------------------------------
129
134 virtual void
135 precompute( const Matrix< real > & aXi ) = 0 ;
136
137//------------------------------------------------------------------------------
138
139 // compute the edge function
140 virtual const Matrix< real > &
141 E( const uint aIndex ) ;
142
143//------------------------------------------------------------------------------
144
145 // compute the curl function
146 virtual const Matrix< real > &
147 C( const uint aIndex = 0 ) = 0 ;
148
149//------------------------------------------------------------------------------
150
151 // compute the gradient operator of the edge function
152 // ( layout contract: see the mGrad member documentation )
153 virtual const Matrix< real > &
154 G( const uint aIndex = 0 ) = 0 ;
155
156//------------------------------------------------------------------------------
157
161 real
162 det_J() const ;
163
164//------------------------------------------------------------------------------
165
169 real
170 abs_det_J() const ;
171
172//------------------------------------------------------------------------------
173
177 real
178 sum_w() const ;
179
180//------------------------------------------------------------------------------
181
186 uint
187 ndofs() const ;
188
189//------------------------------------------------------------------------------
190
191 virtual void
192 update_nabla( const uint aIndex );
193
194//------------------------------------------------------------------------------
195 };
196//------------------------------------------------------------------------------
197
198 inline uint
200 {
201 return mNumDofs ;
202 }
203
204//------------------------------------------------------------------------------
205
206 inline real
208 {
209 return mSumW ;
210 }
211
212//------------------------------------------------------------------------------
213
214 inline real
216 {
217 return mDetJ;
218 }
219
220//------------------------------------------------------------------------------
221
222 inline real
224 {
225 return mAbsDetJ ;
226 }
227
228//------------------------------------------------------------------------------
229
230 inline const Matrix <real> &
231 EdgeFunction::E( const uint aIndex )
232 {
233 BELFEM_ERROR( false, "Invalid call to edge function");
234 return mE;
235 }
236
237//------------------------------------------------------------------------------
238
239 inline const Matrix <real> &
240 EdgeFunction::C( const uint aIndex )
241 {
242 BELFEM_ERROR( false, "Invalid call to curl function");
243 return mC;
244 }
245
246//------------------------------------------------------------------------------
247
248 inline void
250 {
251 BELFEM_ERROR( false, "Invalid call to update_nabla()");
252 }
253
254//------------------------------------------------------------------------------
255
256 } /* end namespace fem */
257} /* end namespace belfem */
258
259
260#endif //BELFEM_CL_EF_EDGEFUNCTION_HPP
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
real mSumW
sum of all weights
Definition cl_EF_EdgeFunction.hpp:100
virtual void update_nabla(const uint aIndex)
Definition cl_EF_EdgeFunction.hpp:249
Matrix< real > mGrad
Definition cl_EF_EdgeFunction.hpp:97
real abs_det_J() const
returns the current value of the determinant
Definition cl_EF_EdgeFunction.hpp:223
uint mNumDofs
Definition cl_EF_EdgeFunction.hpp:101
virtual const Matrix< real > & E(const uint aIndex)
Definition cl_EF_EdgeFunction.hpp:231
virtual const Matrix< real > & G(const uint aIndex=0)=0
real mAbsDetJ
the absolute value determinant of the Geometry Jacobian
Definition cl_EF_EdgeFunction.hpp:54
Matrix< real > mE
Definition cl_EF_EdgeFunction.hpp:57
virtual void link(Element *aElement)=0
links the shape function with the element and precomputes data
real det_J() const
returns the current value of the determinant
Definition cl_EF_EdgeFunction.hpp:215
real sum_w() const
returns the sum of all integration weights
Definition cl_EF_EdgeFunction.hpp:207
Matrix< real > mInvJ
the inverse of the Geometry Jacobian (transposed)
Definition cl_EF_EdgeFunction.hpp:48
Matrix< real > mJ
the Geometry Jacobian (transposed)
Definition cl_EF_EdgeFunction.hpp:45
uint ndofs() const
Definition cl_EF_EdgeFunction.hpp:199
real mDetJ
the determinant of the Geometry Jacobian
Definition cl_EF_EdgeFunction.hpp:51
virtual const Matrix< real > & C(const uint aIndex=0)=0
Definition cl_EF_EdgeFunction.hpp:240
virtual ~EdgeFunction()=default
trivial destructor
virtual void precompute(const Matrix< real > &aXi)=0
only needed for higher order elements
EdgeFunction()=default
trivial constructor
Matrix< real > mC
matrix containing the curl for the H-Function
Definition cl_EF_EdgeFunction.hpp:60
Definition cl_FEM_Element.hpp:41
Lagrange Element baseclass.
Definition cl_Element.hpp:35
Definition cl_IFB_LINE3.hpp:21
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
double real
Definition typedefs.hpp:36
Definition __init__.py:1
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:86