BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_InterfaceProcessor.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_INTERFACEPROCESSOR_HPP
13#define CL_INTERFACEPROCESSOR_HPP
14
15#include "typedefs.hpp"
16#include "cl_Map.hpp"
17#include "cl_Cell.hpp"
18#include "cl_Vector.hpp"
19#include "cl_Mesh.hpp"
20#include "cl_DynamicBitset.hpp"
21#include "cl_Topology.hpp"
22
23namespace belfem
24{
25 namespace mesh
26 {
27 // how an interface set ties its duplicates to their originals
29 {
30 TieWeight1, // default (ferro-air, conductor-air, conductor-ferro): duplicate hangs on its original with weight 1 (viz split only)
31 Decouple // coil-touching: duplicate carries no sources, excluded from the solve
32 };
33
35 {
36 Mesh * mMesh ;
37
38 DynamicBitset * mBitset ;
39
40 Cell< Element * > mElements ;
41 Map< id_t, Node * > mOriginals ;
42
43 Map< id_t, Node * > mDuplicates ;
44 uint mNumberOfSideSets = 0 ;
45
47
48//-----------------------------------------------------------------------------
49 Cell< SideSet * > mSideSets ;
50//-----------------------------------------------------------------------------
51 public:
52//-----------------------------------------------------------------------------
53
54 InterfaceSet( Mesh * aMesh, const string aBitsetHex );
55
57
58 void
60
61 void
63
64 void
65 add_sideset( SideSet * aSideSet );
66
68 treatment() const ;
69
70 void
72
73 void
74 duplicate_nodes( id_t & aMaxNodeID );
75
76 void
78
80 number_of_nodes() const ;
81
82 void
83 add_duplicates( index_t & aCount, Cell< Node * > & aDuplicates, Map< id_t, Node * > & aOriginalMap );
84
87
90
91 };
92
94 {
95 Mesh * mMesh ;
96 Topology * mTopology ;
97
98 Cell< Node * > & mAbstractNodes ;
99
100 const uint mNumOriginalSidesets ;
101 id_t mMaxNodeID ;
102
103 DynamicBitset * mIsAirBlock = nullptr ;
104 DynamicBitset * mIsFerroBlock = nullptr ;
105
106 Map< id_t, index_t > mBlockIndices ;
108
109 // link sidesetr IDs to set
111
112//-----------------------------------------------------------------------------
113 public:
114//-----------------------------------------------------------------------------
115
117 Mesh * aMesh,
118 Topology * aTopology,
119 Cell< Node * > & aAbstractNodes,
120 const uint aNumOriginalSideSets,
121 const id_t aMaxNodeID );
122
124
125//-----------------------------------------------------------------------------
126 private:
127//-----------------------------------------------------------------------------
128
129 void
130 create_interface_sets();
131
132 void
133 connect_sidesets_to_interface_sets();
134
135 void
136 populate_interface_sets();
137
138 void
139 duplicate_nodes();
140
141 void
142 pair_cross_set_periodic_duplicates();
143
144 void
145 relink_elements();
146
147 void
148 add_duplicate_nodes_to_mesh();
149
150 void
151 unify_duplicates( Cell< Node * > & aDuplicates );
152
153 };
154
155 inline InterfaceTreatment
157 {
158 return mTreatment ;
159 }
160
161 inline Map< id_t, Node * > &
163 {
164 return mDuplicates ;
165 }
166
167 inline Map< id_t, Node * > &
169 {
170 return mOriginals ;
171 }
172
173 }
174}
175#endif //CL_INTERFACEPROCESSOR_HPP
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Runtime-sized bitset; one bit per flag, packed into 64-bit words.
Definition cl_DynamicBitset.hpp:33
Hash map (unordered key-value).
Definition cl_Map.hpp:75
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
InterfaceProcessor(Mesh *aMesh, Topology *aTopology, Cell< Node * > &aAbstractNodes, const uint aNumOriginalSideSets, const id_t aMaxNodeID)
Definition cl_InterfaceProcessor.cpp:278
void collect_nodes_and_elements()
Definition cl_InterfaceProcessor.cpp:62
index_t number_of_nodes() const
Definition cl_InterfaceProcessor.cpp:258
void allocate_sideset_container()
Definition cl_InterfaceProcessor.cpp:49
void duplicate_nodes(id_t &aMaxNodeID)
Definition cl_InterfaceProcessor.cpp:157
Map< id_t, Node * > & original_map()
Definition cl_InterfaceProcessor.hpp:168
void increment_sideset_counter()
Definition cl_InterfaceProcessor.cpp:43
Map< id_t, Node * > & duplicate_map()
Definition cl_InterfaceProcessor.hpp:162
void add_duplicates(index_t &aCount, Cell< Node * > &aDuplicates, Map< id_t, Node * > &aOriginalMap)
Definition cl_InterfaceProcessor.cpp:264
InterfaceSet(Mesh *aMesh, const string aBitsetHex)
Definition cl_InterfaceProcessor.cpp:20
void relink_elements()
Definition cl_InterfaceProcessor.cpp:231
InterfaceTreatment treatment() const
Definition cl_InterfaceProcessor.hpp:156
void add_sideset(SideSet *aSideSet)
Definition cl_InterfaceProcessor.cpp:56
Definition cl_SideSet.hpp:29
Analyzes and classifies mesh topology for finite element simulations.
Definition cl_Topology.hpp:44
Definition cl_EF_EdgeFunction.hpp:17
InterfaceTreatment
Definition cl_InterfaceProcessor.hpp:29
@ TieWeight1
Definition cl_InterfaceProcessor.hpp:30
@ Decouple
Definition cl_InterfaceProcessor.hpp:31
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
unsigned int id_t
Definition typedefs.hpp:41
uint32_t index_t
Definition typedefs.hpp:52