#include <PottsElement.hpp>
Inherits AbstractElement< DIM, DIM >.
Public Member Functions | |
PottsElement (unsigned index, const std::vector< Node< DIM > * > &rNodes) | |
~PottsElement () | |
void | RegisterWithNodes () |
void | MarkAsDeleted () |
void | ResetIndex (unsigned index) |
void | UpdateNode (const unsigned &rIndex, Node< DIM > *pNode) |
void | DeleteNode (const unsigned &rIndex) |
void | AddNode (Node< DIM > *pNode) |
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 |
An element class for use in the PottsMesh class.
The main difference between this and the Element class is that a PottsElement can have a variable number of nodes associated with it and these represent the lattice sites contained in the element. As they are just a collection of sites there is no concept of Element Dimension.
Definition at line 48 of file PottsElement.hpp.
PottsElement< DIM >::PottsElement | ( | unsigned | index, | |
const std::vector< Node< DIM > * > & | rNodes | |||
) | [inline] |
Constructor.
index | global index of the element | |
rNodes | vector of Nodes associated with the element |
Definition at line 34 of file PottsElement.cpp.
References PottsElement< DIM >::RegisterWithNodes().
PottsElement< DIM >::~PottsElement | ( | ) | [inline] |
Destructor.
Definition at line 41 of file PottsElement.cpp.
void PottsElement< DIM >::AddNode | ( | Node< DIM > * | pNode | ) | [inline] |
Add node to element. Note that we dont care about ordering in a potts element so just add it to the end of the mNodes vector.
pNode | is a pointer to the new node |
Definition at line 106 of file PottsElement.cpp.
References Node< SPACE_DIM >::AddElement(), AbstractElement< DIM, DIM >::mIndex, and AbstractElement< DIM, DIM >::mNodes.
void PottsElement< 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 94 of file PottsElement.cpp.
References AbstractElement< DIM, DIM >::mIndex, and AbstractElement< DIM, DIM >::mNodes.
Referenced by PottsMesh< DIM >::DivideElement().
unsigned PottsElement< 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 116 of file PottsElement.cpp.
References AbstractElement< DIM, DIM >::GetNodeGlobalIndex(), and AbstractElement< DIM, DIM >::mNodes.
bool PottsElement< DIM >::IsElementOnBoundary | ( | ) | const [inline] |
Get whether or not the element is on the boundary by seeing if contains boundary nodes.
Definition at line 130 of file PottsElement.cpp.
References AbstractElement< DIM, DIM >::GetNode(), and AbstractElement< DIM, DIM >::mNodes.
void PottsElement< 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< DIM, DIM >.
Definition at line 55 of file PottsElement.cpp.
References AbstractElement< DIM, DIM >::GetNumNodes(), AbstractElement< DIM, DIM >::mIndex, AbstractElement< DIM, DIM >::mIsDeleted, and AbstractElement< DIM, DIM >::mNodes.
void PottsElement< DIM >::RegisterWithNodes | ( | ) | [inline, virtual] |
Overridden RegisterWithNodes() method.
Informs all nodes forming this element that they are in this element.
Implements AbstractElement< DIM, DIM >.
Definition at line 46 of file PottsElement.cpp.
References AbstractElement< DIM, DIM >::mIndex, and AbstractElement< DIM, DIM >::mNodes.
Referenced by PottsMesh< DIM >::AddElement(), PottsElement< DIM >::PottsElement(), and PottsElement< DIM >::ResetIndex().
void PottsElement< DIM >::ResetIndex | ( | unsigned | index | ) | [inline] |
Reset the global index of the element and update its nodes.
index | the new global index |
Definition at line 68 of file PottsElement.cpp.
References AbstractElement< DIM, DIM >::GetNumNodes(), AbstractElement< DIM, DIM >::mIndex, AbstractElement< DIM, DIM >::mNodes, and PottsElement< DIM >::RegisterWithNodes().
void PottsElement< 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 66 of file PottsElement.hpp.
void PottsElement< DIM >::UpdateNode | ( | const unsigned & | rIndex, | |
Node< DIM > * | pNode | |||
) | [inline] |
Update node at the given index.
rIndex | is an local index to which node to change | |
pNode | is a pointer to the replacement node |
Definition at line 79 of file PottsElement.cpp.
References AbstractElement< DIM, DIM >::mIndex, and AbstractElement< DIM, DIM >::mNodes.
friend class boost::serialization::access [friend] |
Needed for serialization.
Definition at line 53 of file PottsElement.hpp.