BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
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
19
namespace
belfem
20
{
21
namespace
mesh
22
{
23
//------------------------------------------------------------------------------
43
class
Topology
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
52
Map< DomainType, Vector< id_t >
* > mTypeMap ;
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
82
run_on_enriched_mesh
();
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
102
DomainType
103
sideset_type
(
const
DomainType
aMaster,
const
DomainType
aSlave );
104
105
DomainType
106
sideset_type
(
const
DomainType
aMaster );
107
108
const
Map< id_t, DomainType >
&
109
block_map
()
const
;
110
111
void
112
synchronize_maps
();
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 >
&
147
Topology::block_map
()
const
148
{
149
return
mBlockTypes ;
150
}
151
152
inline
const
Vector< id_t >
&
153
Topology::phi_block_ids
()
const
154
{
155
return
mPhiBlockIDs ;
156
}
157
158
inline
const
Vector< id_t >
&
159
Topology::phi_boundary_ids
()
const
160
{
161
return
mPhiBoundaryIDs ;
162
}
163
164
inline
const
Vector< id_t >
&
165
Topology::phi_periodic_ids
()
const
166
{
167
return
mPhiPeriodicIDs ;
168
}
169
170
inline
const
Vector< id_t >
&
171
Topology::phi_interface_ids
()
const
172
{
173
return
mPhiInterfaceIDs ;
174
}
175
176
inline
const
Vector< id_t >
&
177
Topology::non_phi_block_ids
()
const
178
{
179
return
mNonPhiBlockIDs ;
180
}
181
182
183
//------------------------------------------------------------------------------
184
}
185
}
186
#endif
//CL_TOPOLOGY_HPP
cl_DynamicBitset.hpp
cl_Map.hpp
cl_Mesh.hpp
belfem::Map
Hash map (unordered key-value).
Definition
cl_Map.hpp:75
belfem::Mesh
Top-level container for all mesh entities.
Definition
cl_Mesh.hpp:60
belfem::Vector< id_t >
belfem::mesh::Topology::phi_block_ids
const Vector< id_t > & phi_block_ids() const
Definition
cl_Topology.hpp:153
belfem::mesh::Topology::synchronize_maps
void synchronize_maps()
Definition
cl_Topology.cpp:89
belfem::mesh::Topology::block_map
const Map< id_t, DomainType > & block_map() const
Definition
cl_Topology.hpp:147
belfem::mesh::Topology::phi_periodic_ids
const Vector< id_t > & phi_periodic_ids() const
Definition
cl_Topology.hpp:165
belfem::mesh::Topology::sideset_type
DomainType sideset_type(const DomainType aMaster, const DomainType aSlave)
Definition
cl_Topology.cpp:280
belfem::mesh::Topology::run_on_enriched_mesh
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
belfem::mesh::Topology::phi_interface_ids
const Vector< id_t > & phi_interface_ids() const
Definition
cl_Topology.hpp:171
belfem::mesh::Topology::phi_boundary_ids
const Vector< id_t > & phi_boundary_ids() const
Definition
cl_Topology.hpp:159
belfem::mesh::Topology::Topology
Topology(Mesh *aMesh)
Definition
cl_Topology.cpp:22
belfem::mesh::Topology::run
void run()
Definition
cl_Topology.cpp:38
belfem::mesh::Topology::non_phi_block_ids
const Vector< id_t > & non_phi_block_ids() const
Definition
cl_Topology.hpp:177
belfem::mesh::Topology::groups
const Vector< id_t > & groups(const DomainType aType) const
Definition
cl_Topology.hpp:141
en_DomainType.hpp
belfem::mesh
Definition
cl_EF_EdgeFunction.hpp:17
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
belfem::proc_t
int proc_t
Definition
commtypes.hpp:29
belfem::DomainType
DomainType
Definition
en_DomainType.hpp:20
src
homology
cl_Topology.hpp
Generated by
1.18.0