BELFEM 0.9.3
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 Cell< Node * > & mNodes ;
45 Cell< Edge * > & mEdges ;
46 Cell< Face * > & mFaces;
47 Cell< Element * > & mElements ;
48 Cell< Facet * > & mFacets ;
49 Cell< ControlPoint * > & mControlPoints ;
50
53 Vector< id_t > mSelectedBlockIDs;
54
56 bool mPartialOnly = false ;
57
58 Vector< proc_t > mElementOwners ;
59 Vector< proc_t > mNodeOwners ;
60
61 key128_t ( ConnectivityCalculator:: * mKey )( Cell< Node * > & aNodes ) const ;
62
63//------------------------------------------------------------------------------
64 public:
65//------------------------------------------------------------------------------
66
68
71
72 void
74
75 void
77
78 void
80
81 void
83
84 void
86
87 void
89
90 void
92
93 void
95
96 void
98
99 void
101
102 void
104
111 void
113
122 void
124
125 void
127
128 void
130
131 void
133
139 void
140 save_connectivity_data( const string & aPath );
141
142 private:
143
144 void
145 connect_elements_to_elements_sub( Cell< Element * > & aElements );
146
148 facet_key2( Cell< Node * > & aNodes ) const ;
149
151 facet_key3( Cell< Node * > & aNodes ) const ;
152
153 };
154
155 inline key128_t ConnectivityCalculator::facet_key2( Cell< Node * > & aNodes ) const
156 {
157 sort( aNodes, opNodeIndex );
158 key128_t tNumNodes = mMesh->number_of_nodes();
159 return aNodes( 1 )->index() * tNumNodes + aNodes( 0 )->index();
160 }
161
162 inline key128_t ConnectivityCalculator::facet_key3( Cell< Node * > & aNodes ) const
163 {
164 sort( aNodes, opNodeIndex );
165 key128_t tNumNodes = mMesh->number_of_nodes();
166 return ( aNodes( 2 )->index() * tNumNodes + aNodes( 1 )->index() )
167 * tNumNodes+ aNodes( 0 )->index();
168 }
169
170 }
171}
172#endif //CL_MESH_CONNECTIVITYCALCULATOR_HPP
A bounds-checked wrapper around std::vector.
Definition cl_Cell.hpp:45
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
index_t number_of_nodes() const
Definition cl_Mesh.hpp:1239
void connect_nodes_to_elements()
Definition cl_Mesh_ConnectivityCalculator.cpp:55
void connect_facets_to_facets()
Definition cl_Mesh_ConnectivityCalculator.cpp:378
void connect_nodes_to_facets()
Definition cl_Mesh_ConnectivityCalculator.cpp:288
void connect_thin_shells_to_thin_shells()
Definition cl_Mesh_ConnectivityCalculator.cpp:1233
void save_connectivity_data(const string &aPath)
stores the computed connectivities for debugging
Definition cl_Mesh_ConnectivityCalculator.cpp:1289
ConnectivityCalculator(Mesh *aMesh)
Definition cl_Mesh_ConnectivityCalculator.cpp:33
void connect_nodes_to_nodes()
Compute node-to-node connectivity.
Definition cl_Mesh_ConnectivityCalculator.cpp:329
void connect_control_points_to_control_points()
Definition cl_Mesh_ConnectivityCalculator.cpp:121
void connect_faces_to_ghost_facets()
Definition cl_Mesh_ConnectivityCalculator.cpp:717
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:587
void connect_facets_to_elements()
Definition cl_Mesh_ConnectivityCalculator.cpp:165
void connect_nodes_to_edges()
Definition cl_Mesh_ConnectivityCalculator.cpp:553
void connect_elements_to_elements()
Compute element-to-element connectivity.
Definition cl_Mesh_ConnectivityCalculator.cpp:1028
void connect_faces_to_faces()
Definition cl_Mesh_ConnectivityCalculator.cpp:921
void connect_edges_to_edges()
Definition cl_Mesh_ConnectivityCalculator.cpp:742
void connect_faces_to_edges_and_edges_to_faces()
Definition cl_Mesh_ConnectivityCalculator.cpp:846
void connect_edges_to_ghost_facets()
Definition cl_Mesh_ConnectivityCalculator.cpp:628
Definition cl_EF_EdgeFunction.hpp:24
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:431