BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_IF_IntegrationData.hpp
Go to the documentation of this file.
1//
2// Created by Christian Messe on 18.01.22.
3//
4
5#ifndef BELFEM_CL_IF_INTEGRATIONDATA_HPP
6#define BELFEM_CL_IF_INTEGRATIONDATA_HPP
7
8#include "typedefs.hpp"
9#include "cl_Vector.hpp"
10#include "cl_Matrix.hpp"
11#include "cl_Cell.hpp"
12#include "Mesh_Enums.hpp"
15#include "cl_Facet.hpp"
16
17namespace belfem
18{
19 namespace fem
20 {
28 {
29 const ElementType mElementType ;
30
31 bool mOwnShapeFunction = false ;
32 InterpolationFunction * mShapeFunction ;
33
34 Vector< real > mWeights ;
35 Matrix< real > mPoints ;
36
37 // nodal shape function
39 Cell< Vector< real > > mdPhidxi ; // line elements only
41 Cell< Matrix< real > > mNvector ;
42 Cell< Matrix< real > > mdNdXi;
43 Cell< Matrix< real > > md2NdXi2;
44
45 uint mNumberOfIntegrationPoints = 0 ;
46
47//------------------------------------------------------------------------------
48 public:
49//------------------------------------------------------------------------------
50
51 IntegrationData( const ElementType aElementType,
53 InterpolationFunction * aShapeFunction = nullptr );
54
55//------------------------------------------------------------------------------
56
57 IntegrationData( const ElementType aElementType,
58 InterpolationFunction * aShapeFunction,
59 const bool aClaimOwnership );
60
61//------------------------------------------------------------------------------
62
64
65//------------------------------------------------------------------------------
66
70 void
71 populate( const uint aIntegrationOrder=0,
73
74//------------------------------------------------------------------------------
75
79 void
80 populate_for_master( const uint aMasterIndex,
81 const uint aIntegrationOrder=0,
83
84//------------------------------------------------------------------------------
85
89 void
90 populate_for_slave( const uint aSlaveIndex,
91 const uint aOrientation=0,
92 const uint aIntegrationOrder=0,
94
95
96//------------------------------------------------------------------------------
97
102 function() const ;
103
104//------------------------------------------------------------------------------
105
109 uint
111
112//------------------------------------------------------------------------------
113
117 const Vector< real > &
118 weights() const ;
119
120//------------------------------------------------------------------------------
121
125 const Matrix< real > &
126 points() const ;
127
128//------------------------------------------------------------------------------
129
133 const Vector< real > &
134 phi( const uint aIndex ) const ;
135
136//------------------------------------------------------------------------------
137
141 const Vector< real > &
142 dphidxi( const uint aIndex ) const ;
143
144//------------------------------------------------------------------------------
145
149 const Matrix< real > &
150 N( const uint aIndex ) const ;
151
152//------------------------------------------------------------------------------
153
157 const Matrix< real > &
158 Nvector( const uint aIndex ) const ;
159
160//------------------------------------------------------------------------------
161
165 const Matrix< real > &
166 dNdXi( const uint aIndex ) const ;
167
168//------------------------------------------------------------------------------
169
173 const Matrix< real > &
174 d2NdXi2( const uint aIndex ) const ;
175
176//------------------------------------------------------------------------------
177 private :
178//------------------------------------------------------------------------------
179
180
181//------------------------------------------------------------------------------
182
186 void
187 populate_for_slave_tri( const uint aFaceIndex,
188 const uint aIntegrationOrder,
189 const IntegrationScheme aScheme );
190
191//------------------------------------------------------------------------------
192
196 void
197 populate_for_slave_quad(
198 const uint aSlaveIndex,
199 const uint aOrientation,
200 const uint aIntegrationOrder,
201 const IntegrationScheme aScheme );
202
203//------------------------------------------------------------------------------
204
208 void
209 populate_for_slave_tet(
210 const uint aSlaveIndex,
211 const uint aOrientation,
212 const uint aIntegrationOrder,
213 const IntegrationScheme aScheme );
214
215//------------------------------------------------------------------------------
216
220 void
221 populate_for_slave_penta(
222 const uint aSlaveIndex,
223 const uint aOrientation,
224 const uint aIntegrationOrder,
225 const IntegrationScheme aScheme );
226
227//------------------------------------------------------------------------------
228
232 void
233 populate_for_slave_hex(
234 const uint aSlaveIndex,
235 const uint aOrientation,
236 const uint aIntegrationOrder,
237 const IntegrationScheme aScheme );
238
239//------------------------------------------------------------------------------
240
241 void
242 evaluate_function();
243
244//------------------------------------------------------------------------------
245 };
246
247//------------------------------------------------------------------------------
248
249 inline const InterpolationFunction *
251 {
252 return mShapeFunction ;
253 }
254
255//------------------------------------------------------------------------------
256
257 inline uint
259 {
260 return mNumberOfIntegrationPoints ;
261 }
262
263//------------------------------------------------------------------------------
264
265 inline const Vector< real > &
267 {
268 return mWeights ;
269 }
270
271//------------------------------------------------------------------------------
272
273 inline const Matrix< real > &
275 {
276 return mPoints ;
277 }
278
279//------------------------------------------------------------------------------
280
281 inline const Vector< real > &
282 IntegrationData::phi( const uint aIndex ) const
283 {
284 return mPhi( aIndex ) ;
285 }
286//------------------------------------------------------------------------------
287
288 inline const Vector< real > &
289 IntegrationData::dphidxi( const uint aIndex ) const
290 {
291 BELFEM_ASSERT( mdPhidxi.size() > 0,
292 "dphidxi can only be called for line elements" );
293
294 return mdPhidxi( aIndex ) ;
295 }
296
297//------------------------------------------------------------------------------
298
299 inline const Matrix< real > &
300 IntegrationData::N( const uint aIndex ) const
301 {
302 return mN( aIndex ) ;
303 }
304
305//------------------------------------------------------------------------------
306
307 inline const Matrix< real > &
308 IntegrationData::Nvector( const uint aIndex ) const
309 {
310 return mNvector( aIndex ) ;
311 }
312
313//------------------------------------------------------------------------------
314
315 inline const Matrix< real > &
316 IntegrationData::dNdXi( const uint aIndex ) const
317 {
318 return mdNdXi( aIndex );
319 }
320
321//------------------------------------------------------------------------------
322
323 inline const Matrix< real > &
324 IntegrationData::d2NdXi2( const uint aIndex ) const
325 {
326 return md2NdXi2( aIndex );
327 }
328
329//------------------------------------------------------------------------------
330 }
331}
332#endif //BELFEM_CL_IF_INTEGRATIONDATA_HPP
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
const Matrix< real > & points() const
return the integration points
Definition cl_IF_IntegrationData.hpp:274
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:106
IntegrationData(const ElementType aElementType, const InterpolationType aType=InterpolationType::LAGRANGE, InterpolationFunction *aShapeFunction=nullptr)
Definition cl_IF_IntegrationData.cpp:19
uint number_of_integration_points() const
tells how many integration points are used
Definition cl_IF_IntegrationData.hpp:258
const Matrix< real > & d2NdXi2(const uint aIndex) const
return the second derivative of N
Definition cl_IF_IntegrationData.hpp:324
const Vector< real > & phi(const uint aIndex) const
return the node shape function as vector
Definition cl_IF_IntegrationData.hpp:282
const InterpolationFunction * function() const
access the shape function
Definition cl_IF_IntegrationData.hpp:250
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:88
const Vector< real > & weights() const
return the integration weights
Definition cl_IF_IntegrationData.hpp:266
const Vector< real > & dphidxi(const uint aIndex) const
return the node shape function deriivative as vector (line element only)
Definition cl_IF_IntegrationData.hpp:289
const Matrix< real > & Nvector(const uint aIndex) const
return the node shape function as Matrix, for vector field
Definition cl_IF_IntegrationData.hpp:308
const Matrix< real > & dNdXi(const uint aIndex) const
return the first derivative of N
Definition cl_IF_IntegrationData.hpp:316
const Matrix< real > & N(const uint aIndex) const
return the node shape function as Matrix (scalar field)
Definition cl_IF_IntegrationData.hpp:300
void populate(const uint aIntegrationOrder=0, const IntegrationScheme aScheme=IntegrationScheme::GAUSS)
default function for popularization
Definition cl_IF_IntegrationData.cpp:68
the shape function base class
Definition cl_IF_InterpolationFunction.hpp:24
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