BELFEM 0.9.3
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IF_IntegrationData.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_INTEGRATIONDATA_HPP
13#define BELFEM_CL_IF_INTEGRATIONDATA_HPP
14
15#include "typedefs.hpp"
16#include "cl_Vector.hpp"
17#include "cl_Matrix.hpp"
18#include "cl_Cell.hpp"
19#include "Mesh_Enums.hpp"
22#include "cl_Facet.hpp"
23
24namespace belfem
25{
26 namespace fem
27 {
35 {
36 const ElementType mElementType ;
37
38 bool mOwnShapeFunction = false ;
39 InterpolationFunction * mShapeFunction ;
40
41 Vector< real > mWeights ;
42 Matrix< real > mPoints ;
43
44 // nodal shape function
46 Cell< Vector< real > > mdPhidxi ; // line elements only
48 Cell< Matrix< real > > mNvector ;
49 Cell< Matrix< real > > mdNdXi;
50 Cell< Matrix< real > > md2NdXi2;
51
52 uint mNumberOfIntegrationPoints = 0 ;
53
54//------------------------------------------------------------------------------
55 public:
56//------------------------------------------------------------------------------
57
58 IntegrationData( const ElementType aElementType,
60 InterpolationFunction * aShapeFunction = nullptr );
61
62//------------------------------------------------------------------------------
63
64 IntegrationData( const ElementType aElementType,
65 InterpolationFunction * aShapeFunction,
66 const bool aClaimOwnership );
67
68//------------------------------------------------------------------------------
69
71
72//------------------------------------------------------------------------------
73
77 void
78 populate( const uint aIntegrationOrder=0,
80
81//------------------------------------------------------------------------------
82
86 void
87 populate_for_master( const uint aMasterIndex,
88 const uint aIntegrationOrder=0,
90
91//------------------------------------------------------------------------------
92
96 void
97 populate_for_slave( const uint aSlaveIndex,
98 const uint aOrientation=0,
99 const uint aIntegrationOrder=0,
101
102
103//------------------------------------------------------------------------------
104
109 function() const ;
110
111//------------------------------------------------------------------------------
112
116 uint
118
119//------------------------------------------------------------------------------
120
124 const Vector< real > &
125 weights() const ;
126
127//------------------------------------------------------------------------------
128
132 const Matrix< real > &
133 points() const ;
134
135//------------------------------------------------------------------------------
136
140 const Vector< real > &
141 phi( const uint aIndex ) const ;
142
143//------------------------------------------------------------------------------
144
148 const Vector< real > &
149 dphidxi( const uint aIndex ) const ;
150
151//------------------------------------------------------------------------------
152
156 const Matrix< real > &
157 N( const uint aIndex ) const ;
158
159//------------------------------------------------------------------------------
160
164 const Matrix< real > &
165 Nvector( const uint aIndex ) const ;
166
167//------------------------------------------------------------------------------
168
172 const Matrix< real > &
173 dNdXi( const uint aIndex ) const ;
174
175//------------------------------------------------------------------------------
176
180 const Matrix< real > &
181 d2NdXi2( const uint aIndex ) const ;
182
183//------------------------------------------------------------------------------
184 private :
185//------------------------------------------------------------------------------
186
187
188//------------------------------------------------------------------------------
189
193 void
194 populate_for_slave_tri( const uint aFaceIndex,
195 const uint aIntegrationOrder,
196 const IntegrationScheme aScheme );
197
198//------------------------------------------------------------------------------
199
203 void
204 populate_for_slave_quad(
205 const uint aSlaveIndex,
206 const uint aOrientation,
207 const uint aIntegrationOrder,
208 const IntegrationScheme aScheme );
209
210//------------------------------------------------------------------------------
211
215 void
216 populate_for_slave_tet(
217 const uint aSlaveIndex,
218 const uint aOrientation,
219 const uint aIntegrationOrder,
220 const IntegrationScheme aScheme );
221
222//------------------------------------------------------------------------------
223
227 void
228 populate_for_slave_penta(
229 const uint aSlaveIndex,
230 const uint aOrientation,
231 const uint aIntegrationOrder,
232 const IntegrationScheme aScheme );
233
234//------------------------------------------------------------------------------
235
239 void
240 populate_for_slave_hex(
241 const uint aSlaveIndex,
242 const uint aOrientation,
243 const uint aIntegrationOrder,
244 const IntegrationScheme aScheme );
245
246//------------------------------------------------------------------------------
247
248 void
249 evaluate_function();
250
251//------------------------------------------------------------------------------
252 };
253
254//------------------------------------------------------------------------------
255
256 inline const InterpolationFunction *
258 {
259 return mShapeFunction ;
260 }
261
262//------------------------------------------------------------------------------
263
264 inline uint
266 {
267 return mNumberOfIntegrationPoints ;
268 }
269
270//------------------------------------------------------------------------------
271
272 inline const Vector< real > &
274 {
275 return mWeights ;
276 }
277
278//------------------------------------------------------------------------------
279
280 inline const Matrix< real > &
282 {
283 return mPoints ;
284 }
285
286//------------------------------------------------------------------------------
287
288 inline const Vector< real > &
289 IntegrationData::phi( const uint aIndex ) const
290 {
291 return mPhi( aIndex ) ;
292 }
293//------------------------------------------------------------------------------
294
295 inline const Vector< real > &
296 IntegrationData::dphidxi( const uint aIndex ) const
297 {
298 BELFEM_ASSERT( mdPhidxi.size() > 0,
299 "dphidxi can only be called for line elements" );
300
301 return mdPhidxi( aIndex ) ;
302 }
303
304//------------------------------------------------------------------------------
305
306 inline const Matrix< real > &
307 IntegrationData::N( const uint aIndex ) const
308 {
309 return mN( aIndex ) ;
310 }
311
312//------------------------------------------------------------------------------
313
314 inline const Matrix< real > &
315 IntegrationData::Nvector( const uint aIndex ) const
316 {
317 return mNvector( aIndex ) ;
318 }
319
320//------------------------------------------------------------------------------
321
322 inline const Matrix< real > &
323 IntegrationData::dNdXi( const uint aIndex ) const
324 {
325 return mdNdXi( aIndex );
326 }
327
328//------------------------------------------------------------------------------
329
330 inline const Matrix< real > &
331 IntegrationData::d2NdXi2( const uint aIndex ) const
332 {
333 return md2NdXi2( aIndex );
334 }
335
336//------------------------------------------------------------------------------
337 }
338}
339#endif //BELFEM_CL_IF_INTEGRATIONDATA_HPP
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
A bounds-checked wrapper around std::vector.
Definition cl_Cell.hpp:45
const Matrix< real > & points() const
return the integration points
Definition cl_IF_IntegrationData.hpp:281
void populate_for_slave(const uint aSlaveIndex, const uint aOrientation=0, const uint aIntegrationOrder=0, const IntegrationScheme aScheme=IntegrationScheme::GAUSS)
special function for popularization if this is a sideset
Definition cl_IF_IntegrationData.cpp:113
IntegrationData(const ElementType aElementType, const InterpolationType aType=InterpolationType::LAGRANGE, InterpolationFunction *aShapeFunction=nullptr)
Definition cl_IF_IntegrationData.cpp:26
uint number_of_integration_points() const
tells how many integration points are used
Definition cl_IF_IntegrationData.hpp:265
const Matrix< real > & d2NdXi2(const uint aIndex) const
return the second derivative of N
Definition cl_IF_IntegrationData.hpp:331
const Vector< real > & phi(const uint aIndex) const
return the node shape function as vector
Definition cl_IF_IntegrationData.hpp:289
const InterpolationFunction * function() const
access the shape function
Definition cl_IF_IntegrationData.hpp:257
void populate_for_master(const uint aMasterIndex, const uint aIntegrationOrder=0, const IntegrationScheme aScheme=IntegrationScheme::GAUSS)
special function for popularization if this is a sideset
Definition cl_IF_IntegrationData.cpp:95
const Vector< real > & weights() const
return the integration weights
Definition cl_IF_IntegrationData.hpp:273
const Vector< real > & dphidxi(const uint aIndex) const
return the node shape function deriivative as vector (line element only)
Definition cl_IF_IntegrationData.hpp:296
const Matrix< real > & Nvector(const uint aIndex) const
return the node shape function as Matrix, for vector field
Definition cl_IF_IntegrationData.hpp:315
const Matrix< real > & dNdXi(const uint aIndex) const
return the first derivative of N
Definition cl_IF_IntegrationData.hpp:323
const Matrix< real > & N(const uint aIndex) const
return the node shape function as Matrix (scalar field)
Definition cl_IF_IntegrationData.hpp:307
void populate(const uint aIntegrationOrder=0, const IntegrationScheme aScheme=IntegrationScheme::GAUSS)
default function for popularization
Definition cl_IF_IntegrationData.cpp:75
the shape function base class
Definition cl_IF_InterpolationFunction.hpp:31
Definition cl_IFB_LINE3.hpp:21
USER GUIDES:
Definition cl_Capacitor.cpp:16
InterpolationType
Definition Mesh_Enums.hpp:99
@ LAGRANGE
Definition Mesh_Enums.hpp:100
IntegrationScheme
Definition en_IntegrationScheme.hpp:22
@ GAUSS
Definition en_IntegrationScheme.hpp:23
unsigned int uint
Definition typedefs.hpp:30
ElementType
Element types.
Definition Mesh_Enums.hpp:27