BELFEM 0.9.3
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_FEM_DofMgr_BlockData.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#ifndef BELFEM_CL_FEM_DOFMGR_BLOCKDATA_HPP
12#define BELFEM_CL_FEM_DOFMGR_BLOCKDATA_HPP
13
14#include "typedefs.hpp"
15#include "cl_Cell.hpp"
16#include "cl_Map.hpp"
17#include "cl_Vector.hpp"
18#include "cl_IWG.hpp"
19#include "cl_FEM_Block.hpp"
20namespace belfem
21{
22 class Mesh ;
23
24 namespace fem
25 {
26 class Kernel ;
27 class DofManager ;
28
29 namespace dofmgr
30 {
32 {
34 DofManager * mParent ;
35
37 Kernel * mKernel ;
38
40 Mesh * mMesh ;
41
42 // my rank
43 const proc_t mCommRank ;
44 const proc_t mCommSize ;
45
46 // map for fem blocks
47 Map< id_t, Block * > mBlockMap ;
48
49 // container for blocks
50 Cell< Block * > mBlocks ;
51
52 // the empty block is a dummy that is exposed if
53 // a set is accessed that doesn't exist on this proc
54 Block * mEmptyBlock = nullptr ;
55
56//------------------------------------------------------------------------------
57 public:
58//------------------------------------------------------------------------------
59
60 BlockData( DofManager * aParent ) ;
61
62//------------------------------------------------------------------------------
63
64 ~BlockData();
65//------------------------------------------------------------------------------
66
67 void
69
70//------------------------------------------------------------------------------
71
75 Block *
76 block( const id_t aID );
77
78//------------------------------------------------------------------------------
79
84 blocks();
85
86//------------------------------------------------------------------------------
87
91 bool
92 block_exists( const id_t aID ) const ;
93
94//------------------------------------------------------------------------------
95
96 void
97 reset();
98
99//------------------------------------------------------------------------------
100
106 static void
108 Mesh * aMesh,
109 const Map< id_t, index_t > & aBlockIndexMap,
110 Vector< id_t > & aFacetIDs );
111
112//------------------------------------------------------------------------------
113 private:
114//------------------------------------------------------------------------------
115
116 void
117 collect_thin_shell_facet_ids(
118 const Map< id_t, index_t > & aBlockIndexMap,
119 Vector< id_t > & aAllSelectedThinShellFacets );
120
121 void
122 collect_element_indices(
123 const Map< id_t, index_t > & aBlockIndexMap,
124 const Map< id_t, index_t > & aSideSetIndexMap,
125 const Vector< id_t > & aAllSelectedThinShellFacets,
126 Cell< Vector< index_t > > & aOwnedElementIndices,
127 Cell< Vector< index_t > > & aAuraElementIndices );
128
129 void
130 link_thin_shell_facets();
131
132 void
133 link_thin_shell_facets_serial();
134
135 void
136 link_thin_shell_facets_parallel();
137
138//------------------------------------------------------------------------------
139 };
140
141//------------------------------------------------------------------------------
142
143 inline Block *
145 {
146 if ( mBlockMap.key_exists( aID ) )
147 {
148 return mBlockMap( aID );
149 }
150 else
151 {
152 mEmptyBlock->set_mesh_id( aID );
153 return mEmptyBlock ;
154 }
155 }
156
157//------------------------------------------------------------------------------
158
159 inline Cell< Block * > &
161 {
162 return mBlocks ;
163 }
164
165//------------------------------------------------------------------------------
166
167 inline bool
168 BlockData::block_exists( const id_t aID ) const
169 {
170 return mBlockMap.key_exists( aID ) ;
171 }
172
173//------------------------------------------------------------------------------
174 } /* end namespace dofmgr */
175 } /* end namespace fem */
176} /* end namespace belfem */
177
178#endif //BELFEM_CL_FEM_DOFMGR_BLOCKDATA_HPP
A bounds-checked wrapper around std::vector.
Definition cl_Cell.hpp:45
Hash map (unordered key-value).
Definition cl_Map.hpp:75
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Definition cl_FEM_Block.hpp:35
Main workhorse: DOF management, assembly coordination and the solver interface.
Definition cl_FEM_DofManager.hpp:52
Top-level orchestrator.
Definition cl_FEM_Kernel.hpp:56
void reset()
Definition cl_FEM_DofMgr_BlockData.cpp:48
static void selected_thin_shell_facet_ids(Mesh *aMesh, const Map< id_t, index_t > &aBlockIndexMap, Vector< id_t > &aFacetIDs)
facet ids of the thin shells that own at least one block of aBlockIndexMap, in shell order; a shell w...
Definition cl_FEM_DofMgr_BlockData.cpp:158
Block * block(const id_t aID)
Access a block by its ID.
Definition cl_FEM_DofMgr_BlockData.hpp:144
BlockData(DofManager *aParent)
Definition cl_FEM_DofMgr_BlockData.cpp:28
bool block_exists(const id_t aID) const
tells if the block exists on current mesh
Definition cl_FEM_DofMgr_BlockData.hpp:168
Cell< Block * > & blocks()
get the block container
Definition cl_FEM_DofMgr_BlockData.hpp:160
void create_blocks()
Definition cl_FEM_DofMgr_BlockData.cpp:68
Definition cl_FEM_DofMgr_BearingData.cpp:23
Definition cl_IFB_LINE3.hpp:21
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int id_t
Definition typedefs.hpp:41
int proc_t
Definition commtypes.hpp:29