Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
VertexElement< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <VertexElement.hpp>

+ Inheritance diagram for VertexElement< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for VertexElement< ELEMENT_DIM, SPACE_DIM >:

Public Member Functions

 VertexElement (unsigned index, const std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > &rFaces, const std::vector< bool > &rOrientations)
 
 VertexElement (unsigned index)
 
 VertexElement (unsigned index, const std::vector< Node< SPACE_DIM > * > &rNodes)
 
 VertexElement (unsigned index, const std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > &rFaces, const std::vector< bool > &rOrientations, const std::vector< Node< SPACE_DIM > * > &rNodes)
 
 ~VertexElement ()
 
unsigned GetNumFaces () const
 
void AddFace (VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace)
 
VertexElement< ELEMENT_DIM-1, SPACE_DIM > * GetFace (unsigned index) const
 
bool FaceIsOrientatedClockwise (unsigned index) const
 
- Public Member Functions inherited from MutableElement< ELEMENT_DIM, SPACE_DIM >
 MutableElement (unsigned index)
 
 MutableElement (unsigned index, const std::vector< Node< SPACE_DIM > * > &rNodes)
 
virtual ~MutableElement ()
 
void RegisterWithNodes ()
 
void MarkAsDeleted ()
 
void ResetIndex (unsigned index)
 
void UpdateNode (const unsigned &rIndex, Node< SPACE_DIM > *pNode)
 
void DeleteNode (const unsigned &rIndex)
 
void AddNode (Node< SPACE_DIM > *pNode, const unsigned &rIndex)
 
unsigned GetNodeLocalIndex (unsigned globalIndex) const
 
void RegisterWithEdges ()
 
void RebuildEdges ()
 
virtual bool IsElementOnBoundary () const
 
void SetEdgeHelper (EdgeHelper< SPACE_DIM > *pEdgeHelper)
 
void ClearEdges ()
 
void BuildEdges ()
 
unsigned GetEdgeGlobalIndex (unsigned localIndex) const
 
Edge< SPACE_DIM > * GetEdge (unsigned localIndex) const
 
unsigned GetNumEdges () const
 
std::set< unsignedGetNeighbouringElementAtEdgeIndex (unsigned localIndex)
 
bool ContainsEdge (const Edge< SPACE_DIM > *pEdge) const
 
long GetLocalEdgeIndex (const Edge< SPACE_DIM > *pEdge) const
 
- Public Member Functions inherited from AbstractElement< ELEMENT_DIM, SPACE_DIM >
 AbstractElement (unsigned index, const std::vector< Node< SPACE_DIM > * > &rNodes)
 
 AbstractElement (unsigned index=INDEX_IS_NOT_USED)
 
virtual ~AbstractElement ()
 
void ReplaceNode (Node< SPACE_DIM > *pOldNode, Node< SPACE_DIM > *pNewNode)
 
double GetNodeLocation (unsigned localIndex, unsigned dimension) const
 
c_vector< double, SPACE_DIM > GetNodeLocation (unsigned localIndex) const
 
unsigned GetNodeGlobalIndex (unsigned localIndex) const
 
Node< SPACE_DIM > * GetNode (unsigned localIndex) const
 
unsigned GetNumNodes () const
 
void AddNode (Node< SPACE_DIM > *pNode)
 
bool IsDeleted () const
 
unsigned GetIndex () const
 
void SetIndex (unsigned index)
 
bool GetOwnership () const
 
void SetOwnership (bool ownership)
 
void SetAttribute (double attribute)
 
double GetAttribute ()
 
unsigned GetUnsignedAttribute ()
 
void AddElementAttribute (double attribute)
 
std::vector< double > & rGetElementAttributes ()
 
unsigned GetNumElementAttributes ()
 

Private Member Functions

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

Private Attributes

std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > mFaces
 
std::vector< boolmOrientations
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractElement< ELEMENT_DIM, SPACE_DIM >
void ConstructElementAttributes ()
 
- Protected Attributes inherited from MutableElement< ELEMENT_DIM, SPACE_DIM >
std::vector< Edge< SPACE_DIM > * > mEdges
 
EdgeHelper< SPACE_DIM > * mEdgeHelper
 
- Protected Attributes inherited from AbstractElement< ELEMENT_DIM, SPACE_DIM >
std::vector< Node< SPACE_DIM > * > mNodes
 
unsigned mIndex
 
bool mIsDeleted
 
bool mOwnership
 
ElementAttributes< ELEMENT_DIM, SPACE_DIM > * mpElementAttributes
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class VertexElement< ELEMENT_DIM, SPACE_DIM >

An element class for use in the VertexMesh class. The main difference between this and the Element class is that a VertexElement can have a variable number of nodes associated with it.

Definition at line 52 of file VertexElement.hpp.

Constructor & Destructor Documentation

◆ VertexElement() [1/4]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement ( unsigned  index,
const std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > &  rFaces,
const std::vector< bool > &  rOrientations 
)

Constructor.

Parameters
indexglobal index of the element
rFacesvector of faces associated with the element
rOrientationsvector of orientations of the faces associated with the element

Definition at line 62 of file VertexElement.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces, AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes, VertexElement< ELEMENT_DIM, SPACE_DIM >::mOrientations, and MutableElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().

◆ VertexElement() [2/4]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement ( unsigned  index)

Alternative constructor.

When constructing a VertexMesh as the Voronoi dual to a Delaunay mesh, each VertexElement is initially constructed without nodes.

Parameters
indexglobal index of the element

Definition at line 95 of file VertexElement.cpp.

◆ VertexElement() [3/4]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement ( unsigned  index,
const std::vector< Node< SPACE_DIM > * > &  rNodes 
)

Constructor.

Parameters
indexglobal index of the element
rNodesvector of Nodes associated with the element

Definition at line 101 of file VertexElement.cpp.

◆ VertexElement() [4/4]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement ( unsigned  index,
const std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > &  rFaces,
const std::vector< bool > &  rOrientations,
const std::vector< Node< SPACE_DIM > * > &  rNodes 
)

Constructor used to specify the element completely. This ensures that the nodes and faces are owned by the element *in a specified order*. See #1076 and #1377 for more details.

Parameters
indexglobal index of the element
rFacesvector of faces associated with the element
rOrientationsvector of orientations of the faces associated with the element
rNodesvector of Nodes associated with the element

Definition at line 40 of file VertexElement.cpp.

References VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces, VertexElement< ELEMENT_DIM, SPACE_DIM >::mOrientations, and MutableElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().

◆ ~VertexElement()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM, SPACE_DIM >::~VertexElement ( )

Destructor.

Definition at line 108 of file VertexElement.cpp.

Member Function Documentation

◆ AddFace()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexElement< ELEMENT_DIM, SPACE_DIM >::AddFace ( VertexElement< ELEMENT_DIM-1, SPACE_DIM > *  pFace)

Add a face to the element.

Parameters
pFacea pointer to the new face

Definition at line 119 of file VertexElement.cpp.

◆ FaceIsOrientatedClockwise()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool VertexElement< ELEMENT_DIM, SPACE_DIM >::FaceIsOrientatedClockwise ( unsigned  index) const
Returns
whether the face with a given index is oriented clockwise.
Parameters
indexthe index of the face

Definition at line 154 of file VertexElement.cpp.

◆ GetFace()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM-1, SPACE_DIM > * VertexElement< ELEMENT_DIM, SPACE_DIM >::GetFace ( unsigned  index) const

◆ GetNumFaces()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNumFaces ( ) const
Returns
the number of faces owned by this element.

Definition at line 113 of file VertexElement.cpp.

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetSurfaceAreaOfElement(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVolumeOfElement().

◆ serialize()

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

Serialize the object and its member variables.

Note that serialization of the mesh and cells is handled by load/save_construct_data.

Note also that member data related to writers is not saved - output must be set up again by the caller after a restart.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 87 of file VertexElement.hpp.

References VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces, and VertexElement< ELEMENT_DIM, SPACE_DIM >::mOrientations.

Friends And Related Symbol Documentation

◆ boost::serialization::access

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

Needed for serialization.

Definition at line 74 of file VertexElement.hpp.

Member Data Documentation

◆ mFaces

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<VertexElement<ELEMENT_DIM-1, SPACE_DIM>*> VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces
private

◆ mOrientations

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<bool> VertexElement< ELEMENT_DIM, SPACE_DIM >::mOrientations
private

How each face is oriented. From the perspective of the centre of the element, the vertices of each face should be ordered anti clockwise. If and only if this is false, the order of vertices in the corresponding face should be reversed.

N.B. Most faces belong to two elements, but with opposite orientations. This allows us to reuse the face data across the two cells.

Definition at line 71 of file VertexElement.hpp.

Referenced by VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement(), VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement(), and VertexElement< ELEMENT_DIM, SPACE_DIM >::serialize().


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