BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Mesh_Distributor.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_MESH_DISTRIBUTOR_HPP
13#define BELFEM_CL_MESH_DISTRIBUTOR_HPP
14
15#include "typedefs.hpp"
16
17#include "cl_DynamicBitset.hpp"
18#include "cl_Cell.hpp"
19
20#include "cl_Mesh.hpp"
21#include "cl_CommTable.hpp"
22
23#include "cl_ProtoMesh.hpp"
24
25namespace belfem
26{
27 namespace mesh
28 {
29
31 {
32 const proc_t mCommRank ;
33 const proc_t mCommSize ;
34
35 Mesh * mMesh = nullptr ;
36
37 bool mOwnMesh = false ;
38
39 DynamicBitset * mNodeBitset = nullptr ;
40 DynamicBitset * mElementBitset = nullptr ;
41 DynamicBitset * mEdgeBitset = nullptr ;
42 DynamicBitset * mFaceBitset = nullptr ;
43 DynamicBitset * mFacetBitset = nullptr ;
44 DynamicBitset * mVertexBitset = nullptr ;
45 DynamicBitset * mControlPointBitset = nullptr ;
46
47 // work Cell with indices
48 index_t mNumberOfAllEntities[ 14 ];
49
50 index_t & mNumberOfDimensions = mNumberOfAllEntities[ 0 ];
51 index_t & mMaxElementOrder = mNumberOfAllEntities[ 1 ];
52 index_t & mNumberOfAllNodes = mNumberOfAllEntities[ 2 ];
53 index_t & mNumberOfAbstractNodes = mNumberOfAllEntities[ 3 ];
54 index_t & mNumberOfAllEdges = mNumberOfAllEntities[ 4 ];
55 index_t & mNumberOfAllFaces = mNumberOfAllEntities[ 5 ];
56 index_t & mNumberOfAllElements = mNumberOfAllEntities[ 6 ];
57 index_t & mNumberOfAllFacets = mNumberOfAllEntities[ 7 ];
58 index_t & mNumberOfAllVertices = mNumberOfAllEntities[ 8 ];
59 index_t & mNumberOfAllControlPoints = mNumberOfAllEntities[ 9 ];
60 index_t & mNumberOfAllBlocks = mNumberOfAllEntities[ 10 ];
61 index_t & mNumberOfAllSideSets = mNumberOfAllEntities[ 11 ];
62 index_t & mNumberOfAllThinShells = mNumberOfAllEntities[ 12 ];
63 index_t & mNumberOfAllTMatrices = mNumberOfAllEntities[ 13 ];
64
65 Cell< index_t > mIndices ;
66
68 Cell< proto::ElementData * > mElementData ;
69 Cell< proto::ElementExtra * > mElementExtra ;
73 Cell< proto::FacetExtra * > mFacetExtra ;
75 Cell< proto::ControlPointData * > mControlPointData ;
77
78 Cell< CommTable * > mTables ;
79
80 ProtoMesh * mProtoMesh = nullptr ;
81
82//------------------------------------------------------------------------------
83 public:
84//------------------------------------------------------------------------------
85
86 Distributor( Mesh * aMesh = nullptr ) ;
87
88 ~Distributor() ;
89
90 void
91 run();
92
94 tables();
95
96 Mesh *
98
99//------------------------------------------------------------------------------
100 private:
101//------------------------------------------------------------------------------
102
103 void
104 count_entities();
105
106 void
107 select_entities( const proc_t aTarget );
108
109 void
110 select_sources( mesh::Basis * aBasis );
111
112 void
113 populate_t_matrices( const proc_t aTarget );
114
115 void
116 populate_node_data( const proc_t aTarget );
117
118 void
119 populate_element_data( const proc_t aTarget );
120
121 void
122 populate_element_extra( const proc_t aTarget );
123
124 void
125 populate_edge_data( const proc_t aTarget );
126
127 void
128 populate_face_data( const proc_t aTarget );
129
130 void
131 populate_facet_data( const proc_t aTarget );
132
133 void
134 populate_facet_extra( const proc_t aTarget );
135
136 void
137 populate_vertex_data( const proc_t aTarget );
138
139 void
140 populate_control_point_data( const proc_t aTarget );
141
142
143
144//------------------------------------------------------------------------------
145
146 void
147 send_thinshell_data();
148
149 void
150 receive_thinshell_data();
151
152//------------------------------------------------------------------------------
153
154 void
155 send_block_data();
156
157 void
158 receive_block_data();
159
160 void
161 send_sideset_data();
162
163 void
164 receive_sideset_data();
165
166//------------------------------------------------------------------------------
167
168 void
169 send_node_data();
170
171 void
172 receive_node_data();
173
174//------------------------------------------------------------------------------
175
176 void
177 send_element_data();
178
179 void
180 receive_element_data();
181
182//------------------------------------------------------------------------------
183
184 void
185 send_edge_data();
186
187 void
188 receive_edge_data();
189
190//------------------------------------------------------------------------------
191
192 void
193 send_face_data();
194
195 void
196 receive_face_data();
197
198//------------------------------------------------------------------------------
199
200 void
201 send_facet_data();
202
203 void
204 receive_facet_data();
205
206//------------------------------------------------------------------------------
207
208 void
209 send_element_extra( const proc_t aTarget = 0);
210
211 void
212 receive_element_extra();
213
214//------------------------------------------------------------------------------
215
216 void
217 send_facet_extra();
218
219 void
220 receive_facet_extra();
221
222//------------------------------------------------------------------------------
223
224 void
225 send_vertex_data();
226
227 void
228 receive_vertex_data();
229
230//------------------------------------------------------------------------------
231
232 void
233 send_control_point_data();
234
235 void
236 receive_control_point_data();
237
238//------------------------------------------------------------------------------
239
240 void
241 send_t_matrices();
242
243 void
244 receive_t_matrices();
245
246//------------------------------------------------------------------------------
247
248 void
249 flag_curved_elements( const proc_t aTarget );
250
251 void
252 flag_curved_facets( const proc_t aTarget );
253
254//------------------------------------------------------------------------------
255
256 void
257 create_bitsets();
258
259 void
260 delete_bitsets();
261
262 void
263 reset_bitsets();
264
265//------------------------------------------------------------------------------
266
267 void
268 delete_node_data();
269
270 void
271 delete_element_data();
272
273 void
274 delete_element_extra();
275
276 void
277 delete_edge_data();
278
279 void
280 delete_face_data();
281
282 void
283 delete_facet_data();
284
285 void
286 delete_facet_extra();
287
288 void
289 delete_vertex_data();
290
291 void
292 delete_tables();
293
294 void
295 delete_mesh_data();
296
297 void
298 delete_t_matrices();
299
300//------------------------------------------------------------------------------
301 };
302
303 inline
306 {
307 return mTables;
308 }
309
310
311 }
312}
313#endif // BELFEM_CL_MESH_DISTRIBUTOR_HPP
Runtime-sized bitset; one bit per flag, packed into 64-bit words.
Definition cl_DynamicBitset.hpp:33
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Definition cl_Mesh_Basis.hpp:33
Distributor(Mesh *aMesh=nullptr)
Definition cl_Mesh_Distributor.cpp:25
void run()
Definition cl_Mesh_Distributor.cpp:74
Mesh * partial_mesh()
Definition cl_Mesh_Distributor.cpp:2662
Cell< CommTable * > & tables()
Definition cl_Mesh_Distributor.hpp:305
Definition cl_ProtoMesh.hpp:39
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
int proc_t
Definition commtypes.hpp:29
uint32_t index_t
Definition typedefs.hpp:52