Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
EdgeHelper< SPACE_DIM > Class Template Reference

#include <EdgeHelper.hpp>

+ Collaboration diagram for EdgeHelper< SPACE_DIM >:

Public Member Functions

 EdgeHelper ()
 
Edge< SPACE_DIM > * GetEdgeFromNodes (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
Edge< SPACE_DIM > * GetEdgeFromNodes (unsigned elementIndex, Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
Edge< SPACE_DIM > * GetEdge (unsigned index) const
 
Edge< SPACE_DIM > * operator[] (unsigned index) const
 
void RemoveDeletedEdges ()
 
unsigned GetNumEdges () const
 

Private Member Functions

void UpdateEdgesMapKey ()
 

Private Attributes

std::vector< std::unique_ptr< Edge< SPACE_DIM > > > mEdges
 
std::map< std::pair< unsigned, unsigned >, Edge< SPACE_DIM > * > mEdgesMap
 

Detailed Description

template<unsigned SPACE_DIM>
class EdgeHelper< SPACE_DIM >

Class for facilitating the creation and management of unique edges in a vertex mesh.

Definition at line 51 of file EdgeHelper.hpp.

Constructor & Destructor Documentation

◆ EdgeHelper()

template<unsigned SPACE_DIM>
EdgeHelper< SPACE_DIM >::EdgeHelper ( )

Default constructor.

Definition at line 39 of file EdgeHelper.cpp.

Member Function Documentation

◆ GetEdge()

template<unsigned SPACE_DIM>
Edge< SPACE_DIM > * EdgeHelper< SPACE_DIM >::GetEdge ( unsigned  index) const
Parameters
indexa global Edge index
Returns
pointer the Edge with this global index

Definition at line 80 of file EdgeHelper.cpp.

◆ GetEdgeFromNodes() [1/2]

template<unsigned SPACE_DIM>
Edge< SPACE_DIM > * EdgeHelper< SPACE_DIM >::GetEdgeFromNodes ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)

Get edge from the node pairs. Construct the edge if it has not been created

Parameters
pNodeApointer to first Node
pNodeBpointer to second Node
Returns
the (new) Edge

Definition at line 44 of file EdgeHelper.cpp.

References Edge< SPACE_DIM >::GenerateMapIndex(), Node< SPACE_DIM >::GetIndex(), and Edge< SPACE_DIM >::SetNodes().

◆ GetEdgeFromNodes() [2/2]

template<unsigned SPACE_DIM>
Edge< SPACE_DIM > * EdgeHelper< SPACE_DIM >::GetEdgeFromNodes ( unsigned  elementIndex,
Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)

Get the edge from the node pairs and add it to element with index elementIndex

Parameters
elementIndexthe index of an element to which the edge belongs
pNodeApointer to first Node
pNodeBpointer to second Node
Returns
the Edge

Definition at line 70 of file EdgeHelper.cpp.

◆ GetNumEdges()

template<unsigned SPACE_DIM>
unsigned EdgeHelper< SPACE_DIM >::GetNumEdges ( ) const
Returns
total number of edges

Definition at line 142 of file EdgeHelper.cpp.

◆ operator[]()

template<unsigned SPACE_DIM>
Edge< SPACE_DIM > * EdgeHelper< SPACE_DIM >::operator[] ( unsigned  index) const

Access operator.

Parameters
indexIndex of mEdges
Returns
mEdges[index]

Definition at line 87 of file EdgeHelper.cpp.

◆ RemoveDeletedEdges()

template<unsigned SPACE_DIM>
void EdgeHelper< SPACE_DIM >::RemoveDeletedEdges ( )

Remove deleted edges.

Definition at line 94 of file EdgeHelper.cpp.

◆ UpdateEdgesMapKey()

template<unsigned SPACE_DIM>
void EdgeHelper< SPACE_DIM >::UpdateEdgesMapKey ( )
private

Rebuilds node-node to edge map, which is required after removing deleted edges.

Definition at line 131 of file EdgeHelper.cpp.

Member Data Documentation

◆ mEdges

template<unsigned SPACE_DIM>
std::vector<std::unique_ptr<Edge<SPACE_DIM> > > EdgeHelper< SPACE_DIM >::mEdges
private

Vector owning the individual edge objects.

Definition at line 58 of file EdgeHelper.hpp.

◆ mEdgesMap

template<unsigned SPACE_DIM>
std::map<std::pair<unsigned, unsigned>, Edge<SPACE_DIM>*> EdgeHelper< SPACE_DIM >::mEdgesMap
private

Explicit map between the two node global indices and the edge they represent.

Definition at line 63 of file EdgeHelper.hpp.


The documentation for this class was generated from the following files: