PottsElement< DIM > Class Template Reference

#include <PottsElement.hpp>

Inherits AbstractElement< DIM, DIM >.

Collaboration diagram for PottsElement< DIM >:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

template<unsigned DIM>
class PottsElement< DIM >

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.


Constructor & Destructor Documentation

template<unsigned DIM>
PottsElement< DIM >::PottsElement ( unsigned  index,
const std::vector< Node< DIM > * > &  rNodes 
) [inline]

Constructor.

Parameters:
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().

template<unsigned DIM>
PottsElement< DIM >::~PottsElement (  )  [inline]

Destructor.

Definition at line 41 of file PottsElement.cpp.


Member Function Documentation

template<unsigned DIM>
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.

Parameters:
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.

template<unsigned DIM>
void PottsElement< DIM >::DeleteNode ( const unsigned rIndex  )  [inline]

Delete a node with given local index.

Parameters:
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().

template<unsigned DIM>
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.

Parameters:
globalIndex the global index of the node in the mesh
Returns:
local_index.

Definition at line 116 of file PottsElement.cpp.

References AbstractElement< DIM, DIM >::GetNodeGlobalIndex(), and AbstractElement< DIM, DIM >::mNodes.

template<unsigned DIM>
bool PottsElement< DIM >::IsElementOnBoundary (  )  const [inline]

Get whether or not the element is on the boundary by seeing if contains boundary nodes.

Returns:
whether or not the element is on the boundary.

Definition at line 130 of file PottsElement.cpp.

References AbstractElement< DIM, DIM >::GetNode(), and AbstractElement< DIM, DIM >::mNodes.

template<unsigned DIM>
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.

template<unsigned DIM>
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().

template<unsigned DIM>
void PottsElement< DIM >::ResetIndex ( unsigned  index  )  [inline]

Reset the global index of the element and update its nodes.

Parameters:
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().

template<unsigned DIM>
template<class Archive >
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.

Parameters:
archive the archive
version the current version of this class

Definition at line 66 of file PottsElement.hpp.

template<unsigned DIM>
void PottsElement< DIM >::UpdateNode ( const unsigned rIndex,
Node< DIM > *  pNode 
) [inline]

Update node at the given index.

Parameters:
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.


Friends And Related Function Documentation

template<unsigned DIM>
friend class boost::serialization::access [friend]

Needed for serialization.

Definition at line 53 of file PottsElement.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:07:19 2011 for Chaste by  doxygen 1.6.3