BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_EdgeFactory.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_EDGEFACTORY_HPP
13#define BELFEM_CL_EDGEFACTORY_HPP
14
15#include "typedefs.hpp"
16#include "assert.hpp"
17#include "cl_Cell.hpp"
18#include "cl_Element.hpp"
19#include "cl_Edge.hpp"
20#include "cl_Node.hpp"
21#include "cl_Graph_Vertex.hpp"
22#include "cl_Mesh.hpp"
23#include "cl_Map.hpp"
24namespace belfem
25{
26 namespace mesh
27 {
28//-----------------------------------------------------------------------
29
31 {
32 const proc_t mCommRank ;
33
34 // ref to mesh we work on
35 Mesh & mMesh ;
36
37 // number of nodes on mesh
38 const key_t mNumberOfNodes ;
39
40 // container for relevant elements
41 Cell< Element * > mElements ;
42
43 // map for edges
45
46 // max order of elements
47 uint mElementOrder = 0;
48
49//-----------------------------------------------------------------------
50 public:
51//-----------------------------------------------------------------------
52
53 EdgeFactory( Mesh & aMesh );
54
55//-----------------------------------------------------------------------
56
57 EdgeFactory( Mesh * aMesh );
58
59//-----------------------------------------------------------------------
60
61 ~EdgeFactory() = default ;
62
63//----------------------------------------------------------------------
64
65 void
66 create_edges( const Vector< id_t > aNedelecBlocks = Vector< id_t >(),
67 const Vector< id_t > aNedelecSideSets = Vector< id_t >(),
68 const bool aCreateEdgesOnAllSideSets = true);
69
70//----------------------------------------------------------------------
71
72 // print result for debugging
73 void
74 print();
75
76//----------------------------------------------------------------------
77 private:
78//----------------------------------------------------------------------
79
80 // a routine for the lazy that collects all block IDs
81 void
82 get_all_block_ids( Vector< id_t > & aBlockIDs );
83
84//----------------------------------------------------------------------
85
86 void
87 collect_elements(
88 const Vector< id_t > & aBlockIDs,
89 const Vector< id_t > & aSideSetIDs,
90 const bool aCreateEdgesOnAllSideSets );
91
92//----------------------------------------------------------------------
93
94 // create edge IDs
95 void
96 create_edge_keys( Vector< key_t > & aIDs );
97
98//----------------------------------------------------------------------
99
100 key_t
101 edge_key( Element * aElement, const uint aEdgeIndex,
102 Cell< Node * > & aNodes );
103
104//----------------------------------------------------------------------
105
106 void
107 create_edges_on_master( const Vector< key_t > & aKeys );
108
109//----------------------------------------------------------------------
110
111 void
112 link_elements_to_edges();
113
114//----------------------------------------------------------------------
115
116 void
117 link_curves_to_edges();
118
119//----------------------------------------------------------------------
120
121 void
122 compute_edge_ownerships();
123
124//----------------------------------------------------------------------
125
129 void
130 grab_nodes( const key_t aKey, Cell< Node* > & aNodes );
131
132//-----------------------------------------------------------------------
133
134 void
135 set_edge_ids();
136
137//-----------------------------------------------------------------------
138 };
139
140//-----------------------------------------------------------------------
141 }
142}
143#endif //BELFEM_CL_EDGEFACTORY_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
void create_edges(const Vector< id_t > aNedelecBlocks=Vector< id_t >(), const Vector< id_t > aNedelecSideSets=Vector< id_t >(), const bool aCreateEdgesOnAllSideSets=true)
Definition cl_EdgeFactory.cpp:70
void print()
Definition cl_EdgeFactory.cpp:524
EdgeFactory(Mesh &aMesh)
Definition cl_EdgeFactory.cpp:30
Lagrange Element baseclass.
Definition cl_Element.hpp:35
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
int proc_t
Definition commtypes.hpp:29
long long unsigned int key_t
Definition typedefs.hpp:43