BELFEM 0.9.3
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
52 bool
54 const DofManagerBase * aParent,
55 Dof * aDof,
56 const real aValue,
57 const id_t aGroupID,
58 const id_t aNodeID,
59 index_t & aNumFirstFlips );
60
61//------------------------------------------------------------------------------
62
63 class SideSet : public Group
64 {
65
66//----------------------------------------------------------------------------
67 protected:
68//----------------------------------------------------------------------------
69
72
73 // side nodes
75
76 // container for BC values per dof type
78
80
81//------------------------------------------------------------------------------
82 private:
83//------------------------------------------------------------------------------
84 // container for temperature for alpha BC
85 real mTinf = BELFEM_QUIET_NAN ;
86
87 // conainer with reference blocks for sideset integrations
88 Cell< IntegrationData * > mMasterIntegration ;
89 Cell< IntegrationData * > mSlaveIntegration ;
90
91//------------------------------------------------------------------------------
92 public:
93//------------------------------------------------------------------------------
94
95 SideSet( DofManager * aParent,
96 const id_t aID,
97 Cell< mesh::Facet * > & aFacets,
98 const GroupType aGroupType = GroupType::SIDESET );
99
100//------------------------------------------------------------------------------
101
102 /*
103 * a constructor with an empty parent, just used for tests
104 */
105 SideSet( const ElementType aElementType,
106 const ElementType aMasterType,
107 const ElementType aSlaveType,
108 const GroupType aGroupType = GroupType::SIDESET );
109
110//------------------------------------------------------------------------------
111
112 ~SideSet() override;
113
114//------------------------------------------------------------------------------
115
116 void
117 impose_dirichlet( const real aValue, const uint aDofType=0 );
118
119//------------------------------------------------------------------------------
120
121 void
122 impose_neumann( const real aValue, const uint aDofType=0 );
123
124//------------------------------------------------------------------------------
125
131 void
132 impose_alpha( const real aAlpha = BELFEM_QUIET_NAN, const real aTinf=BELFEM_QUIET_NAN );
133
134//------------------------------------------------------------------------------
135
136 void
137 free();
138
139//------------------------------------------------------------------------------
140
141 void
143
144//------------------------------------------------------------------------------
145
146 // get bc type
148 bc_type( const index_t & aDimension ) const ;
149
150//------------------------------------------------------------------------------
151
152 // get bc type
153 const real &
154 bc_value( const index_t & aDimension ) const ;
155
156//------------------------------------------------------------------------------
157
162 nodes() ;
163
164//------------------------------------------------------------------------------
165
166 uint
168
169//------------------------------------------------------------------------------
170
175 master_type() const override ;
176
177//------------------------------------------------------------------------------
178
183 slave_type() const override ;
184
185//------------------------------------------------------------------------------
186
193 master_integration( const uint aSideSetIndex ) override ;
194
195//------------------------------------------------------------------------------
196
203 slave_integration( const uint aSideSetIndex ) override ;
204
205//------------------------------------------------------------------------------
206
223 void
224 initialize_lookup_tables( const uint aIntegrationOrder ) override;
225
226//------------------------------------------------------------------------------
227 protected:
228//------------------------------------------------------------------------------
229
230 // surface elements
231 virtual void
233
234//------------------------------------------------------------------------------
235 private:
236//------------------------------------------------------------------------------
237
238 void
239 collect_nodes( Cell< mesh::Facet * > & aFacets );
240
241//------------------------------------------------------------------------------
242
247 void
248 delete_lookup_tables();
249
250
251//------------------------------------------------------------------------------
252 };
253
254//------------------------------------------------------------------------------
255
256 // get bc type
258 SideSet::bc_type( const index_t & aDimension ) const
259 {
260 return mBcTypes( aDimension );
261 }
262
263//------------------------------------------------------------------------------
264
265 // get bc type
266 inline const real &
267 SideSet::bc_value( const index_t & aDimension ) const
268 {
269 return mBcValues( aDimension );
270 }
271
272//------------------------------------------------------------------------------
273
274 inline
277 {
278 return mNodes ;
279 }
280
281//------------------------------------------------------------------------------
282
283 inline uint
285 {
286 return mBcTypes.size() ;
287 }
288
289//------------------------------------------------------------------------------
290
291 inline ElementType
293 {
294 return mMasterType ;
295 }
296
297//------------------------------------------------------------------------------
298
299 inline ElementType
301 {
302 return mSlaveType ;
303 }
304
305//------------------------------------------------------------------------------
306
307 inline IntegrationData *
308 SideSet::master_integration( const uint aSideSetIndex )
309 {
310 return mMasterIntegration( aSideSetIndex );
311 }
312
313//------------------------------------------------------------------------------
314
315 inline IntegrationData *
316 SideSet::slave_integration( const uint aSideSetIndex )
317 {
318 return mSlaveIntegration( aSideSetIndex );
319 }
320
321//------------------------------------------------------------------------------
322 }
323}
324#endif //BELFEM_CL_FEM_SIDESET_HPP
A bounds-checked wrapper around std::vector.
Definition cl_Cell.hpp:45
size_t size() const
Definition cl_Cell.hpp:189
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
Main workhorse: DOF management, assembly coordination and the solver interface.
Definition cl_FEM_DofManager.hpp:52
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:35
BoundaryConditionImposing bc_type(const index_t &aDimension) const
Definition cl_FEM_SideSet.hpp:258
void free()
Definition cl_FEM_SideSet.cpp:416
IntegrationData * master_integration(const uint aSideSetIndex) override
integration data on master element
Definition cl_FEM_SideSet.hpp:308
void impose_neumann(const real aValue, const uint aDofType=0)
Definition cl_FEM_SideSet.cpp:375
void initialize_lookup_tables(const uint aIntegrationOrder) override
builds the master, slave and enrichment tables for aIntegrationOrder ( 0 selects the automatic order ...
Definition cl_FEM_SideSet.cpp:495
ElementType master_type() const override
returns type of sideset master
Definition cl_FEM_SideSet.hpp:292
void impose_dirichlet(const real aValue, const uint aDofType=0)
Definition cl_FEM_SideSet.cpp:324
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:389
SideSet(DofManager *aParent, const id_t aID, Cell< mesh::Facet * > &aFacets, const GroupType aGroupType=GroupType::SIDESET)
Definition cl_FEM_SideSet.cpp:104
virtual void initialize_elements(Cell< mesh::Facet * > &aFacets)
Definition cl_FEM_SideSet.cpp:195
Cell< mesh::Node * > mNodes
Definition cl_FEM_SideSet.hpp:74
Cell< BoundaryConditionImposing > mBcTypes
Definition cl_FEM_SideSet.hpp:79
Vector< real > mBcValues
Definition cl_FEM_SideSet.hpp:77
ElementType slave_type() const override
returns type of sideset slave
Definition cl_FEM_SideSet.hpp:300
IntegrationData * slave_integration(const uint aSideSetIndex) override
integration data on slave element
Definition cl_FEM_SideSet.hpp:316
const ElementType mMasterType
Definition cl_FEM_SideSet.hpp:70
Cell< mesh::Node * > & nodes()
expose the node container
Definition cl_FEM_SideSet.hpp:276
const real & bc_value(const index_t &aDimension) const
Definition cl_FEM_SideSet.hpp:267
uint number_of_boundary_conditions() const
Definition cl_FEM_SideSet.hpp:284
const ElementType mSlaveType
Definition cl_FEM_SideSet.hpp:71
void set_boundary_conditions()
Definition cl_FEM_SideSet.cpp:441
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:86