BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_FEM_SideSet.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_FEM_SIDESET_HPP
13#define BELFEM_CL_FEM_SIDESET_HPP
14
15#include "typedefs.hpp"
16#include "cl_Vector.hpp"
17#include "cl_FEM_Group.hpp"
19
20namespace belfem
21{
22 namespace fem
23 {
24//------------------------------------------------------------------------------
25
26 class Field ;
27 class DofManager ;
28 class DofManagerBase ;
29 class Dof ;
30 class Block ;
31
32//------------------------------------------------------------------------------
33
48 bool
50 const DofManagerBase * aParent,
51 Dof * aDof,
52 const real aValue,
53 const id_t aGroupID,
54 const id_t aNodeID,
55 index_t & aNumFirstFlips );
56
57//------------------------------------------------------------------------------
58
59 class SideSet : public Group
60 {
61 // cell with sideset integration information
62 Cell< IntegrationData * > mSideSetIntegrationData ;
63
64
65//----------------------------------------------------------------------------
66 protected:
67//----------------------------------------------------------------------------
68
71
72 // side nodes
74
75 // container for BC values per dof type
77
79
80//------------------------------------------------------------------------------
81 private:
82//------------------------------------------------------------------------------
83 // container for temperature for alpha BC
84 real mTinf = BELFEM_QUIET_NAN ;
85
86 // conainer with reference blocks for sideset integrations
87 Cell< IntegrationData * > mMasterIntegration ;
88 Cell< IntegrationData * > mSlaveIntegration ;
89
90//------------------------------------------------------------------------------
91 public:
92//------------------------------------------------------------------------------
93
94 SideSet( DofManager * aParent,
95 const id_t aID,
96 Cell< mesh::Facet * > & aFacets,
97 const GroupType aGroupType = GroupType::SIDESET );
98
99//------------------------------------------------------------------------------
100
101 /*
102 * a constructor with an empty parent, just used for tests
103 */
104 SideSet( const ElementType aElementType,
105 const ElementType aMasterType,
106 const ElementType aSlaveType,
107 const GroupType aGroupType = GroupType::SIDESET );
108
109//------------------------------------------------------------------------------
110
111 ~SideSet() override;
112
113//------------------------------------------------------------------------------
114
115 void
116 impose_dirichlet( const real aValue, const uint aDofType=0 );
117
118//------------------------------------------------------------------------------
119
120 void
121 impose_neumann( const real aValue, const uint aDofType=0 );
122
123//------------------------------------------------------------------------------
124
130 void
131 impose_alpha( const real aAlpha = BELFEM_QUIET_NAN, const real aTinf=BELFEM_QUIET_NAN );
132
133//------------------------------------------------------------------------------
134
135 void
136 free();
137
138//------------------------------------------------------------------------------
139
140 void
142
143//------------------------------------------------------------------------------
144
145 // get bc type
147 bc_type( const index_t & aDimension ) const ;
148
149//------------------------------------------------------------------------------
150
151 // get bc type
152 const real &
153 bc_value( const index_t & aDimension ) const ;
154
155//------------------------------------------------------------------------------
156
161 nodes() ;
162
163//------------------------------------------------------------------------------
164
165 uint
167
168//------------------------------------------------------------------------------
169
174 master_type() const override ;
175
176//------------------------------------------------------------------------------
177
182 slave_type() const override ;
183
184//------------------------------------------------------------------------------
185
192 master_integration( const uint aSideSetIndex ) override ;
193
194//------------------------------------------------------------------------------
195
202 slave_integration( const uint aSideSetIndex ) override ;
203
204//------------------------------------------------------------------------------
205
206 void
207 initialize_lookup_tables( const uint aIntegrationOrder ) override;
208
209//------------------------------------------------------------------------------
210 protected:
211//------------------------------------------------------------------------------
212
213 // surface elements
214 virtual void
216
217//------------------------------------------------------------------------------
218 private:
219//------------------------------------------------------------------------------
220
221 void
222 collect_nodes( Cell< mesh::Facet * > & aFacets );
223
224
225//------------------------------------------------------------------------------
226 };
227
228//------------------------------------------------------------------------------
229
230 // get bc type
232 SideSet::bc_type( const index_t & aDimension ) const
233 {
234 return mBcTypes( aDimension );
235 }
236
237//------------------------------------------------------------------------------
238
239 // get bc type
240 inline const real &
241 SideSet::bc_value( const index_t & aDimension ) const
242 {
243 return mBcValues( aDimension );
244 }
245
246//------------------------------------------------------------------------------
247
248 inline
251 {
252 return mNodes ;
253 }
254
255//------------------------------------------------------------------------------
256
257 inline uint
259 {
260 return mBcTypes.size() ;
261 }
262
263//------------------------------------------------------------------------------
264
265 inline ElementType
267 {
268 return mMasterType ;
269 }
270
271//------------------------------------------------------------------------------
272
273 inline ElementType
275 {
276 return mSlaveType ;
277 }
278
279//------------------------------------------------------------------------------
280
281 inline IntegrationData *
282 SideSet::master_integration( const uint aSideSetIndex )
283 {
284 return mMasterIntegration( aSideSetIndex );
285 }
286
287//------------------------------------------------------------------------------
288
289 inline IntegrationData *
290 SideSet::slave_integration( const uint aSideSetIndex )
291 {
292 return mSlaveIntegration( aSideSetIndex );
293 }
294
295//------------------------------------------------------------------------------
296 }
297}
298#endif //BELFEM_CL_FEM_SIDESET_HPP
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
size_t size() const
return the size of the Cell
Definition cl_Cell.hpp:181
Definition cl_FEM_Block.hpp:35
Definition cl_FEM_Dof.hpp:28
abstract interface of the dof manager as seen by the group classes and the IWG; DofManager is its onl...
Definition cl_FEM_DofManagerBase.hpp:44
this class creates the DOFs based on the passed equation object.
Definition cl_FEM_DofManager.hpp:55
Group(DofManagerBase *aParent, const GroupType aGroupType, const ElementType aElementType, const id_t aID, const index_t aNumberOfElements, const bool aOwnElements=true)
Definition cl_FEM_Group.cpp:29
Precomputed bundle of integration points, weights and shape-function values.
Definition cl_IF_IntegrationData.hpp:28
BoundaryConditionImposing bc_type(const index_t &aDimension) const
Definition cl_FEM_SideSet.hpp:232
void free()
Definition cl_FEM_SideSet.cpp:459
IntegrationData * master_integration(const uint aSideSetIndex) override
integration data on master element
Definition cl_FEM_SideSet.hpp:282
void impose_neumann(const real aValue, const uint aDofType=0)
Definition cl_FEM_SideSet.cpp:413
void initialize_lookup_tables(const uint aIntegrationOrder) override
Definition cl_FEM_SideSet.cpp:544
ElementType master_type() const override
returns type of sideset master
Definition cl_FEM_SideSet.hpp:266
void impose_dirichlet(const real aValue, const uint aDofType=0)
Definition cl_FEM_SideSet.cpp:352
void impose_alpha(const real aAlpha=BELFEM_QUIET_NAN, const real aTinf=BELFEM_QUIET_NAN)
imposing an alpha value requires setting the value in the field by default, a value can be set,...
Definition cl_FEM_SideSet.cpp:428
SideSet(DofManager *aParent, const id_t aID, Cell< mesh::Facet * > &aFacets, const GroupType aGroupType=GroupType::SIDESET)
Definition cl_FEM_SideSet.cpp:96
virtual void initialize_elements(Cell< mesh::Facet * > &aFacets)
Definition cl_FEM_SideSet.cpp:206
Cell< mesh::Node * > mNodes
Definition cl_FEM_SideSet.hpp:73
Cell< BoundaryConditionImposing > mBcTypes
Definition cl_FEM_SideSet.hpp:78
Vector< real > mBcValues
Definition cl_FEM_SideSet.hpp:76
ElementType slave_type() const override
returns type of sideset slave
Definition cl_FEM_SideSet.hpp:274
IntegrationData * slave_integration(const uint aSideSetIndex) override
integration data on slave element
Definition cl_FEM_SideSet.hpp:290
const ElementType mMasterType
Definition cl_FEM_SideSet.hpp:69
Cell< mesh::Node * > & nodes()
expose the node container
Definition cl_FEM_SideSet.hpp:250
const real & bc_value(const index_t &aDimension) const
Definition cl_FEM_SideSet.hpp:241
uint number_of_boundary_conditions() const
Definition cl_FEM_SideSet.hpp:258
const ElementType mSlaveType
Definition cl_FEM_SideSet.hpp:70
void set_boundary_conditions()
Definition cl_FEM_SideSet.cpp:486
Definition cl_IFB_LINE3.hpp:21
BoundaryConditionImposing
Definition en_FEM_BoundaryConditionImposing.hpp:20
bool pin_dirichlet_dof(const DofManagerBase *aParent, Dof *aDof, const real aValue, const id_t aGroupID, const id_t aNodeID, index_t &aNumFirstFlips)
shared Dirichlet pin for a single node dof, used by SideSet::impose_dirichlet and the Maxwell factory...
Definition cl_FEM_SideSet.cpp:36
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
unsigned int id_t
Definition typedefs.hpp:41
ElementType
Element types.
Definition Mesh_Enums.hpp:27
@ EMPTY
Definition Mesh_Enums.hpp:28
GroupType
Definition Mesh_Enums.hpp:130
@ SIDESET
Definition Mesh_Enums.hpp:132
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87