BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_FaceFactory.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_FACEFACTORY_HPP
13#define BELFEM_CL_FACEFACTORY_HPP
14#include "typedefs.hpp"
15#include "cl_Cell.hpp"
16#include "cl_Map.hpp"
17#include "cl_Vector.hpp"
18
19namespace belfem
20{
21 class Mesh ;
22
23 namespace mesh
24 {
25 class Node ;
26 class Face ;
27 class Element ;
28
29//-----------------------------------------------------------------------
30
32 {
33 const proc_t mCommRank ;
34
35 // ref to mesh we work on
36 Mesh & mMesh ;
37
38 const key128_t mNumberOfNodes ;
39
40//-----------------------------------------------------------------------
41 public:
42//-----------------------------------------------------------------------
43
44 FaceFactory( Mesh & aMesh );
45
46//-----------------------------------------------------------------------
47
48 FaceFactory( Mesh * aMesh );
49
50//-----------------------------------------------------------------------
51
52 ~FaceFactory() = default ;
53
54//----------------------------------------------------------------------
55
56 void
57 create_faces( const Vector< id_t > aNedelecBlocks = Vector< id_t >(),
58 const Vector< id_t > aNedelecSideSets = Vector< id_t >() );
59
60//----------------------------------------------------------------------
61
62 void
63 print();
64
65//-----------------------------------------------------------------------
66 private:
67//-----------------------------------------------------------------------
68
70 face_key_2d(
71 Element * aElement,
72 Cell< Node * > & aWork );
73
74//-----------------------------------------------------------------------
75
77 face_key_3d(
78 Element * aElement,
79 const uint aFaceIndex,
80 Cell< Node * > & aWork );
81
82//-----------------------------------------------------------------------
83
84 void
85 get_all_block_ids( Vector< id_t > & aBlockIDs ) ;
86
87//-----------------------------------------------------------------------
88
90 count_faces(
91 const Vector< id_t > & aBlockIDs,
92 const Vector< id_t > & aSideSetIDs,
93 Map< key128_t, index_t >& aFaceMap );
94
95//-----------------------------------------------------------------------
96
97 void
98 find_face_owners(
99 const Vector< id_t > & aBlockIDs,
100 const Vector< id_t > & aSideSetIDs,
101 const index_t & aNumFaces,
102 const Map< key128_t, index_t > & aFaceMap,
103 Vector< id_t > & aMasterIDs,
104 Vector< index_t > & aMasterIndex,
105 Vector< id_t > & aSlaveIDs,
106 Vector< index_t > & aSlaveIndex );
107
108//----------------------------------------------------------------------
109
110 void
111 allocate_face_containers( Vector< id_t > & aBlockIDs );
112
113//----------------------------------------------------------------------
114
115
116 // block faces in 2d
117 void
118 create_faces_2d( const Vector< id_t > & aBlockIDs );
119
120//----------------------------------------------------------------------
121
122 void
123 create_faces_3d(
124 Vector< id_t > & aMasterOwner,
125 Vector< index_t > & aMasterIndex,
126 Vector< id_t > & aSlaveOwner,
127 Vector< index_t > & aSlaveIndex );
128
129//----------------------------------------------------------------------
130
131 // fix the ids for selected sidesets
132 void
133 set_face_ids( const Vector< id_t > & aSideSets, const Map< key128_t, index_t > & aFaceMap );
134
135//----------------------------------------------------------------------
136 };
137
138//-----------------------------------------------------------------------
139 }
140}
141#endif //BELFEM_CL_FACEFACTORY_HPP
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Hash map (unordered key-value).
Definition cl_Map.hpp:75
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Lagrange Element baseclass.
Definition cl_Element.hpp:35
void print()
Definition cl_FaceFactory.cpp:696
FaceFactory(Mesh &aMesh)
Definition cl_FaceFactory.cpp:37
void create_faces(const Vector< id_t > aNedelecBlocks=Vector< id_t >(), const Vector< id_t > aNedelecSideSets=Vector< id_t >())
Definition cl_FaceFactory.cpp:76
Definition cl_Face.hpp:29
Definition cl_Node.hpp:30
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
__uint128_t key128_t
Definition typedefs.hpp:44
unsigned int uint
Definition typedefs.hpp:30
int proc_t
Definition commtypes.hpp:29
uint32_t index_t
Definition typedefs.hpp:52