BELFEM
0.9.3
Berkeley Lab Finite Element Framework
Toggle main menu visibility
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
"
20
namespace
belfem
21
{
22
class
Mesh
;
23
24
namespace
fem
25
{
26
class
Kernel
;
27
class
DofManager
;
28
29
namespace
dofmgr
30
{
31
class
BlockData
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
68
create_blocks
();
69
70
//------------------------------------------------------------------------------
71
75
Block
*
76
block
(
const
id_t
aID );
77
78
//------------------------------------------------------------------------------
79
83
Cell< Block * >
&
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
107
selected_thin_shell_facet_ids
(
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
*
144
BlockData::block
(
const
id_t
aID )
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 * >
&
160
BlockData::blocks
()
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
cl_Cell.hpp
cl_FEM_Block.hpp
cl_IWG.hpp
cl_Map.hpp
cl_Vector.hpp
belfem::Cell
A bounds-checked wrapper around std::vector.
Definition
cl_Cell.hpp:45
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::fem::Block
Definition
cl_FEM_Block.hpp:35
belfem::fem::DofManager
Main workhorse: DOF management, assembly coordination and the solver interface.
Definition
cl_FEM_DofManager.hpp:52
belfem::fem::Kernel
Top-level orchestrator.
Definition
cl_FEM_Kernel.hpp:56
belfem::fem::dofmgr::BlockData::reset
void reset()
Definition
cl_FEM_DofMgr_BlockData.cpp:48
belfem::fem::dofmgr::BlockData::selected_thin_shell_facet_ids
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
belfem::fem::dofmgr::BlockData::block
Block * block(const id_t aID)
Access a block by its ID.
Definition
cl_FEM_DofMgr_BlockData.hpp:144
belfem::fem::dofmgr::BlockData::BlockData
BlockData(DofManager *aParent)
Definition
cl_FEM_DofMgr_BlockData.cpp:28
belfem::fem::dofmgr::BlockData::block_exists
bool block_exists(const id_t aID) const
tells if the block exists on current mesh
Definition
cl_FEM_DofMgr_BlockData.hpp:168
belfem::fem::dofmgr::BlockData::blocks
Cell< Block * > & blocks()
get the block container
Definition
cl_FEM_DofMgr_BlockData.hpp:160
belfem::fem::dofmgr::BlockData::create_blocks
void create_blocks()
Definition
cl_FEM_DofMgr_BlockData.cpp:68
belfem::fem::dofmgr
Definition
cl_FEM_DofMgr_BearingData.cpp:23
belfem::fem
Definition
cl_IFB_LINE3.hpp:21
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
belfem::id_t
unsigned int id_t
Definition
typedefs.hpp:41
belfem::proc_t
int proc_t
Definition
commtypes.hpp:29
typedefs.hpp
src
fem
kernel
cl_FEM_DofMgr_BlockData.hpp
Generated by
1.18.0