#include <VertexElement.hpp>
Inherits AbstractElement< 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 | GetNumFaces () const |
void | RegisterWithNodes () |
void | MarkAsDeleted () |
void | ResetIndex (unsigned index) |
void | UpdateNode (const unsigned &rIndex, Node< SPACE_DIM > *pNode) |
void | DeleteNode (const unsigned &rIndex) |
void | AddNode (const unsigned &rIndex, Node< SPACE_DIM > *pNode) |
void | AddFace (VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace) |
unsigned | GetNodeLocalIndex (unsigned globalIndex) |
VertexElement< ELEMENT_DIM-1, SPACE_DIM > * | GetFace (unsigned index) const |
bool | FaceIsOrientatedClockwise (unsigned index) const |
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< bool > | mOrientations |
Friends | |
class | boost::serialization::access |
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 44 of file VertexElement.hpp.
VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement | ( | unsigned | index, | |
const std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > & | rFaces, | |||
const std::vector< bool > & | rOrientations | |||
) | [inline] |
Constructor.
index | global index of the element | |
rFaces | vector of faces associated with the element | |
rOrientations | vector of orientations of the faces associated with the element |
Definition at line 32 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 VertexElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().
VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement | ( | unsigned | index | ) | [inline] |
Alternative constructor.
When constructing a VertexMesh as the Voronoi dual to a Delaunay mesh, each VertexElement is initially constructed without nodes.
index | global index of the element |
Definition at line 65 of file VertexElement.cpp.
VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement | ( | unsigned | index, | |
const std::vector< Node< SPACE_DIM > * > & | rNodes | |||
) | [inline] |
Constructor.
index | global index of the element | |
rNodes | vector of Nodes associated with the element |
Definition at line 71 of file VertexElement.cpp.
References VertexElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().
VertexElement< ELEMENT_DIM, SPACE_DIM >::~VertexElement | ( | ) | [inline] |
Destructor.
Definition at line 84 of file VertexElement.cpp.
void VertexElement< ELEMENT_DIM, SPACE_DIM >::AddFace | ( | VertexElement< ELEMENT_DIM-1, SPACE_DIM > * | pFace | ) | [inline] |
Add a face to the element.
pFace | a pointer to the new face |
Definition at line 191 of file VertexElement.cpp.
References VertexElement< ELEMENT_DIM, SPACE_DIM >::AddNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces.
Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexMesh().
void VertexElement< ELEMENT_DIM, SPACE_DIM >::AddNode | ( | const unsigned & | rIndex, | |
Node< SPACE_DIM > * | pNode | |||
) | [inline] |
Add a node to the element between nodes at rIndex and rIndex+1.
rIndex | the local index of the node after which the new node is added | |
pNode | a pointer to the new node |
When constructing a VertexMesh as the Voronoi dual to a Delaunay mesh, each VertexElement is initially constructed without nodes. We therefore require the two cases below.
Definition at line 162 of file VertexElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by VertexElement< ELEMENT_DIM, SPACE_DIM >::AddFace(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexMesh(), and VertexMesh< 2, 2 >::VertexMesh().
void VertexElement< ELEMENT_DIM, SPACE_DIM >::DeleteNode | ( | const unsigned & | rIndex | ) | [inline] |
Delete a node with given local index.
rIndex | is the local index of the node to remove |
Definition at line 149 of file VertexElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
bool VertexElement< ELEMENT_DIM, SPACE_DIM >::FaceIsOrientatedClockwise | ( | unsigned | index | ) | const [inline] |
Get whether the face with a given index is oriented clockwise.
index | the index of the face |
Definition at line 243 of file VertexElement.cpp.
References VertexElement< ELEMENT_DIM, SPACE_DIM >::mOrientations.
VertexElement< ELEMENT_DIM-1, SPACE_DIM > * VertexElement< ELEMENT_DIM, SPACE_DIM >::GetFace | ( | unsigned | index | ) | const [inline] |
index | the global index of a specified face |
Definition at line 235 of file VertexElement.cpp.
References VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces.
Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetSurfaceAreaOfElement(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVolumeOfElement().
unsigned VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex | ( | unsigned | globalIndex | ) | [inline] |
Calculate the local index of a node given a global index if node is not contained in element return UINT_MAX
globalIndex | the global index of the node in the mesh |
Definition at line 220 of file VertexElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
unsigned VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNumFaces | ( | ) | const [inline] |
Get the number of faces owned by this element.
Definition at line 90 of file VertexElement.cpp.
References VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces.
Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetSurfaceAreaOfElement(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVolumeOfElement().
void VertexElement< ELEMENT_DIM, SPACE_DIM >::MarkAsDeleted | ( | ) | [inline, virtual] |
Overridden MarkAsDeleted() method.
Mark an element as having been removed from the mesh. Also notify nodes in the element that it has been removed.
Implements AbstractElement< ELEMENT_DIM, SPACE_DIM >.
Definition at line 107 of file VertexElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIsDeleted, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
void VertexElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes | ( | ) | [inline, virtual] |
Overridden RegisterWithNodes() method.
Informs all nodes forming this element that they are in this element.
Implements AbstractElement< ELEMENT_DIM, SPACE_DIM >.
Definition at line 97 of file VertexElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by VertexElement< 1, SPACE_DIM >::ResetIndex(), VertexElement< ELEMENT_DIM, SPACE_DIM >::ResetIndex(), and VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement().
void VertexElement< ELEMENT_DIM, SPACE_DIM >::ResetIndex | ( | unsigned | index | ) | [inline] |
Reset the global index of the element and update its nodes.
index | the new global index |
Definition at line 121 of file VertexElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes, and VertexElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().
void VertexElement< ELEMENT_DIM, SPACE_DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
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.
archive | the archive | |
version | the current version of this class |
Definition at line 79 of file VertexElement.hpp.
References VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces, and VertexElement< ELEMENT_DIM, SPACE_DIM >::mOrientations.
void VertexElement< ELEMENT_DIM, SPACE_DIM >::UpdateNode | ( | const unsigned & | rIndex, | |
Node< SPACE_DIM > * | pNode | |||
) | [inline, virtual] |
Update node at the given index.
rIndex | is an local index to which node to change | |
pNode | is a pointer to the replacement node |
Implements AbstractElement< ELEMENT_DIM, SPACE_DIM >.
Definition at line 133 of file VertexElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
friend class boost::serialization::access [friend] |
Needed for serialization.
Definition at line 66 of file VertexElement.hpp.
std::vector<VertexElement<ELEMENT_DIM-1,SPACE_DIM>*> VertexElement< ELEMENT_DIM, SPACE_DIM >::mFaces [private] |
Faces of the VertexElement, which should be distinct.
Definition at line 51 of file VertexElement.hpp.
Referenced by VertexElement< ELEMENT_DIM, SPACE_DIM >::AddFace(), VertexElement< ELEMENT_DIM, SPACE_DIM >::GetFace(), VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNumFaces(), VertexElement< ELEMENT_DIM, SPACE_DIM >::serialize(), and VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement().
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 VoronoiCell, but with opposite orientations. This allows us to reuse the face data across the two cells.
Definition at line 63 of file VertexElement.hpp.
Referenced by VertexElement< ELEMENT_DIM, SPACE_DIM >::FaceIsOrientatedClockwise(), VertexElement< ELEMENT_DIM, SPACE_DIM >::serialize(), and VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement().