NodeBasedCellPopulation< DIM > Class Template Reference

#include <NodeBasedCellPopulation.hpp>

Inherits AbstractCentreBasedCellPopulation< DIM >.

Inherited by NodeBasedCellPopulationWithBuskeUpdate< DIM >.

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)
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)
std::set< unsignedGetNeighbouringNodeIndices (unsigned index)
virtual CellPtr AddCell (CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell=CellPtr())

Protected Member Functions

void SetNode (unsigned nodeIndex, ChastePoint< DIM > &rNewLocation)

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 Validate ()
void SplitUpIntoBoxes (double cutOffLength, c_vector< double, 2 *DIM > domainSize)
void FindMaxAndMin ()
void WriteCellVolumeResultsToFile ()
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 44 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 34 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 48 of file NodeBasedCellPopulation.cpp.

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

Member Function Documentation

template<unsigned DIM>
CellPtr NodeBasedCellPopulation< DIM >::AddCell ( CellPtr  pNewCell,
const c_vector< double, DIM > &  rCellDivisionVector,
CellPtr  pParentCell = CellPtr() 
) [inline, virtual]

Overridden AddCell() method.

Add a new cell to the cell population and update the vector of cell radii in the NodesOnlyMesh.

Parameters:
pNewCell the cell to add
rCellDivisionVector the position in space at which to put it
pParentCell pointer to a parent cell - this is required for mesh-based cell populations
Returns:
address of cell as it appears in the cell list (internal of this method uses a copy constructor along the way)

Todo:
set the correct cell radius and properly test this (#1808)

Reimplemented from AbstractCentreBasedCellPopulation< DIM >.

Definition at line 553 of file NodeBasedCellPopulation.cpp.

References AbstractCellPopulation< DIM >::GetLocationIndexUsingCell(), NodeBasedCellPopulation< DIM >::mrMesh, and NodesOnlyMesh< SPACE_DIM >::SetCellRadius().

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 AbstractOffLatticeCellPopulation< DIM >.

Definition at line 276 of file NodeBasedCellPopulation.cpp.

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

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::Clear (  )  [inline]
template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::FindMaxAndMin (  )  [inline, private]
template<unsigned DIM>
BoxCollection< DIM > * NodeBasedCellPopulation< DIM >::GetBoxCollection (  )  [inline]
Returns:
pointer to a node box collection.

Definition at line 288 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mpBoxCollection.

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

Definition at line 320 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.

template<unsigned DIM>
std::set< unsigned > NodeBasedCellPopulation< DIM >::GetNeighbouringNodeIndices ( unsigned  index  )  [inline, virtual]
template<unsigned DIM>
Node< DIM > * NodeBasedCellPopulation< DIM >::GetNode ( unsigned  index  )  [inline, virtual]
template<unsigned DIM>
unsigned NodeBasedCellPopulation< DIM >::GetNumNodes (  )  [inline, virtual]
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 326 of file NodeBasedCellPopulation.cpp.

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

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

Reimplemented in NodeBasedCellPopulationWithBuskeUpdate< DIM >.

Definition at line 304 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.

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 248 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>
const NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh (  )  const [inline]
Returns:
const reference to mrMesh (used in archiving).

Definition at line 75 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mrMesh.

template<unsigned DIM>
NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh (  )  [inline]
template<unsigned DIM>
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & NodeBasedCellPopulation< DIM >::rGetNodePairs (  )  [inline]
Returns:
Node pairs for force calculation.

Definition at line 294 of file NodeBasedCellPopulation.cpp.

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

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

Reimplemented in NodeBasedCellPopulationWithBuskeUpdate< DIM >.

Definition at line 89 of file NodeBasedCellPopulation.hpp.

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

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

Set mMechanicsCutOffLength.

Parameters:
mechanicsCutOffLength the new value of mMechanicsCutOffLength

Definition at line 313 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::SetNode ( unsigned  nodeIndex,
ChastePoint< DIM > &  rNewLocation 
) [inline, protected, 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 AbstractOffLatticeCellPopulation< DIM >.

Definition at line 170 of file NodeBasedCellPopulation.cpp.

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

Referenced by NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations().

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 113 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 >::Update ( bool  hasHadBirthsOrDeaths = true  )  [inline, virtual]
template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::Validate (  )  [inline, private, virtual]
template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::WriteCellVolumeResultsToFile (  )  [inline, private, virtual]
template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile (  )  [inline, private, virtual]

Friends And Related Function Documentation

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

Needed for serialization.

Reimplemented from AbstractCentreBasedCellPopulation< DIM >.

Reimplemented in NodeBasedCellPopulationWithBuskeUpdate< DIM >.

Definition at line 78 of file NodeBasedCellPopulation.hpp.


Member Data Documentation

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 69 of file NodeBasedCellPopulation.hpp.

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

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

Vector of maximal 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>
double NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength [private]
template<unsigned DIM>
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMinSpatialPositions [private]

Vector of minimal spatial positions in each dimension.

Definition at line 60 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>
BoxCollection<DIM>* NodeBasedCellPopulation< DIM >::mpBoxCollection [private]
template<unsigned DIM>
NodesOnlyMesh<DIM>& NodeBasedCellPopulation< DIM >::mrMesh [protected]

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