#include <MutableElement.hpp>
Inherits AbstractElement< ELEMENT_DIM, SPACE_DIM >.
Inherited by VertexElement< ELEMENT_DIM, SPACE_DIM >.
Public Member Functions | |
MutableElement (unsigned index) | |
MutableElement (unsigned index, const std::vector< Node< SPACE_DIM > * > &rNodes) | |
~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 |
bool | IsElementOnBoundary () const |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Friends | |
class | boost::serialization::access |
A mutable element containing functionality to add and remove nodes.
Definition at line 49 of file MutableElement.hpp.
MutableElement< ELEMENT_DIM, SPACE_DIM >::MutableElement | ( | unsigned | index | ) | [inline] |
Alternative constructor.
index | global index of the element |
Definition at line 41 of file MutableElement.cpp.
MutableElement< ELEMENT_DIM, SPACE_DIM >::MutableElement | ( | 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 47 of file MutableElement.cpp.
References MutableElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().
MutableElement< ELEMENT_DIM, SPACE_DIM >::~MutableElement | ( | ) | [inline] |
Destructor.
Definition at line 58 of file MutableElement.cpp.
void MutableElement< ELEMENT_DIM, SPACE_DIM >::AddNode | ( | Node< SPACE_DIM > * | pNode, | |
const unsigned & | rIndex | |||
) | [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 MutableElement is initially constructed without nodes. We therefore require the two cases below.
Definition at line 123 of file MutableElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by VertexElement< ELEMENT_DIM, SPACE_DIM >::AddFace(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT3Swap().
void MutableElement< 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 111 of file MutableElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElement(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT2Swap(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT3Swap().
unsigned MutableElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocalIndex | ( | unsigned | globalIndex | ) | const [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 151 of file MutableElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by NagaiHondaForce< DIM >::AddForceContribution(), FarhadifarForce< DIM >::AddForceContribution(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideEdge(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::DivideElementAlongGivenAxis(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::IdentifySwapType(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformIntersectionSwap(), MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT2Swap(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT3Swap().
bool MutableElement< ELEMENT_DIM, SPACE_DIM >::IsElementOnBoundary | ( | ) | const [inline] |
Get whether or not the element is on the boundary by seeing if contains boundary nodes.
Definition at line 165 of file MutableElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
void MutableElement< 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 72 of file MutableElement.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.
Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::PerformT2Swap().
void MutableElement< 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 63 of file MutableElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddElement(), MutableElement< ELEMENT_DIM, SPACE_DIM >::MutableElement(), MutableElement< 1, SPACE_DIM >::ResetIndex(), MutableElement< ELEMENT_DIM, SPACE_DIM >::ResetIndex(), and VertexElement< ELEMENT_DIM, SPACE_DIM >::VertexElement().
void MutableElement< 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 85 of file MutableElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes, and MutableElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().
void MutableElement< 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 |
Reimplemented in VertexElement< ELEMENT_DIM, SPACE_DIM >, and PottsElement< DIM >.
Definition at line 68 of file MutableElement.hpp.
void MutableElement< 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 96 of file MutableElement.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::mIndex, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::mNodes.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented in VertexElement< ELEMENT_DIM, SPACE_DIM >, and PottsElement< DIM >.
Definition at line 55 of file MutableElement.hpp.