BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Mesh_ConnectivityCalculator.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_MESH_CONNECTIVITYCALCULATOR_HPP
13#define CL_MESH_CONNECTIVITYCALCULATOR_HPP
14#include "typedefs.hpp"
15#include "cl_Mesh.hpp"
16#include "op_Node_Index.hpp"
17namespace belfem
18{
19 namespace mesh
20 {
34 {
36 const proc_t mCommRank ;
37
39 const proc_t mCommSize ;
40
42 Mesh * mMesh ;
43
44
45 Cell< Node * > & mNodes ;
46 Cell< Edge * > & mEdges ;
47 Cell< Face * > & mFaces;
48 Cell< Element * > & mElements ;
49 Cell< Facet * > & mFacets ;
50 Cell< ControlPoint * > & mControlPoints ;
51
54 Vector< id_t > mSelectedBlockIDs;
55
57 bool mPartialOnly = false ;
58
59 Vector< proc_t > mElementOwners ;
60 Vector< proc_t > mNodeOwners ;
61
62 key128_t ( ConnectivityCalculator:: * mKey )( Cell< Node * > & aNodes ) const ;
63
64//------------------------------------------------------------------------------
65 public:
66//------------------------------------------------------------------------------
67
73
78
82 void
84
85 void
87
88 void
90
91 void
93
94 void
96
97 void
99
100 void
102
103 void
105
106 void
108
109 void
111
112 void
114
121 void
123
132 void
134
135 void
137
138 void
140
141 void
143
149 void
150 save_connectivity_data( const string & aPath );
151
152 private:
153
154 void
155 connect_elements_to_elements_sub( Cell< Element * > & aElements );
156
158 facet_key2( Cell< Node * > & aNodes ) const ;
159
161 facet_key3( Cell< Node * > & aNodes ) const ;
162
163 };
164
165 inline key128_t ConnectivityCalculator::facet_key2( Cell< Node * > & aNodes ) const
166 {
167 sort( aNodes, opNodeIndex );
168 key128_t tNumNodes = mMesh->number_of_nodes();
169 return aNodes( 1 )->index() * tNumNodes + aNodes( 0 )->index();
170 }
171
172 inline key128_t ConnectivityCalculator::facet_key3( Cell< Node * > & aNodes ) const
173 {
174 sort( aNodes, opNodeIndex );
175 key128_t tNumNodes = mMesh->number_of_nodes();
176 return ( aNodes( 2 )->index() * tNumNodes + aNodes( 1 )->index() )
177 * tNumNodes+ aNodes( 0 )->index();
178 }
179
180 }
181}
182#endif //CL_MESH_CONNECTIVITYCALCULATOR_HPP
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
index_t number_of_nodes() const
Definition cl_Mesh.hpp:1223
void connect_nodes_to_elements()
Compute node-to-element connectivity.
Definition cl_Mesh_ConnectivityCalculator.cpp:55
void connect_facets_to_facets()
Definition cl_Mesh_ConnectivityCalculator.cpp:379
void connect_nodes_to_facets()
Definition cl_Mesh_ConnectivityCalculator.cpp:288
void connect_thin_shells_to_thin_shells()
Definition cl_Mesh_ConnectivityCalculator.cpp:1235
void save_connectivity_data(const string &aPath)
stores the computed connectivities for debugging
Definition cl_Mesh_ConnectivityCalculator.cpp:1291
ConnectivityCalculator(Mesh *aMesh)
Constructor.
Definition cl_Mesh_ConnectivityCalculator.cpp:33
void connect_nodes_to_nodes()
Compute node-to-node connectivity.
Definition cl_Mesh_ConnectivityCalculator.cpp:330
void connect_control_points_to_control_points()
Definition cl_Mesh_ConnectivityCalculator.cpp:121
void connect_faces_to_ghost_facets()
Definition cl_Mesh_ConnectivityCalculator.cpp:719
void connect_control_points_to_elements()
Definition cl_Mesh_ConnectivityCalculator.cpp:89
void connect_edges_to_elements(Cell< Element * > &aElements)
Definition cl_Mesh_ConnectivityCalculator.cpp:588
void connect_facets_to_elements()
Definition cl_Mesh_ConnectivityCalculator.cpp:165
void connect_nodes_to_edges()
Definition cl_Mesh_ConnectivityCalculator.cpp:554
void connect_elements_to_elements()
Compute element-to-element connectivity.
Definition cl_Mesh_ConnectivityCalculator.cpp:1030
void connect_faces_to_faces()
Definition cl_Mesh_ConnectivityCalculator.cpp:923
void connect_edges_to_edges()
Definition cl_Mesh_ConnectivityCalculator.cpp:744
void connect_faces_to_edges_and_edges_to_faces()
Definition cl_Mesh_ConnectivityCalculator.cpp:848
void connect_edges_to_ghost_facets()
Definition cl_Mesh_ConnectivityCalculator.cpp:630
Definition cl_EF_EdgeFunction.hpp:17
struct belfem::mesh::OpNodeIndex opNodeIndex
USER GUIDES:
Definition cl_Capacitor.cpp:16
__uint128_t key128_t
Definition typedefs.hpp:44
int proc_t
Definition commtypes.hpp:29
void sort(Cell< T > &aCell)
Definition cl_Cell.hpp:455