BELFEM
0.9.0
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
private
:
101
//------------------------------------------------------------------------------
102
103
void
104
collect_thin_shell_facet_ids(
105
const
Map< id_t, index_t >
& aBlockIndexMap,
106
Vector< id_t >
& aAllSelectedThinShellFacets );
107
108
void
109
collect_element_indices(
110
const
Map< id_t, index_t >
& aBlockIndexMap,
111
const
Map< id_t, index_t >
& aSideSetIndexMap,
112
const
Vector< id_t >
& aAllSelectedThinShellFacets,
113
Cell
<
Vector< index_t >
> & aOwnedElementIndices,
114
Cell
<
Vector< index_t >
> & aAuraElementIndices );
115
116
void
117
link_thin_shell_facets();
118
119
void
120
link_thin_shell_facets_serial();
121
122
void
123
link_thin_shell_facets_parallel();
124
125
//------------------------------------------------------------------------------
126
};
127
128
//------------------------------------------------------------------------------
129
130
inline
Block
*
131
BlockData::block
(
const
id_t
aID )
132
{
133
if
( mBlockMap.key_exists( aID ) )
134
{
135
return
mBlockMap( aID );
136
}
137
else
138
{
139
mEmptyBlock->set_mesh_id( aID );
140
return
mEmptyBlock ;
141
}
142
}
143
144
//------------------------------------------------------------------------------
145
146
inline
Cell< Block * >
&
147
BlockData::blocks
()
148
{
149
return
mBlocks ;
150
}
151
152
//------------------------------------------------------------------------------
153
154
inline
bool
155
BlockData::block_exists
(
const
id_t
aID )
const
156
{
157
return
mBlockMap.key_exists( aID ) ;
158
}
159
160
//------------------------------------------------------------------------------
161
}
/* end namespace dofmgr */
162
}
/* end namespace fem */
163
}
/* end namespace belfem */
164
165
#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
Cell is a wrapper around the standard vector.
Definition
cl_Cell.hpp:42
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
this class creates the DOFs based on the passed equation object.
Definition
cl_FEM_DofManager.hpp:55
belfem::fem::Kernel
Top-level orchestrator; owns the mesh, materials, boundary conditions and DOF managers.
Definition
cl_FEM_Kernel.hpp:50
belfem::fem::dofmgr::BlockData::reset
void reset()
Definition
cl_FEM_DofMgr_BlockData.cpp:48
belfem::fem::dofmgr::BlockData::block
Block * block(const id_t aID)
Access a block by its ID.
Definition
cl_FEM_DofMgr_BlockData.hpp:131
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:155
belfem::fem::dofmgr::BlockData::blocks
Cell< Block * > & blocks()
get the block container
Definition
cl_FEM_DofMgr_BlockData.hpp:147
belfem::fem::dofmgr::BlockData::create_blocks
void create_blocks()
Definition
cl_FEM_DofMgr_BlockData.cpp:69
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