BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_EF_EdgeFunction.hpp
Go to the documentation of this file.
1//
2// Created by christian on 12/1/21.
3//
4
5#ifndef BELFEM_CL_EF_EDGEFUNCTION_HPP
6#define BELFEM_CL_EF_EDGEFUNCTION_HPP
7
8#include "typedefs.hpp"
9#include "Mesh_Enums.hpp"
10#include "cl_Vector.hpp"
11#include "cl_Matrix.hpp"
12#include "assert.hpp"
13
14namespace belfem
15{
16 namespace mesh
17 {
18 class Element ;
19 }
20
21 namespace fem
22 {
23 class Element ;
24
32 {
33//------------------------------------------------------------------------------
34 protected:
35//------------------------------------------------------------------------------
36
39
42
45
48
49 // values for the shape function
51
54
91
95
96//------------------------------------------------------------------------------
97 public:
98//------------------------------------------------------------------------------
99
103 EdgeFunction() = default;
104
105//------------------------------------------------------------------------------
106
110 virtual ~EdgeFunction() = default;
111
112//------------------------------------------------------------------------------
113
118 virtual void
119 link( Element * aElement ) = 0 ;
120
121//------------------------------------------------------------------------------
122
127 virtual void
128 precompute( const Matrix< real > & aXi ) = 0 ;
129
130//------------------------------------------------------------------------------
131
132 // compute the edge function
133 virtual const Matrix< real > &
134 E( const uint aIndex ) ;
135
136//------------------------------------------------------------------------------
137
138 // compute the curl function
139 virtual const Matrix< real > &
140 C( const uint aIndex = 0 ) = 0 ;
141
142//------------------------------------------------------------------------------
143
144 // compute the gradient operator of the edge function
145 // ( layout contract: see the mGrad member documentation )
146 virtual const Matrix< real > &
147 G( const uint aIndex = 0 ) = 0 ;
148
149//------------------------------------------------------------------------------
150
154 real
155 det_J() const ;
156
157//------------------------------------------------------------------------------
158
162 real
163 abs_det_J() const ;
164
165//------------------------------------------------------------------------------
166
170 real
171 sum_w() const ;
172
173//------------------------------------------------------------------------------
174
179 uint
180 ndofs() const ;
181
182//------------------------------------------------------------------------------
183
184 virtual void
185 update_nabla( const uint aIndex );
186
187//------------------------------------------------------------------------------
188 };
189//------------------------------------------------------------------------------
190
191 inline uint
193 {
194 return mNumDofs ;
195 }
196
197//------------------------------------------------------------------------------
198
199 inline real
201 {
202 return mSumW ;
203 }
204
205//------------------------------------------------------------------------------
206
207 inline real
209 {
210 return mDetJ;
211 }
212
213//------------------------------------------------------------------------------
214
215 inline real
217 {
218 return mAbsDetJ ;
219 }
220
221//------------------------------------------------------------------------------
222
223 inline const Matrix <real> &
224 EdgeFunction::E( const uint aIndex )
225 {
226 BELFEM_ERROR( false, "Invalid call to edge function");
227 return mE;
228 }
229
230//------------------------------------------------------------------------------
231
232 inline const Matrix <real> &
233 EdgeFunction::C( const uint aIndex )
234 {
235 BELFEM_ERROR( false, "Invalid call to curl function");
236 return mC;
237 }
238
239//------------------------------------------------------------------------------
240
241 inline void
243 {
244 BELFEM_ERROR( false, "Invalid call to update_nabla()");
245 }
246
247//------------------------------------------------------------------------------
248
249 } /* end namespace fem */
250} /* end namespace belfem */
251
252
253#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:93
virtual void update_nabla(const uint aIndex)
Definition cl_EF_EdgeFunction.hpp:242
Matrix< real > mGrad
Definition cl_EF_EdgeFunction.hpp:90
real abs_det_J() const
returns the current value of the determinant
Definition cl_EF_EdgeFunction.hpp:216
uint mNumDofs
Definition cl_EF_EdgeFunction.hpp:94
virtual const Matrix< real > & E(const uint aIndex)
Definition cl_EF_EdgeFunction.hpp:224
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:47
Matrix< real > mE
Definition cl_EF_EdgeFunction.hpp:50
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:208
real sum_w() const
returns the sum of all integration weights
Definition cl_EF_EdgeFunction.hpp:200
Matrix< real > mInvJ
the inverse of the Geometry Jacobian (transposed)
Definition cl_EF_EdgeFunction.hpp:41
Matrix< real > mJ
the Geometry Jacobian (transposed)
Definition cl_EF_EdgeFunction.hpp:38
uint ndofs() const
Definition cl_EF_EdgeFunction.hpp:192
real mDetJ
the determinant of the Geometry Jacobian
Definition cl_EF_EdgeFunction.hpp:44
virtual const Matrix< real > & C(const uint aIndex=0)=0
Definition cl_EF_EdgeFunction.hpp:233
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:53
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:87