NodeBasedTissue< DIM > Class Template Reference

#include <NodeBasedTissue.hpp>

Inheritance diagram for NodeBasedTissue< DIM >:

Inheritance graph
[legend]
Collaboration diagram for NodeBasedTissue< DIM >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 NodeBasedTissue (const std::vector< Node< DIM > * > nodes, const std::vector< TissueCell > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteNodes=true)
 NodeBasedTissue (const std::vector< Node< DIM > * > nodes, bool deleteNodes=true)
 NodeBasedTissue (const AbstractMesh< DIM, DIM > &rMesh, const std::vector< TissueCell > &rCells)
 ~NodeBasedTissue ()
unsigned GetNumNodes ()
Node< DIM > * GetNode (unsigned index)
unsigned RemoveDeadCells ()
void Clear ()
void Update ()
std::vector< Node< DIM > * > & rGetNodes ()
const std::vector< Node< DIM > * > & rGetNodes () const

Private Member Functions

template<class Archive>
void serialize (Archive &archive, const unsigned int version)
unsigned AddNode (Node< DIM > *pNewNode)
void SetNode (unsigned nodeIndex, ChastePoint< DIM > &rNewLocation)
void Validate ()

Private Attributes

std::vector< Node< DIM > * > mNodes
std::vector< unsigned > mDeletedNodeIndices
bool mAddedNodes
bool mDeleteNodes

Friends

class TestNodeBasedTissue
class boost::serialization::access


Detailed Description

template<unsigned DIM>
class NodeBasedTissue< DIM >

A NodeBasedTissue is a Tissue consisting of only nodes in space with associated cells. There are no elements and no mesh.

Definition at line 44 of file NodeBasedTissue.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
NodeBasedTissue< DIM >::NodeBasedTissue ( const std::vector< Node< DIM > * >  nodes,
const std::vector< TissueCell > &  rCells,
const std::vector< unsigned >  locationIndices = std::vector<unsigned>(),
bool  deleteNodes = true 
) [inline]

Default constructor.

Note that the tissue will take responsibility for freeing the memory used by the nodes.

Parameters:
nodes a vector of Nodes
rCells a vector of TissueCells
locationIndices an optional vector of location indices that correspond to real cells
deleteNodes whether to delete nodes in destructor

Definition at line 31 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::mAddedNodes, and NodeBasedTissue< DIM >::Validate().

template<unsigned DIM>
NodeBasedTissue< DIM >::NodeBasedTissue ( const std::vector< Node< DIM > * >  nodes,
bool  deleteNodes = true 
) [inline]

Constructor for use by the archiving - doesn't take in cells, since these are dealt with by the serialize method of our base class.

Note that the tissue will take responsibility for freeing the memory used by the nodes.

Parameters:
nodes a vector of Nodes
deleteNodes whether to delete nodes in destructor

Definition at line 46 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::Clear(), and NodeBasedTissue< DIM >::mAddedNodes.

template<unsigned DIM>
NodeBasedTissue< DIM >::NodeBasedTissue ( const AbstractMesh< DIM, DIM > &  rMesh,
const std::vector< TissueCell > &  rCells 
) [inline]

Constructor which takes in a mesh and takes a copy of its nodes. The mesh is not changed and no references to any of its data are created.

This constructor is a helper constructor: it is generally easier for the user to create a mesh than a set of nodes.

Parameters:
rMesh a mesh
rCells a vector of TissueCells

Definition at line 57 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::mAddedNodes, NodeBasedTissue< DIM >::mNodes, and NodeBasedTissue< DIM >::Validate().

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

Destructor.

Frees all our node memory.

Definition at line 76 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::mDeleteNodes, and NodeBasedTissue< DIM >::mNodes.


Member Function Documentation

template<unsigned DIM>
template<class Archive>
void NodeBasedTissue< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Serialize the facade.

Note that serialization of the nodes is handled by load/save_construct_data, so we don't actually have to do anything here except delegate to the base class.

Parameters:
archive 
version 

Reimplemented from AbstractCellCentreBasedTissue< DIM >.

Definition at line 70 of file NodeBasedTissue.hpp.

References NodeBasedTissue< DIM >::Validate().

template<unsigned DIM>
unsigned NodeBasedTissue< DIM >::AddNode ( Node< DIM > *  pNewNode  )  [inline, private, virtual]

Overridden AddNode() method.

Add a new node to the tissue.

Parameters:
pNewNode pointer to the new node
Returns:
global index of new node in tissue

Implements AbstractTissue< DIM >.

Definition at line 222 of file NodeBasedTissue.cpp.

References Node< SPACE_DIM >::GetIndex(), NodeBasedTissue< DIM >::mAddedNodes, NodeBasedTissue< DIM >::mDeletedNodeIndices, NodeBasedTissue< DIM >::mNodes, and Node< SPACE_DIM >::SetIndex().

template<unsigned DIM>
void NodeBasedTissue< DIM >::SetNode ( unsigned  nodeIndex,
ChastePoint< DIM > &  rNewLocation 
) [inline, private, virtual]

Move the node with a given index to a new point in space.

Parameters:
nodeIndex the index of the node to be moved
rNewLocation the new target location of the node

Implements AbstractTissue< DIM >.

Definition at line 143 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::mNodes.

template<unsigned DIM>
void NodeBasedTissue< DIM >::Validate (  )  [inline, private, virtual]

template<unsigned DIM>
unsigned NodeBasedTissue< DIM >::GetNumNodes (  )  [inline, virtual]

Returns:
the number of nodes in the tissue.

Implements AbstractTissue< DIM >.

Definition at line 243 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::mDeletedNodeIndices, and NodeBasedTissue< DIM >::mNodes.

Referenced by NodeBasedTissue< DIM >::Validate().

template<unsigned DIM>
Node< DIM > * NodeBasedTissue< DIM >::GetNode ( unsigned  index  )  [inline, virtual]

Overridden GetNode() method.

Parameters:
index global index of the specified node
Returns:
a pointer to the node with a given index.

Implements AbstractTissue< DIM >.

Definition at line 136 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::mNodes.

template<unsigned DIM>
unsigned NodeBasedTissue< DIM >::RemoveDeadCells (  )  [inline, virtual]

Remove all cells labelled as dead.

Note that after calling this method the tissue will be in an inconsistent state until the equivalent of a 'remesh' is performed! So don't try iterating over cells or anything like that.

Returns:
number of cells removed

Implements AbstractTissue< DIM >.

Definition at line 199 of file NodeBasedTissue.cpp.

References AbstractCellCentreBasedTissue< DIM >::GetNodeCorrespondingToCell(), AbstractTissue< DIM >::mCellLocationMap, AbstractTissue< DIM >::mCells, and NodeBasedTissue< DIM >::mDeletedNodeIndices.

template<unsigned DIM>
void NodeBasedTissue< DIM >::Clear (  )  [inline]

template<unsigned DIM>
void NodeBasedTissue< DIM >::Update (  )  [inline, virtual]

Remove nodes that have been marked as deleted and update the node cell map.

Implements AbstractTissue< DIM >.

Definition at line 150 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::Clear(), AbstractTissue< DIM >::mCellLocationMap, AbstractTissue< DIM >::mLocationCellMap, NodeBasedTissue< DIM >::mNodes, and NodeBasedTissue< DIM >::Validate().

template<unsigned DIM>
std::vector< Node< DIM > * > & NodeBasedTissue< DIM >::rGetNodes (  )  [inline]

Method for getting all nodes in the tissue.

Returns:
vector of Nodes

Definition at line 122 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::mNodes.

template<unsigned DIM>
const std::vector< Node< DIM > * > & NodeBasedTissue< DIM >::rGetNodes (  )  const [inline]

Method for getting all nodes in the tissue (for archiving).

Returns:
vector of Nodes

Definition at line 129 of file NodeBasedTissue.cpp.

References NodeBasedTissue< DIM >::mNodes.


Friends And Related Function Documentation

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

Needed for serialization.

Reimplemented from AbstractCellCentreBasedTissue< DIM >.

Definition at line 59 of file NodeBasedTissue.hpp.


Member Data Documentation

template<unsigned DIM>
std::vector<Node<DIM>* > NodeBasedTissue< DIM >::mNodes [private]

template<unsigned DIM>
std::vector<unsigned> NodeBasedTissue< DIM >::mDeletedNodeIndices [private]

Indices of nodes that have been deleted, to be reused when adding new nodes

Definition at line 53 of file NodeBasedTissue.hpp.

Referenced by NodeBasedTissue< DIM >::AddNode(), NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::GetNumNodes(), and NodeBasedTissue< DIM >::RemoveDeadCells().

template<unsigned DIM>
bool NodeBasedTissue< DIM >::mAddedNodes [private]

Whether nodes have been added to the tissue.

Definition at line 56 of file NodeBasedTissue.hpp.

Referenced by NodeBasedTissue< DIM >::AddNode(), NodeBasedTissue< DIM >::Clear(), and NodeBasedTissue< DIM >::NodeBasedTissue().

template<unsigned DIM>
bool NodeBasedTissue< DIM >::mDeleteNodes [private]

Whether to delete the nodes (taken in one of the constructors, defaults to true)

Definition at line 103 of file NodeBasedTissue.hpp.

Referenced by NodeBasedTissue< DIM >::~NodeBasedTissue().


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

Generated on Wed Mar 18 12:52:45 2009 for Chaste by  doxygen 1.5.5