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

#include <Edge.hpp>

+ Collaboration diagram for Edge< SPACE_DIM >:

Public Member Functions

 Edge (unsigned index)
 
 Edge (unsigned index, Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
void MarkAsDeleted ()
 
bool IsDeleted ()
 
void SetIndex (unsigned index)
 
unsigned GetIndex () const
 
std::pair< unsigned, unsignedGetMapIndex ()
 
void RemoveNodes ()
 
void SetNodes (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
void ReplaceNode (Node< SPACE_DIM > *pOldNode, Node< SPACE_DIM > *pNewNode)
 
Node< SPACE_DIM > * GetNode (unsigned index) const
 
unsigned GetNumNodes ()
 
bool ContainsNode (Node< SPACE_DIM > *pNode) const
 
c_vector< double, SPACE_DIM > rGetCentreLocation ()
 
double rGetLength ()
 
std::set< unsignedGetOtherElements (unsigned elementIndex)
 
void AddElement (unsigned elementIndex)
 
void RemoveElement (unsigned elementIndex)
 
std::set< unsignedGetNeighbouringElementIndices ()
 
unsigned GetNumElements ()
 
bool IsBoundaryEdge () const
 
bool operator== (const Edge< SPACE_DIM > &rEdge) const
 

Static Public Member Functions

static std::pair< unsigned, unsignedGenerateMapIndex (unsigned index1, unsigned index2)
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

unsigned mIndex
 
bool mIsDeleted
 
std::vector< Node< SPACE_DIM > * > mNodes
 
std::set< unsignedmElementIndices
 

Friends

class boost::serialization::access
 

Detailed Description

template<unsigned SPACE_DIM>
class Edge< SPACE_DIM >

An edge in a mutable mesh.

Definition at line 51 of file Edge.hpp.

Constructor & Destructor Documentation

◆ Edge() [1/2]

template<unsigned SPACE_DIM>
Edge< SPACE_DIM >::Edge ( unsigned  index)
explicit

Create an Edge with only the local index within the mesh. Nodes must be set using SetNode() after the constructor to make this a valid edge.

Parameters
indexIndex of this edge within the mesh

Definition at line 39 of file Edge.cpp.

◆ Edge() [2/2]

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

Create an Edge that has an index and associated nodes.

Parameters
indexIndex of this edge within the mesh
pNodeAA Node that forms one point of the edge
pNodeBA different Node that forms the other point of the edge

Definition at line 46 of file Edge.cpp.

References Edge< SPACE_DIM >::SetNodes().

Member Function Documentation

◆ AddElement()

template<unsigned SPACE_DIM>
void Edge< SPACE_DIM >::AddElement ( unsigned  elementIndex)

Add an Element index that the Edge is associated to.

Parameters
elementIndexan element index

Definition at line 181 of file Edge.cpp.

◆ ContainsNode()

template<unsigned SPACE_DIM>
bool Edge< SPACE_DIM >::ContainsNode ( Node< SPACE_DIM > *  pNode) const
Parameters
pNodepointer to a Node
Returns
true if pNode is containd in Edge, otherwise false

Definition at line 140 of file Edge.cpp.

References Node< SPACE_DIM >::GetIndex().

◆ GenerateMapIndex()

template<unsigned SPACE_DIM>
std::pair< unsigned, unsigned > Edge< SPACE_DIM >::GenerateMapIndex ( unsigned  index1,
unsigned  index2 
)
static

Generate an ordered pair from two node indices.

Parameters
index1Index of first node
index2Index of second node
Returns
(index1, index2) if index1 < index2, else (index2, index1)

Definition at line 56 of file Edge.cpp.

Referenced by EdgeHelper< SPACE_DIM >::GetEdgeFromNodes(), and Edge< SPACE_DIM >::GetMapIndex().

◆ GetIndex()

template<unsigned SPACE_DIM>
unsigned Edge< SPACE_DIM >::GetIndex ( ) const
Returns
the index of this edge within the mesh

Definition at line 81 of file Edge.cpp.

◆ GetMapIndex()

template<unsigned SPACE_DIM>
std::pair< unsigned, unsigned > Edge< SPACE_DIM >::GetMapIndex ( )
Returns
a pair of associated nodes' indices

Definition at line 87 of file Edge.cpp.

References Edge< SPACE_DIM >::GenerateMapIndex().

◆ GetNeighbouringElementIndices()

template<unsigned SPACE_DIM>
std::set< unsigned > Edge< SPACE_DIM >::GetNeighbouringElementIndices ( )

Get all Element indices that the edge is associated to. Used for testing the accounting of Add and Remove element.

Returns
A set of Element indices or an empty set if there's no association.

Definition at line 193 of file Edge.cpp.

◆ GetNode()

template<unsigned SPACE_DIM>
Node< SPACE_DIM > * Edge< SPACE_DIM >::GetNode ( unsigned  index) const
Parameters
indexlocal index of the Node
Returns
pointer to the Node with given local index.

Definition at line 128 of file Edge.cpp.

Referenced by Edge< SPACE_DIM >::operator==().

◆ GetNumElements()

template<unsigned SPACE_DIM>
unsigned Edge< SPACE_DIM >::GetNumElements ( )
Returns
The number of Elements associated with this Edge

Definition at line 208 of file Edge.cpp.

◆ GetNumNodes()

template<unsigned SPACE_DIM>
unsigned Edge< SPACE_DIM >::GetNumNodes ( )
Returns
the number of Nodes associated with this Edge.

Definition at line 134 of file Edge.cpp.

◆ GetOtherElements()

template<unsigned SPACE_DIM>
std::set< unsigned > Edge< SPACE_DIM >::GetOtherElements ( unsigned  elementIndex)

Gets other Element indices that the edge is associated to.

Parameters
elementIndexThe Element index to exclude
Returns
A set of Element indices or an empty set if there's no association.

Definition at line 167 of file Edge.cpp.

◆ IsBoundaryEdge()

template<unsigned SPACE_DIM>
bool Edge< SPACE_DIM >::IsBoundaryEdge ( ) const
Returns
whether the edge is on the boundary.

Definition at line 214 of file Edge.cpp.

◆ IsDeleted()

template<unsigned SPACE_DIM>
bool Edge< SPACE_DIM >::IsDeleted ( )
Returns
if Edge has been marked as deleted

Definition at line 69 of file Edge.cpp.

◆ MarkAsDeleted()

template<unsigned SPACE_DIM>
void Edge< SPACE_DIM >::MarkAsDeleted ( )

Mark the Edge to be deleted.

Definition at line 63 of file Edge.cpp.

◆ operator==()

template<unsigned SPACE_DIM>
bool Edge< SPACE_DIM >::operator== ( const Edge< SPACE_DIM > &  rEdge) const

Comparison operator.

Parameters
rEdgeanother Edge
Returns
true if the edges are equal

Definition at line 220 of file Edge.cpp.

References Edge< SPACE_DIM >::GetNode().

◆ RemoveElement()

template<unsigned SPACE_DIM>
void Edge< SPACE_DIM >::RemoveElement ( unsigned  elementIndex)

Remove an Element index association from the Edge.

Parameters
elementIndexan element index

Definition at line 187 of file Edge.cpp.

◆ RemoveNodes()

template<unsigned SPACE_DIM>
void Edge< SPACE_DIM >::RemoveNodes ( )

Clear all associated nodes.

Definition at line 96 of file Edge.cpp.

◆ ReplaceNode()

template<unsigned SPACE_DIM>
void Edge< SPACE_DIM >::ReplaceNode ( Node< SPACE_DIM > *  pOldNode,
Node< SPACE_DIM > *  pNewNode 
)

Replace a Node in this Edge with another.

Parameters
pOldNodeThe old Node to be replaced
pNewNodeNew Node to replace the old Node

Definition at line 114 of file Edge.cpp.

◆ rGetCentreLocation()

template<unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > Edge< SPACE_DIM >::rGetCentreLocation ( )
Returns
The centre location of this edge, which is middle of two Nodes associated with the Edge

Definition at line 153 of file Edge.cpp.

◆ rGetLength()

template<unsigned SPACE_DIM>
double Edge< SPACE_DIM >::rGetLength ( )
Returns
The length of the Edge, i.e. the distance between the Edge's two Nodes

Definition at line 160 of file Edge.cpp.

◆ serialize()

template<unsigned SPACE_DIM>
template<class Archive >
void Edge< SPACE_DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Archive the member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 74 of file Edge.hpp.

References Edge< SPACE_DIM >::mElementIndices, Edge< SPACE_DIM >::mIndex, and Edge< SPACE_DIM >::mNodes.

◆ SetIndex()

template<unsigned SPACE_DIM>
void Edge< SPACE_DIM >::SetIndex ( unsigned  index)

Set the index of this edge within the mesh.

Parameters
indexThe index of this edge within the mesh

Definition at line 75 of file Edge.cpp.

◆ SetNodes()

template<unsigned SPACE_DIM>
void Edge< SPACE_DIM >::SetNodes ( Node< SPACE_DIM > *  pNodeA,
Node< SPACE_DIM > *  pNodeB 
)

Set the Edge's associated nodes.

Parameters
pNodeAA Node that forms one point of the edge
pNodeBA different Node that forms the other point of the edge

Definition at line 102 of file Edge.cpp.

Referenced by Edge< SPACE_DIM >::Edge(), and EdgeHelper< SPACE_DIM >::GetEdgeFromNodes().

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<unsigned SPACE_DIM>
friend class boost::serialization::access
friend

Definition at line 66 of file Edge.hpp.

Member Data Documentation

◆ mElementIndices

template<unsigned SPACE_DIM>
std::set<unsigned> Edge< SPACE_DIM >::mElementIndices
private

Elements that this edge belongs to

Definition at line 65 of file Edge.hpp.

Referenced by Edge< SPACE_DIM >::serialize().

◆ mIndex

template<unsigned SPACE_DIM>
unsigned Edge< SPACE_DIM >::mIndex
private

Index of this edge within the mesh

Definition at line 56 of file Edge.hpp.

Referenced by Edge< SPACE_DIM >::serialize().

◆ mIsDeleted

template<unsigned SPACE_DIM>
bool Edge< SPACE_DIM >::mIsDeleted
private

Indicates whether this edge is deleted from the mesh

Definition at line 59 of file Edge.hpp.

◆ mNodes

template<unsigned SPACE_DIM>
std::vector<Node<SPACE_DIM>*> Edge< SPACE_DIM >::mNodes
private

Nodes that form this edge

Definition at line 62 of file Edge.hpp.

Referenced by Edge< SPACE_DIM >::serialize().


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