BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Topology.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 CL_TOPOLOGY_HPP
13#define CL_TOPOLOGY_HPP
14#include "cl_DynamicBitset.hpp"
15#include "cl_Map.hpp"
16#include "cl_Mesh.hpp"
17#include "en_DomainType.hpp"
18
19namespace belfem
20{
21 namespace mesh
22 {
23//------------------------------------------------------------------------------
44 {
45 const proc_t mCommRank ;
46 Mesh * mMesh ;
47
48 Vector< id_t > mPhiInterfaceIDs ;
49 Vector< id_t > mPhiBoundaryIDs ;
50 Vector< id_t > mPhiPeriodicIDs ;
51
53
54 Map< id_t, DomainType > mBlockTypes ;
55
56 // needed for the cut factory
57 Vector< id_t > mPhiBlockIDs;
58 Vector< id_t > mNonPhiBlockIDs;
59
60 // enrichment entities to skip when scanning a reloaded mesh
61 // ( filled by run_on_enriched_mesh, empty on the fresh path )
62 Map< id_t, index_t > mEnrichedBlocks ;
63 Map< id_t, index_t > mEnrichedSideSets ;
64
65 public:
66
67 Topology( Mesh * aMesh );
68
69 ~Topology();
70
71 void
72 run();
73
81 void
83
84 const Vector< id_t > &
85 groups( const DomainType aType ) const;
86
87 const Vector< id_t > &
88 phi_block_ids() const ;
89
90 const Vector< id_t > &
91 non_phi_block_ids() const ;
92
93 const Vector< id_t > &
94 phi_interface_ids() const ;
95
96 const Vector< id_t > &
97 phi_boundary_ids() const ;
98
99 const Vector< id_t > &
100 phi_periodic_ids() const ;
101
103 sideset_type( const DomainType aMaster, const DomainType aSlave );
104
106 sideset_type( const DomainType aMaster );
107
109 block_map() const ;
110
111 void
113
114//------------------------------------------------------------------------------
115 private:
116//------------------------------------------------------------------------------
117
118 void
119 collect_enrichment_ids();
120
121 void
122 collect_block_and_sideset_types();
123
124 void
125 detect_sideset_types();
126
127 void
128 select_blocks();
129
130 void
131 select_sidesets();
132
133 void
134 update_block_map();
135
136 };
137
138//------------------------------------------------------------------------------
139
140 inline const Vector< id_t > &
141 Topology::groups( const DomainType aType ) const
142 {
143 return *mTypeMap( aType );
144 }
145
146 inline const Map< id_t, DomainType > &
148 {
149 return mBlockTypes ;
150 }
151
152 inline const Vector< id_t > &
154 {
155 return mPhiBlockIDs ;
156 }
157
158 inline const Vector< id_t > &
160 {
161 return mPhiBoundaryIDs ;
162 }
163
164 inline const Vector< id_t > &
166 {
167 return mPhiPeriodicIDs ;
168 }
169
170 inline const Vector< id_t > &
172 {
173 return mPhiInterfaceIDs ;
174 }
175
176 inline const Vector< id_t > &
178 {
179 return mNonPhiBlockIDs ;
180 }
181
182
183//------------------------------------------------------------------------------
184 }
185}
186#endif //CL_TOPOLOGY_HPP
Hash map (unordered key-value).
Definition cl_Map.hpp:75
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
const Vector< id_t > & phi_block_ids() const
Definition cl_Topology.hpp:153
void synchronize_maps()
Definition cl_Topology.cpp:89
const Map< id_t, DomainType > & block_map() const
Definition cl_Topology.hpp:147
const Vector< id_t > & phi_periodic_ids() const
Definition cl_Topology.hpp:165
DomainType sideset_type(const DomainType aMaster, const DomainType aSlave)
Definition cl_Topology.cpp:280
void run_on_enriched_mesh()
variant of run() for a mesh that was restored from a .bfm file: the fresh path builds the maps BEFORE...
Definition cl_Topology.cpp:50
const Vector< id_t > & phi_interface_ids() const
Definition cl_Topology.hpp:171
const Vector< id_t > & phi_boundary_ids() const
Definition cl_Topology.hpp:159
Topology(Mesh *aMesh)
Definition cl_Topology.cpp:22
void run()
Definition cl_Topology.cpp:38
const Vector< id_t > & non_phi_block_ids() const
Definition cl_Topology.hpp:177
const Vector< id_t > & groups(const DomainType aType) const
Definition cl_Topology.hpp:141
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
int proc_t
Definition commtypes.hpp:29
DomainType
Definition en_DomainType.hpp:20