NodeBasedCellPopulation< DIM > Class Template Reference

#include <NodeBasedCellPopulation.hpp>

Inheritance diagram for NodeBasedCellPopulation< DIM >:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 NodeBasedCellPopulation (NodesOnlyMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false)
 NodeBasedCellPopulation (NodesOnlyMesh< DIM > &rMesh)
 ~NodeBasedCellPopulation ()
NodesOnlyMesh< DIM > & rGetMesh ()
const NodesOnlyMesh< DIM > & rGetMesh () const
unsigned GetNumNodes ()
Node< DIM > * GetNode (unsigned index)
unsigned RemoveDeadCells ()
void Clear ()
void Update (bool hasHadBirthsOrDeaths=true)
std::vector< Node< DIM > * > & rGetNodes ()
BoxCollection< DIM > * GetBoxCollection ()
std::set< std::pair< Node< DIM >
*, Node< DIM > * > > & 
rGetNodePairs ()
void OutputCellPopulationParameters (out_stream &rParamsFile)
double GetMechanicsCutOffLength ()
void SetMechanicsCutOffLength (double mechanicsCutOffLength)
double GetWidth (const unsigned &rDimension)
void SetOutputCellVolumes (bool outputCellVolumes)

Protected Attributes

NodesOnlyMesh< DIM > & mrMesh

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 ()
void SplitUpIntoBoxes (double cutOffLength, c_vector< double, 2 *DIM > domainSize)
void FindMaxAndMin ()
void WriteVtkResultsToFile ()

Private Attributes

BoxCollection< DIM > * mpBoxCollection
c_vector< double, DIM > mMinSpatialPositions
c_vector< double, DIM > mMaxSpatialPositions
std::set< std::pair< Node< DIM >
*, Node< DIM > * > > 
mNodePairs
bool mDeleteMesh
double mMechanicsCutOffLength

Friends

class TestNodeBasedCellPopulation
class TestBoxCollection
class boost::serialization::access


Detailed Description

template<unsigned DIM>
class NodeBasedCellPopulation< DIM >

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

Definition at line 47 of file NodeBasedCellPopulation.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation ( NodesOnlyMesh< DIM > &  rMesh,
std::vector< CellPtr > &  rCells,
const std::vector< unsigned >  locationIndices = std::vector<unsigned>(),
bool  deleteMesh = false 
) [inline]

Default constructor.

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

Parameters:
rMesh a mutable nodes-only mesh
rCells a vector of cells
locationIndices an optional vector of location indices that correspond to real cells
deleteMesh whether to delete nodes-only mesh in destructor

Definition at line 33 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::Validate().

template<unsigned DIM>
NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation ( NodesOnlyMesh< DIM > &  rMesh  )  [inline]

Constructor for use by the de-serializer.

Parameters:
rMesh a mutable nodes-only mesh

Definition at line 47 of file NodeBasedCellPopulation.cpp.

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


Member Function Documentation

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

Serialize the object and its member variables.

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 the archive
version the current version of this class

Reimplemented from AbstractCentreBasedCellPopulation< DIM >.

Definition at line 92 of file NodeBasedCellPopulation.hpp.

References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength, and NodeBasedCellPopulation< DIM >::Validate().

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

Overridden AddNode() method.

Add a new node to the cell population.

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

Implements AbstractCellPopulation< DIM >.

Definition at line 275 of file NodeBasedCellPopulation.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), and NodeBasedCellPopulation< DIM >::mrMesh.

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

Definition at line 171 of file NodeBasedCellPopulation.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), and NodeBasedCellPopulation< DIM >::mrMesh.

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

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes ( double  cutOffLength,
c_vector< double, 2 *DIM >  domainSize 
) [inline, private]

Method for Initially Splitting up cell population into neighbouring boxes, to decrease runtime.

Parameters:
cutOffLength length of spring cut off between nodes
domainSize c_vector of size 2*dimension reads minX, maxX, minY, maxY, etc

Definition at line 114 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::GetNode(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), NodeBasedCellPopulation< DIM >::mpBoxCollection, and NodeBasedCellPopulation< DIM >::mrMesh.

Referenced by NodeBasedCellPopulation< DIM >::Update().

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::FindMaxAndMin (  )  [inline, private]

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile (  )  [inline, private, virtual]

template<unsigned DIM>
NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh (  )  [inline]

Returns:
reference to mrMesh.

Definition at line 68 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mrMesh.

template<unsigned DIM>
const NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh (  )  const [inline]

Returns:
const reference to mrMesh (used in archiving).

Definition at line 74 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mrMesh.

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

template<unsigned DIM>
Node< DIM > * NodeBasedCellPopulation< 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 AbstractCellPopulation< DIM >.

Definition at line 165 of file NodeBasedCellPopulation.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), and NodeBasedCellPopulation< DIM >::mrMesh.

Referenced by NodeBasedCellPopulation< DIM >::FindMaxAndMin(), and NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes().

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

Remove all cells labelled as dead.

Note that after calling this method the cell population 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 AbstractCellPopulation< DIM >.

Definition at line 247 of file NodeBasedCellPopulation.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNodePriorToReMesh(), AbstractCellPopulation< DIM >::mCellLocationMap, AbstractCellPopulation< DIM >::mCells, AbstractCellPopulation< DIM >::mLocationCellMap, and NodeBasedCellPopulation< DIM >::mrMesh.

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

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::Update ( bool  hasHadBirthsOrDeaths = true  )  [inline, virtual]

template<unsigned DIM>
std::vector<Node<DIM>*>& NodeBasedCellPopulation< DIM >::rGetNodes (  ) 

Method for getting all nodes in the cell population.

Returns:
vector of Nodes

template<unsigned DIM>
BoxCollection< DIM > * NodeBasedCellPopulation< DIM >::GetBoxCollection (  )  [inline]

Returns:
pointer to a node box collection.

Definition at line 287 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mpBoxCollection.

template<unsigned DIM>
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & NodeBasedCellPopulation< DIM >::rGetNodePairs (  )  [inline]

Returns:
Node pairs for force calculation.

Definition at line 293 of file NodeBasedCellPopulation.cpp.

References EXCEPTION, and NodeBasedCellPopulation< DIM >::mNodePairs.

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::OutputCellPopulationParameters ( out_stream &  rParamsFile  )  [inline, virtual]

Outputs CellPopulation parameters to file

As this method is pure virtual, it must be overridden in subclasses.

Parameters:
rParamsFile the file stream to which the parameters are output

Reimplemented from AbstractCentreBasedCellPopulation< DIM >.

Definition at line 303 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength, and AbstractCentreBasedCellPopulation< DIM >::OutputCellPopulationParameters().

template<unsigned DIM>
double NodeBasedCellPopulation< DIM >::GetMechanicsCutOffLength (  )  [inline]

Returns:
mMechanicsCutOffLength

Definition at line 321 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::SetMechanicsCutOffLength ( double  mechanicsCutOffLength  )  [inline]

Set mMechanicsCutOffLength.

Parameters:
mechanicsCutOffLength the new value of mMechanicsCutOffLength

Definition at line 314 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.

template<unsigned DIM>
double NodeBasedCellPopulation< DIM >::GetWidth ( const unsigned &  rDimension  )  [inline, virtual]

Overridden GetWidth() method.

Calculate the 'width' of any dimension of the cell population by computing the maximum distance between any nodes in this dimension.

Parameters:
rDimension a dimension (0,1 or 2)
Returns:
The maximum distance between any nodes in this dimension.

Implements AbstractCellPopulation< DIM >.

Definition at line 327 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::mMaxSpatialPositions, and NodeBasedCellPopulation< DIM >::mMinSpatialPositions.

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::SetOutputCellVolumes ( bool  outputCellVolumes  )  [inline, virtual]

Overridden SetOutputCellVolumes() method.

Currently there is no facility for computing the volume associated with each cell in a NodeBasedCellPopulation, so if this method is called with outputCellVolumes = true, an exception is thrown.

Parameters:
outputCellVolumes the new value of mOutputCellVolumes

Reimplemented from AbstractCellPopulation< DIM >.

Definition at line 451 of file NodeBasedCellPopulation.cpp.

References EXCEPTION.


Friends And Related Function Documentation

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

Needed for serialization.

Reimplemented from AbstractCentreBasedCellPopulation< DIM >.

Definition at line 81 of file NodeBasedCellPopulation.hpp.


Member Data Documentation

template<unsigned DIM>
NodesOnlyMesh<DIM>& NodeBasedCellPopulation< DIM >::mrMesh [protected]

template<unsigned DIM>
BoxCollection<DIM>* NodeBasedCellPopulation< DIM >::mpBoxCollection [private]

template<unsigned DIM>
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMinSpatialPositions [private]

Vector of minimal spatial positions in each dimension.

Definition at line 63 of file NodeBasedCellPopulation.hpp.

Referenced by NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::GetWidth(), and NodeBasedCellPopulation< DIM >::Update().

template<unsigned DIM>
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMaxSpatialPositions [private]

Vector of maximal spatial positions in each dimension.

Definition at line 66 of file NodeBasedCellPopulation.hpp.

Referenced by NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::GetWidth(), and NodeBasedCellPopulation< DIM >::Update().

template<unsigned DIM>
std::set< std::pair<Node<DIM>*, Node<DIM>* > > NodeBasedCellPopulation< DIM >::mNodePairs [private]

template<unsigned DIM>
bool NodeBasedCellPopulation< DIM >::mDeleteMesh [private]

Whether to delete the nodes-only mesh (taken in one of the constructors, defaults to false).

Definition at line 72 of file NodeBasedCellPopulation.hpp.

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

template<unsigned DIM>
double NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength [private]


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

Generated on Tue May 31 14:33:56 2011 for Chaste by  doxygen 1.5.5