Chaste
Release::3.4
|
#include <PottsBasedCellPopulation.hpp>
Public Member Functions | |
PottsBasedCellPopulation (PottsMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, bool deleteMesh=false, bool validate=true, const std::vector< unsigned > locationIndices=std::vector< unsigned >()) | |
PottsBasedCellPopulation (PottsMesh< DIM > &rMesh) | |
virtual | ~PottsBasedCellPopulation () |
PottsMesh< DIM > & | rGetMesh () |
const PottsMesh< DIM > & | rGetMesh () const |
PottsElement< DIM > * | GetElement (unsigned elementIndex) |
unsigned | GetNumElements () |
Node< DIM > * | GetNode (unsigned index) |
unsigned | GetNumNodes () |
std::set< unsigned > | GetNeighbouringLocationIndices (CellPtr pCell) |
c_vector< double, DIM > | GetLocationOfCellCentre (CellPtr pCell) |
PottsElement< DIM > * | GetElementCorrespondingToCell (CellPtr pCell) |
CellPtr | AddCell (CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell=CellPtr()) |
unsigned | RemoveDeadCells () |
void | UpdateCellLocations (double dt) |
bool | IsCellAssociatedWithADeletedLocation (CellPtr pCell) |
void | Update (bool hasHadBirthsOrDeaths=true) |
virtual void | OpenWritersFiles (OutputFileHandler &rOutputFileHandler) |
virtual void | WriteResultsToFiles (const std::string &rDirectory) |
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< AbstractPottsUpdateRule< DIM > > pUpdateRule) |
void | RemoveAllUpdateRules () |
const std::vector < boost::shared_ptr < AbstractPottsUpdateRule< DIM > > > & | rGetUpdateRuleCollection () const |
void | OutputCellPopulationParameters (out_stream &rParamsFile) |
void | SetTemperature (double temperature) |
double | GetTemperature () |
void | SetNumSweepsPerTimestep (unsigned numSweepsPerTimestep) |
unsigned | GetNumSweepsPerTimestep () |
void | CreateElementTessellation () |
VertexMesh< DIM, DIM > * | GetElementTessellation () |
void | CreateMutableMesh () |
MutableMesh< DIM, DIM > * | GetMutableMesh () |
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< unsigned > | GetNeighbouringNodeIndices (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< unsigned > | GetCellMutationStateCount () |
std::vector< unsigned > | GetCellProliferativeTypeCount () |
std::vector< unsigned > | GetCellCyclePhaseCount () |
unsigned | GetNumRealCells () |
unsigned | GetNumAllCells () |
void | SetCellAncestorsToLocationIndices () |
std::set< unsigned > | GetCellAncestors () |
virtual CellPtr | GetCellUsingLocationIndex (unsigned index) |
std::set< CellPtr > | GetCellsUsingLocationIndex (unsigned index) |
bool | IsCellAttachedToLocationIndex (unsigned index) |
void | SetCellUsingLocationIndex (unsigned index, CellPtr pCell) |
virtual void | AddCellUsingLocationIndex (unsigned index, CellPtr pCell) |
virtual void | RemoveCellUsingLocationIndex (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 | 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 () |
virtual bool | IsRoomToDivide (CellPtr pCell) |
std::pair< unsigned, unsigned > | CreateOrderedPair (unsigned index1, unsigned index2) |
Iterator | Begin () |
Iterator | End () |
Public Member Functions inherited from Identifiable | |
virtual | ~Identifiable () |
std::string | GetIdentifier () const |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
void | Validate () |
virtual void | WriteVtkResultsToFile (const std::string &rDirectory) |
Private Attributes | |
VertexMesh< DIM, DIM > * | mpElementTessellation |
PottsMesh< DIM > * | mpPottsMesh |
MutableMesh< DIM, DIM > * | mpMutableMesh |
std::vector< boost::shared_ptr < AbstractPottsUpdateRule< DIM > > > | mUpdateRuleCollection |
double | mTemperature |
unsigned | mNumSweepsPerTimestep |
Friends | |
class | TestPottsBasedCellPopulation |
class | boost::serialization::access |
A facade class encapsulating a cell population under the Cellular Potts Model framework.
Contains a group of cells and maintains the associations between CellPtrs and elements in a specialised PottsMesh class.
The code currently requires the PottsMesh object to be fixed, in the sense that no new nodes or elements can be added.
Definition at line 63 of file PottsBasedCellPopulation.hpp.
PottsBasedCellPopulation< DIM >::PottsBasedCellPopulation | ( | PottsMesh< DIM > & | rMesh, |
std::vector< CellPtr > & | rCells, | ||
bool | deleteMesh = false , |
||
bool | validate = true , |
||
const std::vector< unsigned > | locationIndices = std::vector<unsigned>() |
||
) |
Create a new cell population facade from a mesh and collection of cells.
There must be precisely one CellPtr for each PottsElement in the mesh.
rMesh | reference to a PottsMesh |
rCells | reference to a vector of CellPtrs |
deleteMesh | set to true if you want the cell population to free the mesh memory on destruction (defaults to false) |
validate | whether to validate the cell population when it is created (defaults to true) |
locationIndices | an optional vector of location indices that correspond to real cells |
Definition at line 78 of file PottsBasedCellPopulation.cpp.
References PottsBasedCellPopulation< DIM >::mpPottsMesh, AbstractCellPopulation< DIM >::mrMesh, and PottsBasedCellPopulation< DIM >::Validate().
PottsBasedCellPopulation< DIM >::PottsBasedCellPopulation | ( | PottsMesh< DIM > & | rMesh | ) |
Constructor for use by the de-serializer.
rMesh | a vertex mesh. |
Definition at line 98 of file PottsBasedCellPopulation.cpp.
References PottsBasedCellPopulation< DIM >::mpPottsMesh, and AbstractCellPopulation< DIM >::mrMesh.
|
virtual |
Destructor, which frees any memory allocated by the constructor.
Definition at line 109 of file PottsBasedCellPopulation.cpp.
|
virtual |
A virtual method to accept a cell writer so it can write data from this object to file.
pCellWriter | the population writer. |
pCell | the cell whose data are being written. |
Definition at line 374 of file PottsBasedCellPopulation.cpp.
|
virtual |
A virtual method to accept a cell population count writer so it can write data from this object to file.
pPopulationCountWriter | the population count writer. |
Definition at line 368 of file PottsBasedCellPopulation.cpp.
|
virtual |
A virtual method to accept a cell population writer so it can write data from this object to file.
pPopulationWriter | the population writer. |
Definition at line 362 of file PottsBasedCellPopulation.cpp.
CellPtr PottsBasedCellPopulation< DIM >::AddCell | ( | CellPtr | pNewCell, |
const c_vector< double, DIM > & | rCellDivisionVector, | ||
CellPtr | pParentCell = CellPtr() |
||
) |
Overridden AddCell() method.
Add a new cell to the cell population.
pNewCell | the cell to add |
rCellDivisionVector | this parameter is not yet used in this class (see #1737) |
pParentCell | pointer to a parent cell (if required) |
Definition at line 177 of file PottsBasedCellPopulation.cpp.
void PottsBasedCellPopulation< DIM >::AddUpdateRule | ( | boost::shared_ptr< AbstractPottsUpdateRule< DIM > > | pUpdateRule | ) |
Add an update rule to be used in this simulation (use this to set up the Hamiltonian).
pUpdateRule | pointer to an update rule |
Definition at line 401 of file PottsBasedCellPopulation.cpp.
Referenced by OnLatticeSimulation< DIM >::AddPottsUpdateRule().
void PottsBasedCellPopulation< DIM >::CreateElementTessellation | ( | ) |
Create a Element tessellation of the mesh for use in visualising the mesh.
Definition at line 419 of file PottsBasedCellPopulation.cpp.
void PottsBasedCellPopulation< DIM >::CreateMutableMesh | ( | ) |
Create a mutable mesh from the nodes of the Potts mesh. Used for solving PDEs
Definition at line 444 of file PottsBasedCellPopulation.cpp.
PottsElement< DIM > * PottsBasedCellPopulation< DIM >::GetElement | ( | unsigned | elementIndex | ) |
Get a particular PottsElement.
elementIndex | the global index of the PottsElement |
Definition at line 134 of file PottsBasedCellPopulation.cpp.
Referenced by CellPopulationElementWriter< ELEMENT_DIM, SPACE_DIM >::Visit().
PottsElement< DIM > * PottsBasedCellPopulation< DIM >::GetElementCorrespondingToCell | ( | CellPtr | pCell | ) |
Get a pointer to the element corresponding to a given CellPtr.
pCell | the cell |
Definition at line 171 of file PottsBasedCellPopulation.cpp.
VertexMesh< DIM, DIM > * PottsBasedCellPopulation< DIM >::GetElementTessellation | ( | ) |
Definition at line 437 of file PottsBasedCellPopulation.cpp.
|
virtual |
Overridden GetLocationOfCellCentre() method. Find where a given cell is in space.
pCell | the cell |
Implements AbstractCellPopulation< DIM >.
Definition at line 165 of file PottsBasedCellPopulation.cpp.
MutableMesh< DIM, DIM > * PottsBasedCellPopulation< DIM >::GetMutableMesh | ( | ) |
Definition at line 460 of file PottsBasedCellPopulation.cpp.
|
virtual |
Overridden GetNeighbouringLocationIndices() method.
Given a cell, returns the set of location indices corresponding to neighbouring cells.
pCell | a cell |
Implements AbstractCellPopulation< DIM >.
Definition at line 158 of file PottsBasedCellPopulation.cpp.
Referenced by HeterotypicBoundaryLengthWriter< ELEMENT_DIM, SPACE_DIM >::Visit().
|
virtual |
Overridden GetNode() method.
index | global index of the specified node |
Implements AbstractCellPopulation< DIM >.
Definition at line 146 of file PottsBasedCellPopulation.cpp.
Referenced by ChemotaxisPottsUpdateRule< DIM >::EvaluateHamiltonianContribution(), AdhesionPottsUpdateRule< DIM >::EvaluateHamiltonianContribution(), VolumeConstraintPottsUpdateRule< DIM >::EvaluateHamiltonianContribution(), SurfaceAreaConstraintPottsUpdateRule< DIM >::EvaluateHamiltonianContribution(), and HeterotypicBoundaryLengthWriter< ELEMENT_DIM, SPACE_DIM >::Visit().
unsigned PottsBasedCellPopulation< DIM >::GetNumElements | ( | ) |
Definition at line 140 of file PottsBasedCellPopulation.cpp.
|
virtual |
Overridden GetNumNodes() method.
Implements AbstractCellPopulation< DIM >.
Definition at line 152 of file PottsBasedCellPopulation.cpp.
unsigned PottsBasedCellPopulation< DIM >::GetNumSweepsPerTimestep | ( | ) |
Definition at line 495 of file PottsBasedCellPopulation.cpp.
double PottsBasedCellPopulation< DIM >::GetTemperature | ( | ) |
Definition at line 483 of file PottsBasedCellPopulation.cpp.
|
virtual |
Overridden GetVolumeOfCell() method.
pCell | boost shared pointer to a cell |
Implements AbstractCellPopulation< DIM >.
Definition at line 380 of file PottsBasedCellPopulation.cpp.
|
virtual |
Overridden GetWidth() method.
Calculate the 'width' of any dimension of the cell population by calling GetWidth() on the mesh.
rDimension | a dimension (0,1 or 2) |
Implements AbstractCellPopulation< DIM >.
Definition at line 392 of file PottsBasedCellPopulation.cpp.
|
virtual |
Overridden IsCellAssociatedWithADeletedLocation() method.
pCell | the cell |
Implements AbstractCellPopulation< DIM >.
Definition at line 327 of file PottsBasedCellPopulation.cpp.
|
virtual |
Overridden OpenWritersFiles() method.
Open all files in mCellPopulationWriters and mCellWriters for writing (not appending).
rOutputFileHandler | handler for the directory in which to open this file. |
Reimplemented from AbstractCellPopulation< DIM >.
Definition at line 338 of file PottsBasedCellPopulation.cpp.
References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::OpenWritersFiles().
|
virtual |
Outputs CellPopulation parameters to file
As this method is pure virtual, it must be overridden in subclasses.
rParamsFile | the file stream to which the parameters are output |
Reimplemented from AbstractOnLatticeCellPopulation< DIM >.
Definition at line 467 of file PottsBasedCellPopulation.cpp.
References AbstractOnLatticeCellPopulation< DIM >::OutputCellPopulationParameters().
void PottsBasedCellPopulation< DIM >::RemoveAllUpdateRules | ( | ) |
Method to remove all the update rules
Definition at line 407 of file PottsBasedCellPopulation.cpp.
Referenced by OnLatticeSimulation< DIM >::RemoveAllPottsUpdateRules().
|
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.
Implements AbstractCellPopulation< DIM >.
Definition at line 195 of file PottsBasedCellPopulation.cpp.
PottsMesh< DIM > & PottsBasedCellPopulation< DIM >::rGetMesh | ( | ) |
Definition at line 122 of file PottsBasedCellPopulation.cpp.
Referenced by AdhesionPottsUpdateRule< DIM >::EvaluateHamiltonianContribution(), VolumeConstraintPottsUpdateRule< DIM >::EvaluateHamiltonianContribution(), SurfaceAreaConstraintPottsUpdateRule< DIM >::EvaluateHamiltonianContribution(), CellPopulationElementWriter< ELEMENT_DIM, SPACE_DIM >::Visit(), and HeterotypicBoundaryLengthWriter< ELEMENT_DIM, SPACE_DIM >::Visit().
const PottsMesh< DIM > & PottsBasedCellPopulation< DIM >::rGetMesh | ( | ) | const |
Definition at line 128 of file PottsBasedCellPopulation.cpp.
const std::vector< boost::shared_ptr< AbstractPottsUpdateRule< DIM > > > & PottsBasedCellPopulation< DIM >::rGetUpdateRuleCollection | ( | ) | const |
Get the collection of update rules to be used in this simulation.
Definition at line 413 of file PottsBasedCellPopulation.cpp.
Referenced by OnLatticeSimulation< DIM >::OutputAdditionalSimulationSetup().
|
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.
archive | the archive |
version | the current version of this class |
Definition at line 113 of file PottsBasedCellPopulation.hpp.
References PottsBasedCellPopulation< DIM >::mNumSweepsPerTimestep, PottsBasedCellPopulation< DIM >::mpElementTessellation, PottsBasedCellPopulation< DIM >::mTemperature, and PottsBasedCellPopulation< DIM >::mUpdateRuleCollection.
void PottsBasedCellPopulation< DIM >::SetNumSweepsPerTimestep | ( | unsigned | numSweepsPerTimestep | ) |
Set mNumSweepsPerTimestep.
numSweepsPerTimestep | the number of MonteCarlo sweeps of the mesh performed each timestep |
Definition at line 489 of file PottsBasedCellPopulation.cpp.
void PottsBasedCellPopulation< DIM >::SetTemperature | ( | double | temperature | ) |
Set mTemperature.
temperature | the temperature of the system |
Definition at line 477 of file PottsBasedCellPopulation.cpp.
|
virtual |
Remove the PottsElements which have been marked as deleted, and update the correspondence with CellPtrs.
hasHadBirthsOrDeaths | - a bool saying whether cell population has had Births Or Deaths |
Implements AbstractCellPopulation< DIM >.
Definition at line 333 of file PottsBasedCellPopulation.cpp.
|
virtual |
Overridden UpdateCellLocations() method.
dt | time step |
Implements AbstractOnLatticeCellPopulation< DIM >.
Definition at line 218 of file PottsBasedCellPopulation.cpp.
References Node< SPACE_DIM >::GetIndex(), Node< SPACE_DIM >::GetNumContainingElements(), RandomNumberGenerator::Instance(), RandomNumberGenerator::randMod(), RandomNumberGenerator::ranf(), Node< SPACE_DIM >::rGetContainingElementIndices(), and RandomNumberGenerator::Shuffle().
|
privatevirtual |
Check the consistency of internal data structures. Each PottsElement must have a CellPtr associated with it.
Implements AbstractCellPopulation< DIM >.
Definition at line 50 of file PottsBasedCellPopulation.cpp.
References EXCEPTION, and SimulationTime::Instance().
Referenced by PottsBasedCellPopulation< DIM >::PottsBasedCellPopulation().
|
virtual |
Overridden WriteResultsToFiles() method.
rDirectory | pathname of the output directory, relative to where Chaste output is stored |
Reimplemented from AbstractCellPopulation< DIM >.
Definition at line 354 of file PottsBasedCellPopulation.cpp.
References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::WriteResultsToFiles().
|
privatevirtual |
Overridden WriteVtkResultsToFile() method.
As a CellIdWriter is added to the population in the overridden method OpenWritersFiles(), distinct cells can be visualized when viewing VTK output of Potts model simulations.
rDirectory | pathname of the output directory, relative to where Chaste output is stored |
Implements AbstractCellPopulation< DIM >.
Definition at line 501 of file PottsBasedCellPopulation.cpp.
References NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), SimulationTime::GetTimeStepsElapsed(), SimulationTime::Instance(), VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), and VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh().
|
private |
The number of MonteCarlo sweeps of the mesh performed each timestep. Initialised to 1 in the constructor.
Definition at line 98 of file PottsBasedCellPopulation.hpp.
Referenced by PottsBasedCellPopulation< DIM >::serialize().
|
private |
Pointer to a VertexMesh object that stores the Element tessellation that is used to visualize mrMesh. The tessellation is created by calling CreateElementTessellation() and can be accessed by calling GetElementTessellation().
Definition at line 74 of file PottsBasedCellPopulation.hpp.
Referenced by PottsBasedCellPopulation< DIM >::serialize().
|
private |
Pointer to a MutableMesh that can be created from the nodes of the PottsMesh in order to solve PDEs on the population.
Definition at line 86 of file PottsBasedCellPopulation.hpp.
|
private |
A static cast of the Abstract mesh from `AbstractCellPopulation` for use in this class
Definition at line 80 of file PottsBasedCellPopulation.hpp.
Referenced by PottsBasedCellPopulation< DIM >::PottsBasedCellPopulation().
|
private |
The temperature of the system. Initialized to 0.1 in the constructor.
Definition at line 92 of file PottsBasedCellPopulation.hpp.
Referenced by PottsBasedCellPopulation< DIM >::serialize().
|
private |
The update rules used to determine the new location of the cells.
Definition at line 89 of file PottsBasedCellPopulation.hpp.
Referenced by PottsBasedCellPopulation< DIM >::serialize().