Chaste  Release::3.4
CaBasedCellPopulation< DIM > Class Template Reference

#include <CaBasedCellPopulation.hpp>

+ Inheritance diagram for CaBasedCellPopulation< DIM >:
+ Collaboration diagram for CaBasedCellPopulation< DIM >:

Public Member Functions

 CaBasedCellPopulation (PottsMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices, unsigned latticeCarryingCapacity=1u, bool deleteMesh=false, bool validate=false)
 
 CaBasedCellPopulation (PottsMesh< DIM > &rMesh)
 
virtual ~CaBasedCellPopulation ()
 
std::vector< unsigned > & rGetAvailableSpaces ()
 
virtual bool IsSiteAvailable (unsigned index, CellPtr pCell)
 
PottsMesh< DIM > & rGetMesh ()
 
const PottsMesh< DIM > & rGetMesh () const
 
Node< DIM > * GetNode (unsigned index)
 
unsigned GetNumNodes ()
 
std::set< unsignedGetNeighbouringLocationIndices (CellPtr pCell)
 
c_vector< double, DIM > GetLocationOfCellCentre (CellPtr pCell)
 
void AddCellUsingLocationIndex (unsigned index, CellPtr pCell)
 
void RemoveCellUsingLocationIndex (unsigned index, CellPtr pCell)
 
Node< DIM > * GetNodeCorrespondingToCell (CellPtr pCell)
 
CellPtr AddCell (CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell=CellPtr())
 
virtual double EvaluateDivisionPropensity (unsigned currentNodeIndex, unsigned targetNodeIndex, CellPtr pCell)
 
unsigned RemoveDeadCells ()
 
virtual void OpenWritersFiles (OutputFileHandler &rOutputFileHandler)
 
void UpdateCellLocations (double dt)
 
bool IsCellAssociatedWithADeletedLocation (CellPtr pCell)
 
void Update (bool hasHadBirthsOrDeaths=true)
 
virtual void AcceptPopulationWriter (boost::shared_ptr< AbstractCellPopulationWriter< DIM, DIM > > pPopulationWriter)
 
virtual void AcceptPopulationCountWriter (boost::shared_ptr< AbstractCellPopulationCountWriter< DIM, DIM > > pPopulationCountWriter)
 
virtual void AcceptCellWriter (boost::shared_ptr< AbstractCellWriter< DIM, DIM > > pCellWriter, CellPtr pCell)
 
double GetVolumeOfCell (CellPtr pCell)
 
double GetWidth (const unsigned &rDimension)
 
void AddUpdateRule (boost::shared_ptr< AbstractCaUpdateRule< DIM > > pUpdateRule)
 
void RemoveAllUpdateRules ()
 
const std::vector
< boost::shared_ptr
< AbstractCaUpdateRule< DIM > > > & 
rGetUpdateRuleCollection () const
 
void AddSwitchingUpdateRule (boost::shared_ptr< AbstractCaSwitchingUpdateRule< DIM > > pUpdateRule)
 
void RemoveAllSwitchingUpdateRules ()
 
const std::vector
< boost::shared_ptr
< AbstractCaSwitchingUpdateRule
< DIM > > > & 
rGetSwitchingUpdateRuleCollection () const
 
void OutputCellPopulationParameters (out_stream &rParamsFile)
 
bool IsRoomToDivide (CellPtr pCell)
 
boost::shared_ptr
< AbstractCaBasedDivisionRule
< DIM > > 
GetCaBasedDivisionRule ()
 
void SetCaBasedDivisionRule (boost::shared_ptr< AbstractCaBasedDivisionRule< DIM > > pCaBasedDivisionRule)
 
- Public Member Functions inherited from AbstractOnLatticeCellPopulation< DIM >
 AbstractOnLatticeCellPopulation (AbstractMesh< DIM, DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false)
 
virtual ~AbstractOnLatticeCellPopulation ()
 
bool GetUpdateNodesInRandomOrder ()
 
void SetUpdateNodesInRandomOrder (bool updateNodesInRandomOrder)
 
void SetIterateRandomlyOverUpdateRuleCollection (bool iterateRandomly)
 
bool GetIterateRandomlyOverUpdateRuleCollection ()
 
void SetNode (unsigned index, ChastePoint< DIM > &rNewLocation)
 
std::set< unsignedGetNeighbouringNodeIndices (unsigned index)
 
- Public Member Functions inherited from AbstractCellPopulation< DIM >
 AbstractCellPopulation (AbstractMesh< ELEMENT_DIM, ELEMENT_DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >())
 
virtual ~AbstractCellPopulation ()
 
void InitialiseCells ()
 
void SetDataOnAllCells (const std::string &rDataName, double dataValue)
 
AbstractMesh< ELEMENT_DIM,
ELEMENT_DIM > & 
rGetMesh ()
 
std::list< CellPtr > & rGetCells ()
 
virtual void SetNode (unsigned nodeIndex, ChastePoint< ELEMENT_DIM > &rNewLocation)=0
 
virtual CellPtr AddCell (CellPtr pNewCell, const c_vector< double, ELEMENT_DIM > &rCellDivisionVector, CellPtr pParentCell=CellPtr())=0
 
std::vector< unsignedGetCellMutationStateCount ()
 
std::vector< unsignedGetCellProliferativeTypeCount ()
 
std::vector< unsignedGetCellCyclePhaseCount ()
 
unsigned GetNumRealCells ()
 
unsigned GetNumAllCells ()
 
void SetCellAncestorsToLocationIndices ()
 
std::set< unsignedGetCellAncestors ()
 
virtual CellPtr GetCellUsingLocationIndex (unsigned index)
 
std::set< CellPtr > GetCellsUsingLocationIndex (unsigned index)
 
bool IsCellAttachedToLocationIndex (unsigned index)
 
void SetCellUsingLocationIndex (unsigned index, CellPtr pCell)
 
void MoveCellInLocationMap (CellPtr pCell, unsigned old_index, unsigned new_index)
 
unsigned GetLocationIndexUsingCell (CellPtr pCell)
 
boost::shared_ptr
< CellPropertyRegistry
GetCellPropertyRegistry ()
 
void SetDefaultCellMutationStateAndProliferativeTypeOrdering ()
 
c_vector< double, ELEMENT_DIM > GetCentroidOfCellPopulation ()
 
virtual void UpdateCellProcessLocation ()
 
void CloseWritersFiles ()
 
virtual void WriteResultsToFiles (const std::string &rDirectory)
 
virtual void AcceptPopulationWriter (boost::shared_ptr< AbstractCellPopulationWriter< ELEMENT_DIM, ELEMENT_DIM > > pPopulationWriter)=0
 
virtual void AcceptPopulationCountWriter (boost::shared_ptr< AbstractCellPopulationCountWriter< ELEMENT_DIM, ELEMENT_DIM > > pPopulationCountWriter)=0
 
virtual void AcceptCellWriter (boost::shared_ptr< AbstractCellWriter< ELEMENT_DIM, ELEMENT_DIM > > pCellWriter, CellPtr pCell)=0
 
void OutputCellPopulationInfo (out_stream &rParamsFile)
 
bool GetOutputResultsForChasteVisualizer ()
 
void AddPopulationWriter ()
 
void AddPopulationWriter (boost::shared_ptr< AbstractCellPopulationWriter< ELEMENT_DIM, ELEMENT_DIM > > pPopulationWriter)
 
void AddCellWriter ()
 
void AddCellWriter (boost::shared_ptr< AbstractCellWriter< ELEMENT_DIM, ELEMENT_DIM > > pCellWriter)
 
void AddCellPopulationCountWriter ()
 
void AddCellPopulationCountWriter (boost::shared_ptr< AbstractCellPopulationCountWriter< ELEMENT_DIM, ELEMENT_DIM > > pCellPopulationCountWriter)
 
bool HasWriter () const
 
void SetOutputResultsForChasteVisualizer (bool outputResultsForChasteVisualizer)
 
c_vector< double, ELEMENT_DIM > GetSizeOfCellPopulation ()
 
std::pair< unsigned, unsignedCreateOrderedPair (unsigned index1, unsigned index2)
 
Iterator Begin ()
 
Iterator End ()
 
- Public Member Functions inherited from Identifiable
virtual ~Identifiable ()
 
std::string GetIdentifier () const
 

Private Member Functions

void SetEmptySites (const std::set< unsigned > &rEmptySiteIndices)
 
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 
void Validate ()
 
virtual void WriteVtkResultsToFile (const std::string &rDirectory)
 

Private Attributes

unsigned mLatticeCarryingCapacity
 
std::vector< boost::shared_ptr
< AbstractCaUpdateRule< DIM > > > 
mUpdateRuleCollection
 
std::vector< boost::shared_ptr
< AbstractCaSwitchingUpdateRule
< DIM > > > 
mSwitchingUpdateRuleCollection
 
std::vector< unsignedmAvailableSpaces
 
boost::shared_ptr
< AbstractCaBasedDivisionRule
< DIM > > 
mpCaBasedDivisionRule
 

Friends

class TestCaBasedCellPopulation
 
class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractOnLatticeCellPopulation< DIM >
 AbstractOnLatticeCellPopulation (AbstractMesh< DIM, DIM > &rMesh)
 
- Protected Member Functions inherited from AbstractCellPopulation< DIM >
 AbstractCellPopulation (AbstractMesh< ELEMENT_DIM, ELEMENT_DIM > &rMesh)
 
virtual void AcceptCellWritersAcrossPopulation ()
 
- Protected Attributes inherited from AbstractOnLatticeCellPopulation< DIM >
bool mDeleteMesh
 
bool mUpdateNodesInRandomOrder
 
bool mIterateRandomlyOverUpdateRuleCollection
 
- Protected Attributes inherited from AbstractCellPopulation< DIM >
std::map< unsigned, std::set
< CellPtr > > 
mLocationCellMap
 
std::map< Cell *, unsignedmCellLocationMap
 
AbstractMesh< ELEMENT_DIM,
ELEMENT_DIM > & 
mrMesh
 
std::list< CellPtr > mCells
 
c_vector< double, ELEMENT_DIM > mCentroid
 
out_stream mpVtkMetaFile
 
boost::shared_ptr
< CellPropertyRegistry
mpCellPropertyRegistry
 
bool mOutputResultsForChasteVisualizer
 
std::vector< boost::shared_ptr
< AbstractCellWriter
< ELEMENT_DIM, ELEMENT_DIM > > > 
mCellWriters
 
std::vector< boost::shared_ptr
< AbstractCellPopulationWriter
< ELEMENT_DIM, ELEMENT_DIM > > > 
mCellPopulationWriters
 
std::vector< boost::shared_ptr
< AbstractCellPopulationCountWriter
< ELEMENT_DIM, ELEMENT_DIM > > > 
mCellPopulationCountWriters
 

Detailed Description

template<unsigned DIM>
class CaBasedCellPopulation< DIM >

A facade class encapsulating a cell population under the Cellular Automaton (CA) framework.

Contains a group of cells and maintains the associations between CellPtrs and nodes in a specialised PottsMesh class.

When used here the PottsMesh has no elements as Cells are associated with nodes. The PottsMesh is used to define node connectivity.

Multiple cells can be associated at a single node.

Definition at line 70 of file CaBasedCellPopulation.hpp.

Constructor & Destructor Documentation

template<unsigned DIM>
CaBasedCellPopulation< DIM >::CaBasedCellPopulation ( PottsMesh< DIM > &  rMesh,
std::vector< CellPtr > &  rCells,
const std::vector< unsigned locationIndices,
unsigned  latticeCarryingCapacity = 1u,
bool  deleteMesh = false,
bool  validate = false 
)

Create a new cell population facade from a mesh, a vector of location indices and a collection of cells.

There must be precisely one CellPtr for each entry of the locationIndices vector.

Parameters
rMeshreference to a PottsMesh
rCellsreference to a vector of CellPtrs
locationIndicesa vector of location indices that correspond to real cells
latticeCarryingCapacityan optional parameter to allow more than one cell per site
deleteMeshset to true if you want the cell population to free the mesh memory on destruction (defaults to false)
validatewhether to validate the cell population when it is created (defaults to false as not used in CA simulations)

Definition at line 69 of file CaBasedCellPopulation.cpp.

References EXCEPTION, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), CaBasedCellPopulation< DIM >::GetNumNodes(), CaBasedCellPopulation< DIM >::IsSiteAvailable(), CaBasedCellPopulation< DIM >::mAvailableSpaces, AbstractCellPopulation< DIM >::mCells, CaBasedCellPopulation< DIM >::mpCaBasedDivisionRule, and AbstractCellPopulation< DIM >::mrMesh.

template<unsigned DIM>
CaBasedCellPopulation< DIM >::CaBasedCellPopulation ( PottsMesh< DIM > &  rMesh)

Constructor for use by the de-serializer.

Parameters
rMesha Ca mesh.

Definition at line 110 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
CaBasedCellPopulation< DIM >::~CaBasedCellPopulation ( )
virtual

Destructor, which frees any memory allocated by the constructor.

Definition at line 116 of file CaBasedCellPopulation.cpp.

Member Function Documentation

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::AcceptCellWriter ( boost::shared_ptr< AbstractCellWriter< DIM, DIM > >  pCellWriter,
CellPtr  pCell 
)
virtual

A virtual method to accept a cell writer so it can write data from this object to file.

Parameters
pCellWriterthe population writer.
pCellthe cell whose data are being written.

Definition at line 503 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::AcceptPopulationCountWriter ( boost::shared_ptr< AbstractCellPopulationCountWriter< DIM, DIM > >  pPopulationCountWriter)
virtual

A virtual method to accept a cell population count writer so it can write data from this object to file.

Parameters
pPopulationCountWriterthe population count writer.

Definition at line 497 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::AcceptPopulationWriter ( boost::shared_ptr< AbstractCellPopulationWriter< DIM, DIM > >  pPopulationWriter)
virtual

A virtual method to accept a cell population writer so it can write data from this object to file.

Parameters
pPopulationWriterthe population writer.

Definition at line 491 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
CellPtr CaBasedCellPopulation< DIM >::AddCell ( CellPtr  pNewCell,
const c_vector< double, DIM > &  rCellDivisionVector,
CellPtr  pParentCell = CellPtr() 
)

Overridden AddCell() method.

Add a new cell to the cell population.

Parameters
pNewCellthe cell to add
rCellDivisionVectorthis parameter is not yet used in this class (see #1737)
pParentCellpointer to a parent cell (if required)
Returns
address of cell as it appears in the cell list (internal of this method uses a copy constructor along the way)

Definition at line 222 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::AddCellUsingLocationIndex ( unsigned  index,
CellPtr  pCell 
)
virtual

Overridden AddCellUsingLocationIndex method to add a cell to a given location index. Also updates mAvailableSpaces

Parameters
indexthe location index
pCellthe cell.

Reimplemented from AbstractCellPopulation< DIM >.

Definition at line 194 of file CaBasedCellPopulation.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::AddCellUsingLocationIndex(), and EXCEPTION.

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::AddSwitchingUpdateRule ( boost::shared_ptr< AbstractCaSwitchingUpdateRule< DIM > >  pUpdateRule)

Add a switching update rule to be used in this simulation (use this to set up how cells move).

Parameters
pUpdateRulepointer to an update rule

Definition at line 555 of file CaBasedCellPopulation.cpp.

Referenced by OnLatticeSimulation< DIM >::AddCaSwitchingUpdateRule().

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::AddUpdateRule ( boost::shared_ptr< AbstractCaUpdateRule< DIM > >  pUpdateRule)

Add an update rule to be used in this simulation (use this to set up how cells move).

Parameters
pUpdateRulepointer to an update rule

Definition at line 537 of file CaBasedCellPopulation.cpp.

Referenced by OnLatticeSimulation< DIM >::AddCaUpdateRule().

template<unsigned DIM>
double CaBasedCellPopulation< DIM >::EvaluateDivisionPropensity ( unsigned  currentNodeIndex,
unsigned  targetNodeIndex,
CellPtr  pCell 
)
virtual

Calculate the propensity of a dividing into a given site. Overridden in child classes to define other division methods. eg directed division.

Parameters
currentNodeIndexThe index of the current node/lattice site
targetNodeIndexThe index of the target node/lattice site
pCella pointer to the cell (needed if more than one cell per lattice site
Returns
The probability of the cell dividing from the current node to the target node

Definition at line 237 of file CaBasedCellPopulation.cpp.

Referenced by ExclusionCaBasedDivisionRule< SPACE_DIM >::CalculateDaughterNodeIndex().

template<unsigned DIM>
boost::shared_ptr< AbstractCaBasedDivisionRule< DIM > > CaBasedCellPopulation< DIM >::GetCaBasedDivisionRule ( )
Returns
The Ca division rule that is currently being used.

Definition at line 573 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
c_vector< double, DIM > CaBasedCellPopulation< DIM >::GetLocationOfCellCentre ( CellPtr  pCell)
virtual

Overridden GetLocationOfCellCentre() method. Find where a given cell is in space.

Parameters
pCellthe cell
Returns
the location of the node corresponding to this cell.

Implements AbstractCellPopulation< DIM >.

Definition at line 182 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
std::set< unsigned > CaBasedCellPopulation< DIM >::GetNeighbouringLocationIndices ( CellPtr  pCell)
virtual

Overridden GetNeighbouringLocationIndices() method.

Given a cell, returns the set of location indices corresponding to neighbouring cells.

Note: In keeping with other parts of the code in this class, we assume a Moore neighbourhood. Also, at present this method assumes a unit carrying capacity at each lattice site.

Parameters
pCella cell
Returns
the set of neighbouring location indices.

Implements AbstractCellPopulation< DIM >.

Definition at line 162 of file CaBasedCellPopulation.cpp.

References PottsMesh< DIM >::GetMooreNeighbouringNodeIndices().

template<unsigned DIM>
Node< DIM > * CaBasedCellPopulation< DIM >::GetNode ( unsigned  index)
virtual

Overridden GetNode() method.

Parameters
indexglobal index of the specified node
Returns
a pointer to the node.

Implements AbstractCellPopulation< DIM >.

Definition at line 150 of file CaBasedCellPopulation.cpp.

Referenced by DiffusionCaUpdateRule< DIM >::EvaluateProbability().

template<unsigned DIM>
Node< DIM > * CaBasedCellPopulation< DIM >::GetNodeCorrespondingToCell ( CellPtr  pCell)

Get a pointer to the node corresponding to a given CellPtr.

Parameters
pCellthe cell
Returns
pointer to the node.

Definition at line 188 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
unsigned CaBasedCellPopulation< DIM >::GetNumNodes ( )
virtual

Overridden GetNumNodes() method.

Returns
the number of nodes in the cell population.

Implements AbstractCellPopulation< DIM >.

Definition at line 156 of file CaBasedCellPopulation.cpp.

Referenced by CaBasedCellPopulation< DIM >::CaBasedCellPopulation().

template<unsigned DIM>
double CaBasedCellPopulation< DIM >::GetVolumeOfCell ( CellPtr  pCell)
virtual

Overridden GetVolumeOfCell() method.

Parameters
pCellboost shared pointer to a cell
Returns
volume via associated mesh element

Implements AbstractCellPopulation< DIM >.

Definition at line 523 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
double CaBasedCellPopulation< DIM >::GetWidth ( const unsigned rDimension)
virtual

Overridden GetWidth() method.

Calculate the 'width' of any dimension of the cell population by calling GetWidth() on the mesh.

Note this returns the size of the underlying mesh not the population of cells so here it will be the same for all time.

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

Implements AbstractCellPopulation< DIM >.

Definition at line 530 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
bool CaBasedCellPopulation< DIM >::IsCellAssociatedWithADeletedLocation ( CellPtr  pCell)
virtual

Overridden IsCellAssociatedWithADeletedLocation() method.

Parameters
pCellthe cell
Returns
whether a given cell is associated with a deleted node.

Implements AbstractCellPopulation< DIM >.

Definition at line 480 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
bool CaBasedCellPopulation< DIM >::IsRoomToDivide ( CellPtr  pCell)
virtual

Overridden IsRoomToDivide() method. Returns whether there are any available neighbouring sites to the one occupied by a given cell.

Parameters
pCellpointer to a cell
Returns
whether the cell has any free neighbouring sites

Reimplemented from AbstractCellPopulation< DIM >.

Definition at line 216 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
bool CaBasedCellPopulation< DIM >::IsSiteAvailable ( unsigned  index,
CellPtr  pCell 
)
virtual

Find if a given node has space available. Overridden in subclasses to implement different division regimes.

Todo:
Which subclasses? Why is the second input argument needed?
Parameters
indexThe global index of a specified node.
pCellThe cell wanting to divide into the lattice site (defaults to NULL).
Returns
whether the node is an empty site
Todo:
this is where to deal with carrying capacity

Definition at line 131 of file CaBasedCellPopulation.cpp.

Referenced by CaBasedCellPopulation< DIM >::CaBasedCellPopulation(), ExclusionCaBasedDivisionRule< SPACE_DIM >::CalculateDaughterNodeIndex(), and ExclusionCaBasedDivisionRule< SPACE_DIM >::IsRoomToDivide().

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::OpenWritersFiles ( OutputFileHandler rOutputFileHandler)
virtual

Overridden OpenWritersFiles() method.

Open all files in mCellPopulationWriters and mCellWriters for writing (not appending).

Parameters
rOutputFileHandlerhandler for the directory in which to open this file.

Reimplemented from AbstractCellPopulation< DIM >.

Definition at line 509 of file CaBasedCellPopulation.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::OpenWritersFiles().

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::OutputCellPopulationParameters ( out_stream &  rParamsFile)
virtual

Outputs CellPopulation parameters to file

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

Parameters
rParamsFilethe file stream to which the parameters are output

Reimplemented from AbstractOnLatticeCellPopulation< DIM >.

Definition at line 585 of file CaBasedCellPopulation.cpp.

References AbstractOnLatticeCellPopulation< DIM >::OutputCellPopulationParameters().

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::RemoveAllSwitchingUpdateRules ( )

Method to remove all the switching update rules

Definition at line 561 of file CaBasedCellPopulation.cpp.

Referenced by OnLatticeSimulation< DIM >::RemoveAllCaSwitchingUpdateRules().

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::RemoveAllUpdateRules ( )

Method to remove all the update rules

Definition at line 543 of file CaBasedCellPopulation.cpp.

Referenced by OnLatticeSimulation< DIM >::RemoveAllCaUpdateRules().

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::RemoveCellUsingLocationIndex ( unsigned  index,
CellPtr  pCell 
)
virtual

Overridden AddCellUsingLocationIndex method to remove a cell from a given location index. Also updates mAvailableSpaces

Parameters
indexthe location index
pCellthe cell.

Reimplemented from AbstractCellPopulation< DIM >.

Definition at line 206 of file CaBasedCellPopulation.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::RemoveCellUsingLocationIndex().

template<unsigned DIM>
unsigned CaBasedCellPopulation< DIM >::RemoveDeadCells ( )
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 245 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
std::vector< unsigned > & CaBasedCellPopulation< DIM >::rGetAvailableSpaces ( )
Returns
mAvailableSpaces.

Definition at line 125 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
const PottsMesh< DIM > & CaBasedCellPopulation< DIM >::rGetMesh ( ) const
Returns
const reference to mrMesh (used in archiving).

Definition at line 144 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
const std::vector< boost::shared_ptr< AbstractCaSwitchingUpdateRule< DIM > > > & CaBasedCellPopulation< DIM >::rGetSwitchingUpdateRuleCollection ( ) const

Get the collection of switching update rules to be used in this simulation.

Returns
the update rule collection

Definition at line 567 of file CaBasedCellPopulation.cpp.

Referenced by OnLatticeSimulation< DIM >::OutputAdditionalSimulationSetup().

template<unsigned DIM>
const std::vector< boost::shared_ptr< AbstractCaUpdateRule< DIM > > > & CaBasedCellPopulation< DIM >::rGetUpdateRuleCollection ( ) const

Get the collection of update rules to be used in this simulation.

Returns
the update rule collection

Definition at line 549 of file CaBasedCellPopulation.cpp.

Referenced by OnLatticeSimulation< DIM >::OutputAdditionalSimulationSetup().

template<unsigned DIM>
template<class Archive >
void CaBasedCellPopulation< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

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

Definition at line 114 of file CaBasedCellPopulation.hpp.

References CaBasedCellPopulation< DIM >::mAvailableSpaces, CaBasedCellPopulation< DIM >::mLatticeCarryingCapacity, CaBasedCellPopulation< DIM >::mpCaBasedDivisionRule, and CaBasedCellPopulation< DIM >::mUpdateRuleCollection.

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::SetCaBasedDivisionRule ( boost::shared_ptr< AbstractCaBasedDivisionRule< DIM > >  pCaBasedDivisionRule)

Set the division rule for this population.

Parameters
pCaBasedDivisionRulepointer to the new division rule

Definition at line 579 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::SetEmptySites ( const std::set< unsigned > &  rEmptySiteIndices)
private

Set the empty sites by taking in a set of which nodes indices are empty sites.

Parameters
rEmptySiteIndicesset of node indices corresponding to empty sites
template<unsigned DIM>
void CaBasedCellPopulation< DIM >::Update ( bool  hasHadBirthsOrDeaths = true)
virtual

Overridden Update() method.

Checks association of nodes with CellPtrs.

Parameters
hasHadBirthsOrDeaths- a bool saying whether cell population has had Births Or Deaths

Implements AbstractCellPopulation< DIM >.

Definition at line 486 of file CaBasedCellPopulation.cpp.

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::UpdateCellLocations ( double  dt)
virtual
template<unsigned DIM>
void CaBasedCellPopulation< DIM >::Validate ( )
privatevirtual

Overridden Validate() method.

Not used in CA simulations so just contains NEVER_REACHED

Implements AbstractCellPopulation< DIM >.

Definition at line 63 of file CaBasedCellPopulation.cpp.

References NEVER_REACHED.

template<unsigned DIM>
void CaBasedCellPopulation< DIM >::WriteVtkResultsToFile ( const std::string &  rDirectory)
privatevirtual

Overridden WriteVtkResultsToFile() method.

This method offsets cells so can visulaise multiple cells at a single site

Parameters
rDirectorypathname of the output directory, relative to where Chaste output is stored

Implements AbstractCellPopulation< DIM >.

Definition at line 597 of file CaBasedCellPopulation.cpp.

References NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), SimulationTime::GetTimeStepsElapsed(), NodesOnlyMesh< SPACE_DIM >::GetWidth(), SimulationTime::Instance(), RandomNumberGenerator::Instance(), and RandomNumberGenerator::ranf().

Member Data Documentation

template<unsigned DIM>
std::vector<unsigned> CaBasedCellPopulation< DIM >::mAvailableSpaces
private

Records for each node the node the number of spaces available.

Definition at line 88 of file CaBasedCellPopulation.hpp.

Referenced by CaBasedCellPopulation< DIM >::CaBasedCellPopulation(), and CaBasedCellPopulation< DIM >::serialize().

template<unsigned DIM>
unsigned CaBasedCellPopulation< DIM >::mLatticeCarryingCapacity
private

The carrying capacity (number of cells allowed per site).

Definition at line 77 of file CaBasedCellPopulation.hpp.

Referenced by CaBasedCellPopulation< DIM >::serialize().

template<unsigned DIM>
boost::shared_ptr<AbstractCaBasedDivisionRule<DIM> > CaBasedCellPopulation< DIM >::mpCaBasedDivisionRule
private

A pointer to a division rule that is used to specify how cells divide. I.e do they move other cells out of the way. This is a specialisation for Ca models.

Definition at line 92 of file CaBasedCellPopulation.hpp.

Referenced by CaBasedCellPopulation< DIM >::CaBasedCellPopulation(), and CaBasedCellPopulation< DIM >::serialize().

template<unsigned DIM>
std::vector<boost::shared_ptr<AbstractCaSwitchingUpdateRule<DIM> > > CaBasedCellPopulation< DIM >::mSwitchingUpdateRuleCollection
private

The update rules used to determine the new location of the cells. THese rules specify is cells switch locations

Definition at line 85 of file CaBasedCellPopulation.hpp.

template<unsigned DIM>
std::vector<boost::shared_ptr<AbstractCaUpdateRule<DIM> > > CaBasedCellPopulation< DIM >::mUpdateRuleCollection
private

The update rules used to determine the new location of the cells. These rules specify how individual cells move into free spaces

Definition at line 81 of file CaBasedCellPopulation.hpp.

Referenced by CaBasedCellPopulation< DIM >::serialize().


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