12#ifndef CL_FEM_THINSHELLFACTORY_HPP
13#define CL_FEM_THINSHELLFACTORY_HPP
28 const uint mNumDimensions ;
41 bool hasDuplicates = false ;
70 const real aCoatingThickness,
73 const bool aFuseSideEdges )
81 uint tNumNodesPerEdge = aLayer->Edges.first()->number_of_nodes() ;
82 InnerNodeReference.
reserve( aEdgeIndices.
size() * tNumNodesPerEdge );
84 for (
index_t e : aEdgeIndices )
86 aLayer->Edges( e )->unflag_nodes( 7 );
89 for (
index_t e : aEdgeIndices )
91 Edge * tEdge = aLayer->Edges( e );
92 InnerEdgeReference.
push( tEdge );
99 InnerNodeReference.
push( tNode );
103 for (
index_t e : aEdgeIndices )
105 aLayer->Edges( e )->unflag_nodes( 7 );
109 if ( aLayer->hasDuplicates )
111 InnerEdgeDuplicateReference.
reserve( aEdgeIndices.size() );
112 for (
index_t e : aEdgeIndices )
114 InnerEdgeDuplicateReference.
push( aLayer->EdgeDuplicates( e ) );
121 for (
Node * tNode : InnerNodeReference )
123 tNodeIndices( tCount ) = tNode->index();
124 tNode->set_index( tCount++ );
128 InnerNodes.
set_size( InnerNodeReference.size(),
nullptr );
129 OuterNodes.
set_size( InnerNodeReference.size(),
nullptr );
131 index_t tEdgeOrder = InnerEdgeReference.
first()->number_of_nodes() - 1 ;
142 for (
Edge * tEdge : InnerEdgeReference )
144 Edge * tRef = aReferenceEdges( aEdgeIndices( tCount++ ) );
146 bool tIsReversed = tRef->
node( 1 )->
original() == aCurve->
nodes()( off )->original();
149 "Can't determine edge orientation along curve %lu",
150 (
long unsigned int ) aCurve->
id() );
152 for (
uint k=0; k<tEdge->number_of_nodes(); ++k )
156 if ( OuterNodes( tNode->
index() ) ==
nullptr )
162 tB = tIsReversed ? aBinomials.
col( off + tEdgeOrder ) : aBinomials.
col( off );
167 tB = tIsReversed ? aBinomials.
col( off ) : aBinomials.
col( off + tEdgeOrder );
172 tB = aBinomials.
col( off + 1 );
183 Node * tDupI =
new Node( ++aMaxNodeID, tX( 0 ), tX( 1 ), tX( 2 ) );
184 tX += aSign * tB * aCoatingThickness ;
192 for (
uint d=0; d<n; ++d )
198 for (
Node * tDup : tSwap )
210 Node * tDupO =
new Node( ++aMaxNodeID, tX( 0 ), tX( 1 ), tX( 2 ) );
232 InnerNodes( tNode->
index() ) = tDupI ;
233 OuterNodes( tNode->
index() ) = tDupO ;
243 for (
uint d=0; d<2; ++d )
245 Cell< Edge * > & tReferenceEdges = d==0 ? InnerEdgeReference : InnerEdgeDuplicateReference ;
246 Cell< Edge * > & tInnerEdges = d==0 ? InnerEdges : InnerEdgeDuplicates ;
247 Cell< Edge * > & tOuterEdges = d==0 ? OuterEdges : OuterEdgeDuplicates ;
253 for (
Edge * tEdge : tReferenceEdges )
256 tDupI->
set_id( ++aMaxEdgeID );
258 for (
uint k=0; k<tEdge->number_of_nodes(); ++k )
265 Node * tSlotNode = d == 0 ?
266 tEdge->node( k ) : tEdge->node( k )->original() ;
269 if ( tEdge->is_hanging() )
272 for (
uint s=0; s<tEdge->number_of_sources(); ++s )
274 tDupI->
add_source( tEdge->source( s ), tEdge->weight( s ) );
283 tInnerEdges.
push( tDupI );
286 tDupO->
set_id( ++aMaxEdgeID );
288 for (
uint k=0; k<tEdge->number_of_nodes(); ++k )
291 Node * tSlotNode = d == 0 ?
292 tEdge->node( k ) : tEdge->node( k )->original() ;
295 tOuterEdges.
push( tDupO );
301 Edge * tOrg = aReferenceEdges( aEdgeIndices( tCount++ ) );
312 if ( ! aLayer->hasDuplicates ) break ;
318 for (
Node * tNode : InnerNodeReference )
320 tNode->set_index( tNodeIndices( tCount ) );
321 InnerNodes( tCount )->set_index( tNodeIndices( tCount ) );
322 OuterNodes( tCount )->set_index( tNodeIndices( tCount ) );
328 ~SideLayer() = default ;
334 real mConnectorWidth = 0.0 ;
336 bool mCreateGhostFacets = false ;
338 bool mCreateSideConnectors = false ;
339 bool mConnectorsForAllLayers = true ;
354 bool mFuseEdges = false ;
355 bool mFuseEdgesWhenHavingSideConnectors = false ;
380 const bool aCreateGhostFacets =
false );
398 create_side_connectors(
411 reset_node_indices();
439 const key_t aNumNodes,
444 create_edge_to_face_map(
448 Map<
index_t, std::pair< index_t, int8_t > > & aMap );
451 compute_side_edge_indices(
454 const key_t aNumNodes ,
455 const uint aEdgeOrder,
474 compute_side_authority(
491 SideLayer * aSideLayer,
546 create_nodes_on_layers(
555 create_edges_on_layers(
563 create_faces_on_layers(
571 create_temporary_edges(
579 create_elements_on_blocks_line2(
589 create_elements_on_blocks_line3(
599 create_elements_on_blocks_tri3(
609 create_elements_on_blocks_tri6(
619 link_elements_with_edges(
627 link_elements_with_faces(
667 compute_binomial_vectors(
683 create_periodic_sideset(
685 const bool aMaster );
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
void set_size(const size_t aSize)
Definition cl_Cell.hpp:189
T & first()
Definition cl_Cell.hpp:318
size_t size() const
return the size of the Cell
Definition cl_Cell.hpp:181
void push(const T &aValue)
push an entry to the end of the cell (copy version)
Definition cl_Cell.hpp:262
void reserve(const size_t aSize)
reserve memory
Definition cl_Cell.hpp:251
Hash map (unordered key-value).
Definition cl_Map.hpp:75
auto col(const size_t aColIndex) -> decltype(mMatrix.col(aColIndex))
Definition cl_AR_Matrix.hpp:347
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Thin shell configuration object for electromagnetic simulations.
Definition cl_Protoshell.hpp:41
virtual index_t index() const
Definition cl_Graph_Vertex.hpp:234
void set_id(const id_t aID)
Definition cl_Graph_Vertex.hpp:210
virtual void flag(const uint8_t aIndex=0)
Definition cl_Graph_Vertex.hpp:273
virtual bool is_flagged(const uint8_t aIndex=0) const
Definition cl_Graph_Vertex.hpp:293
bool is_hanging() const
Definition cl_Mesh_Basis.hpp:232
void add_source(Basis *aSource, const real aWeight=1.0)
Definition cl_Mesh_Basis.cpp:331
uint number_of_sources() const
Definition cl_Mesh_Basis.hpp:240
void allocate_source_container(uint aNumSources)
Definition cl_Mesh_Basis.cpp:308
real weight(const uint aIndex) const
Definition cl_Mesh_Basis.hpp:350
Basis * source(const uint aIndex)
Definition cl_Mesh_Basis.hpp:324
Definition cl_Curve.hpp:27
Cell< Node * > & nodes()
Definition cl_Curve.hpp:155
id_t id() const
Definition cl_Curve.hpp:143
Special Edge class for NEDELEC-Type elements.
Definition cl_Edge.hpp:30
Edge()
Definition cl_Edge.cpp:20
Definition cl_Node.hpp:30
void reset_duplicate_container()
Definition cl_Node.hpp:277
void add_duplicate(Node *aNode)
Definition cl_Node.hpp:289
void get_coords(Vector< real > &aCoords)
Definition cl_Node.hpp:369
void allocate_duplicate_container(const uint aSize)
Definition cl_Node.hpp:259
Node(const id_t &aID, const real aX=0.0, const real aY=0.0, const real aZ=0.0)
Definition cl_Node.cpp:21
Node * original()
returns the original of this node
Definition cl_Node.hpp:318
uint number_of_duplicates() const
returns the number of duplicates of this node
Definition cl_Node.hpp:226
Node * duplicate(const uint aIndex)
returns duplicates of this node
Definition cl_Node.hpp:245
void set_original(Node *aNode)
Definition cl_Node.hpp:297
Definition cl_SideSet.hpp:29
ThinShell * create(Protoshell *aProtoShell)
Definition cl_ThinShellFactory.cpp:70
ThinShellFactory(Mesh *aMesh, Cell< Node * > &aMasterNodes, Cell< Node * > &aSlaveNodes, Map< string, Material * > *aMaterialMap=nullptr, const bool aCreateGhostFacets=false)
Definition cl_ThinShellFactory.cpp:31
void flag_periodic_nodes()
Definition cl_ThinShellFactory.cpp:2941
void unflag_periodic_nodes()
Definition cl_ThinShellFactory.cpp:2959
the thin shell class is a data container needed to link element masters and slaves to thin shell bloc...
Definition cl_ThinShell.hpp:31
uint number_of_nodes() const override
Definition cl_Vertex.hpp:296
void allocate_node_container(const uint aCounter=0)
Definition cl_Vertex.cpp:65
Node * node(const uint aIndex) override
Definition cl_Vertex.hpp:349
void insert_node(Node *aNode, const uint aIndex)
Definition cl_Vertex.cpp:97
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
unsigned int id_t
Definition typedefs.hpp:41
int proc_t
Definition commtypes.hpp:29
ElementType
Element types.
Definition Mesh_Enums.hpp:27
long long unsigned int key_t
Definition typedefs.hpp:43
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36