#include <AbstractCellBasedSimulation.hpp>
Inherits Identifiable.
Inherited by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >.
An abstract cell-based simulation class. This class contains common functionality from off lattice and on lattice simulations.
The AbstractCellBasedSimulation is constructed with a CellPopulation, which updates the correspondence between each Cell and its spatial representation and handles cell division (governed by the CellCycleModel associated with each cell). Once constructed, one or more CellKillers may be passed to the AbstractCellBasedSimulation object to specify conditions in which Cells may die,
Subclasses use one or more Force laws or update rules (Which are passed to the child class object) to define the mechanical properties of the CellPopulation.
Definition at line 66 of file AbstractCellBasedSimulation.hpp.
AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::AbstractCellBasedSimulation | ( | AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > & | rCellPopulation, | |
bool | deleteCellPopulationInDestructor = false , |
|||
bool | initialiseCells = true | |||
) | [inline] |
Constructor.
rCellPopulation | A cell population object | |
deleteCellPopulationInDestructor | Whether to delete the cell population on destruction to free up memory (defaults to false) | |
initialiseCells | Whether to initialise cells (defaults to true; set to false when loading from an archive) |
Definition at line 50 of file AbstractCellBasedSimulation.cpp.
References RandomNumberGenerator::Instance(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mInitialiseCells, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::~AbstractCellBasedSimulation | ( | ) | [inline, virtual] |
Destructor.
This frees the cell population if it was created by de-serialization.
Definition at line 79 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDeleteCellPopulationInDestructor, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpCellBasedPdeHandler, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::AddCellKiller | ( | boost::shared_ptr< AbstractCellKiller< SPACE_DIM > > | pCellKiller | ) | [inline] |
Add a cell killer to be used in this simulation.
pCellKiller | pointer to a cell killer |
Definition at line 275 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mCellKillers.
Referenced by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OffLatticeSimulation().
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::AddSimulationModifier | ( | boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM > > | pSimulationModifier | ) | [inline] |
Add a SimulationModifier to be used in this simulation.
pSimulationModifier | pointer to a SimulationModifier |
Definition at line 287 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationModifiers.
virtual c_vector<double, SPACE_DIM> AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::CalculateCellDivisionVector | ( | CellPtr | pParentCell | ) | [protected, pure virtual] |
Method for determining how cell division occurs. This method returns a vector which is then passed into the CellPopulation method AddCell().
As this method is pure virtual, it must be overridden in subclasses.
pParentCell | the parent cell |
Implemented in OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >, OnLatticeSimulation< DIM >, CryptSimulation1d, CryptSimulation2d, OffLatticeSimulation< 1 >, and OffLatticeSimulation< 2 >.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellBirth().
unsigned AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellBirth | ( | ) | [inline, protected, virtual] |
During a simulation time step, process any cell divisions that need to occur. If the simulation includes cell birth, causes (almost) all cells that are ready to divide to produce daughter cells.
If mOutputDivisionLocations is set to true, then this method also writes the location of each cell division at the present time to mpDivisionLocationFile. This outputs a line of tab-separated values of the form: [time] [div 0 x-pos] [div 0 y-pos] [div 0 z-pos] [div 0 age] [div 1 x-pos] [div 1 y-pos] [div 1 z-pos] [div 1 age] ...
with [y-pos] and [z-pos] included for 2 and 3 dimensional simulations, respectively, and [...age] denoting the age of the dividing cell.
For consistency with the rest of the output code, consider removing the AbstractCellBasedSimulation member mOutputDivisionLocations, adding a new member mAgesAndLocationsOfDividingCells to AbstractCellPopulation, adding a new class CellDivisionLocationsWriter to the CellPopulationWriter hierarchy to output the content of mAgesAndLocationsOfDividingCells to file (remembering to clear mAgesAndLocationsOfDividingCells at each timestep), and replacing the following conditional statement with something like
if (mrCellPopulation.HasWriter<CellDivisionLocationsWriter>()) { mCellDivisionLocations.push_back(new_location); }
Definition at line 101 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::CalculateCellDivisionVector(), SimulationTime::GetTime(), SimulationTime::Instance(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNoBirth, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDivisionLocations, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpDivisionLocationFile, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation().
unsigned AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellRemoval | ( | ) | [inline, protected] |
During a simulation time step, process any cell sloughing or death
This uses the cell killers to remove cells and associated nodes from the facade class.
Definition at line 172 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mCellKillers, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation().
CellBasedPdeHandler< SPACE_DIM > * AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetCellBasedPdeHandler | ( | ) | [inline] |
Definition at line 95 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpCellBasedPdeHandler.
double AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetDt | ( | ) | [inline] |
Definition at line 200 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDt.
std::vector< double > AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation | ( | const unsigned & | rNodeIndex | ) | [inline] |
Get a node's location (ONLY FOR TESTING).
rNodeIndex | the node index |
Definition at line 299 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
unsigned AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetNumBirths | ( | ) | [inline] |
Definition at line 206 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNumBirths.
unsigned AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetNumDeaths | ( | ) | [inline] |
Definition at line 212 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNumDeaths.
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetOutputCellVelocities | ( | ) | [inline] |
Definition at line 649 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputCellVelocities.
std::string AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetOutputDirectory | ( | ) | [inline] |
Definition at line 232 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDirectory.
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetOutputDivisionLocations | ( | ) | [inline] |
Definition at line 637 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDivisionLocations.
std::vector< boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM > > > * AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetSimulationModifiers | ( | ) | [inline] |
Definition at line 293 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationModifiers.
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetUpdateCellPopulationRule | ( | ) | [inline] |
Return whether to update the topology of the cell population at each time step.
Definition at line 263 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mUpdateCellPopulation.
virtual void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputAdditionalSimulationSetup | ( | out_stream & | rParamsFile | ) | [inline, protected, virtual] |
Helper method to output additional simulations parameters and information defined in subclasses to file.
rParamsFile | the file stream to which the parameters are output |
Reimplemented in OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >, OnLatticeSimulation< DIM >, OffLatticeSimulation< 1 >, and OffLatticeSimulation< 2 >.
Definition at line 270 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup().
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters | ( | out_stream & | rParamsFile | ) | [inline, pure virtual] |
Outputs simulation 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 |
Implemented in OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >, OnLatticeSimulation< DIM >, CryptSimulation1d, CryptSimulation2d, OffLatticeSimulation< 1 >, and OffLatticeSimulation< 2 >.
Definition at line 724 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDt, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mEndTime, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputCellVelocities, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDivisionLocations, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpCellBasedPdeHandler, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSamplingTimestepMultiple, and CellBasedPdeHandler< DIM >::OutputParameters().
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup().
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup | ( | ) | [inline, protected] |
Helper method to output all the simulations parameters and information to file.
Definition at line 661 of file AbstractCellBasedSimulation.cpp.
References PetscTools::AmMaster(), ExecutableSupport::GetBuildInfo(), Identifiable::GetIdentifier(), OutputFileHandler::GetOutputDirectoryFullPath(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mCellKillers, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationModifiers, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationOutputDirectory, OutputFileHandler::OpenOutputFile(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputAdditionalSimulationSetup(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputDirectory(), and ExecutableSupport::WriteMachineInfoFile().
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllCellKillers | ( | ) | [inline] |
Method to remove all the cell killers.
Definition at line 281 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mCellKillers.
const AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > & AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::rGetCellPopulation | ( | ) | const [inline] |
Definition at line 251 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > & AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::rGetCellPopulation | ( | ) | [inline] |
Definition at line 245 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Save or restore the simulation.
archive | the archive | |
version | the current version of this class |
Reimplemented in OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >, OnLatticeSimulation< DIM >, CryptSimulation1d, CryptSimulation2d, OffLatticeSimulation< 1 >, and OffLatticeSimulation< 2 >.
Definition at line 85 of file AbstractCellBasedSimulation.hpp.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetCellBasedPdeHandler | ( | CellBasedPdeHandler< SPACE_DIM > * | pCellBasedPdeHandler | ) | [inline] |
Set mpCellBasedPdeHandler
pCellBasedPdeHandler | pointer to a CellBasedPdeHandler object |
Definition at line 89 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpCellBasedPdeHandler.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetDt | ( | double | dt | ) | [inline] |
Set the timestep of the simulation.
dt | the timestep to use |
Definition at line 193 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDt.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetEndTime | ( | double | endTime | ) | [inline] |
Set the end time and resets the timestep to be endtime/100.
endTime | the end time to use |
Definition at line 218 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mEndTime.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetNoBirth | ( | bool | noBirth | ) | [inline] |
Set the simulation to run with no birth.
noBirth | whether to run with no birth |
Definition at line 269 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNoBirth.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputCellVelocities | ( | bool | outputCellVelocities | ) | [inline] |
Set mOutputCellVelocities.
outputCellVelocities | the new value of mOutputCellVelocities |
Definition at line 655 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputCellVelocities.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputDirectory | ( | std::string | outputDirectory | ) | [inline] |
Set the output directory of the simulation.
outputDirectory | the output directory to use |
Definition at line 225 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDirectory, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationOutputDirectory.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup().
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputDivisionLocations | ( | bool | outputDivisionLocations | ) | [inline] |
Set mOutputDivisionLocations.
outputDivisionLocations | the new value of mOutputDivisionLocations |
Definition at line 643 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDivisionLocations.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetSamplingTimestepMultiple | ( | unsigned | samplingTimestepMultiple | ) | [inline] |
Set the ratio of the number of actual timesteps to the number of timesteps at which results are written to file. Default value is set to 1 by the constructor.
samplingTimestepMultiple | the ratio to use |
Definition at line 238 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSamplingTimestepMultiple.
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetUpdateCellPopulationRule | ( | bool | updateCellPopulation | ) | [inline] |
Set whether to update the topology of the cell population at each time step.
updateCellPopulation | whether to update the cell population each time step |
Definition at line 257 of file AbstractCellBasedSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mUpdateCellPopulation.
virtual void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetupSolve | ( | ) | [inline, protected, virtual] |
A method for subclasses to do something at before the start of the time loop.
Reimplemented in OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >, CryptSimulation2d, OffLatticeSimulation< 1 >, and OffLatticeSimulation< 2 >.
Definition at line 228 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve | ( | ) | [inline] |
Main Solve() method, used to evolve the cell population. Note that prior to calling Solve() we must have called SetEndTime(). We may also have optionally called SetDt(); if not, then a default time step is used.
The Solve() method proceeds as follows.
Setting up:
First, we set up SimulationTime, which (i) provides a globally consistent time, accessible to all other classes in the cell_based code and (ii) handles any rounding issues when the time step does not exactly divide the end time.
Next, we create output files. We then call SetupSolve(), which is empty in the parent class but may be overridden, e.g. to open additional output files. We then call SetupSolve() on any member objects inheriting from AbstractCellBasedSimulationModifier. This class hierarchy allows the user to introduce new ways of updating the cell population within the simulation.
Next, we set up each cell by calling ReadyToDivide() on it, which updates the cell's age and cell cycle model. Finally, we call WriteVisualizerSetupFile() and OutputSimulationSetup(), as well as WriteResultsToFiles() on the cell population, to record the initial configration. This completes the set up process.
The main time loop:
At each time step, we begin by calling UpdateCellPopulation(), which implements any cell deaths and cell divisions through DoCellRemoval() and DoCellBirth() respectively. We then update the correspondence between cells and the mesh by calling Update() on the cell population.
If mOutputCellVelocities is set to true and we are at a printing time, then we als write the velocity of each cell at the present time to mpCellVelocitiesFile. This outputs a line of tab-separated values of the form: [time] [cell 0 x-pos] [cell 0 y-pos] [cell 0 z-pos] [cell 0 x-vel] [cell 0 y-vel] [cell 0 z-vel] ...
with [y-pos] and [z-pos] included for 2 and 3 dimensional simulations, respectively, and data for cells being ordered as given by the cell population Iterator.
Next, we call UpdateCellLocationsAndTopology(), which is pure virtual in the parent class so must be overridden. As the cell population has been updated, we then increment SimulationTime by one time step. We then call UpdateAtEndOfTimeStep() on any AbstractCellBasedSimulationModifiers present, e.g. to write additional output. In an analogous manner to the calls to SetupSolve() prior to entering the main time loop.
The last step within the main time loop is to output the present results to file.
Finishing up:
After exiting the main time loop, we call UpdateCellPopulation() in order to carry out a final update of the cell population. We also call UpdateAtEndOfSolve()} on any member objects inheriting from AbstractCellBasedSimulationModifier in an analogous manner to the aforementioned calls to SetupSolve() UpdateAtEndOfTimeStep(). Finally, we close output files. This completes the Solve() method.
Definition at line 310 of file AbstractCellBasedSimulation.cpp.
References PetscTools::AmMaster(), GenericEventHandler< 11, CellBasedEventHandler >::BeginEvent(), CellBasedPdeHandler< DIM >::CloseResultsFiles(), DOUBLE_UNSET, GenericEventHandler< 11, CellBasedEventHandler >::EndEvent(), EXCEPTION, SimulationTime::GetTime(), SimulationTime::GetTimeStepsElapsed(), SimulationTime::IncrementTimeOneStep(), SimulationTime::Instance(), SimulationTime::IsEndTimeAndNumberOfTimeStepsSetUp(), SimulationTime::IsFinished(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDt, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mEndTime, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputCellVelocities, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDirectory, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDivisionLocations, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpCellBasedPdeHandler, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpCellVelocitiesFile, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpDivisionLocationFile, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpVizSetupFile, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSamplingTimestepMultiple, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationModifiers, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationOutputDirectory, OutputFileHandler::OpenOutputFile(), CellBasedPdeHandler< DIM >::OpenResultsFiles(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup(), SimulationTime::ResetEndTimeAndNumberOfTimeSteps(), SimulationTime::SetEndTimeAndNumberOfTimeSteps(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetupSolve(), CellBasedPdeHandler< DIM >::SolvePdeAndWriteResultsToFile(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::StoppingEventHasOccurred(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellLocationsAndTopology(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::WriteVisualizerSetupFile().
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::StoppingEventHasOccurred | ( | ) | [inline, protected, virtual] |
A child class can overload this if they want the simulation to stop based on certain conditions before the specified end time (for example, run until a crypt becomes monoclonal).
Definition at line 596 of file AbstractCellBasedSimulation.cpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
virtual void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellLocationsAndTopology | ( | ) | [protected, pure virtual] |
Update the cell locations and topology (connectivity) of the cell population. This method is called within the main time loop of Solve() and is pure virtual in the parent class, so must be overridden.
In the case of an OffLatticeSimulation, the method computes the force acting on each node (corresponding to a cell in centre-based models and to a vertex in vertex-based models) and integrates equations of motion to find the new position of each node.
In the case of an OnLatticeSimulation, the method performs Monte Carlo updating of the cell population, through a call to UpdateCellLocations() on the cell population object.
Implemented in OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >, OnLatticeSimulation< DIM >, OffLatticeSimulation< 1 >, and OffLatticeSimulation< 2 >.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation | ( | ) | [inline, protected, virtual] |
Calls the deaths, births and (if mUpdateCellPopulation is true) CellPopulation::Update() methods.
Reimplemented in OnLatticeSimulation< DIM >.
Definition at line 602 of file AbstractCellBasedSimulation.cpp.
References GenericEventHandler< 11, CellBasedEventHandler >::BeginEvent(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellBirth(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellRemoval(), GenericEventHandler< 11, CellBasedEventHandler >::EndEvent(), EXCEPTION, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNumBirths, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNumDeaths, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mUpdateCellPopulation.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
virtual void AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::WriteVisualizerSetupFile | ( | ) | [inline, protected, virtual] |
Writes out special information about the mesh to the visualizer.
Reimplemented in OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >, OnLatticeSimulation< DIM >, OffLatticeSimulation< 1 >, and OffLatticeSimulation< 2 >.
Definition at line 181 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented in OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >, OnLatticeSimulation< DIM >, CryptSimulation1d, CryptSimulation2d, OffLatticeSimulation< 1 >, and OffLatticeSimulation< 2 >.
Definition at line 76 of file AbstractCellBasedSimulation.hpp.
std::vector<boost::shared_ptr<AbstractCellKiller<SPACE_DIM> > > AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mCellKillers [protected] |
List of cell killers.
Definition at line 162 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::AddCellKiller(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellRemoval(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllCellKillers(), and AbstractCellBasedSimulation< DIM >::serialize().
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDeleteCellPopulationInDestructor [protected] |
Whether to delete the cell population in the destructor.
Definition at line 120 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::~AbstractCellBasedSimulation().
double AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDt [protected] |
Time step.
Definition at line 111 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetDt(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OffLatticeSimulation(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters(), AbstractCellBasedSimulation< DIM >::serialize(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetDt(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve(), and OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateNodePositions().
double AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mEndTime [protected] |
Time to run the Solve() method up to.
Definition at line 114 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters(), AbstractCellBasedSimulation< DIM >::serialize(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetEndTime(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mInitialiseCells [protected] |
Whether to initialise the cells.
Definition at line 123 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::AbstractCellBasedSimulation().
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNoBirth [protected] |
Whether to run the simulation with no birth (defaults to false).
Definition at line 126 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellBirth(), AbstractCellBasedSimulation< DIM >::serialize(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetNoBirth().
unsigned AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNumBirths [protected] |
Counts the number of births during the simulation.
Definition at line 141 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetNumBirths(), AbstractCellBasedSimulation< DIM >::serialize(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation().
unsigned AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mNumDeaths [protected] |
Counts the number of deaths during the simulation.
Definition at line 144 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetNumDeaths(), AbstractCellBasedSimulation< DIM >::serialize(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation().
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputCellVelocities [protected] |
Whether to write the cell velocities to a file. Initialised to false in constuctor.
Definition at line 156 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetOutputCellVelocities(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters(), AbstractCellBasedSimulation< DIM >::serialize(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputCellVelocities(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
std::string AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDirectory [protected] |
Output directory (a subfolder of tmp/[USERNAME]/testoutput).
Definition at line 132 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetOutputDirectory(), AbstractCellBasedSimulation< DIM >::serialize(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputDirectory(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputDivisionLocations [protected] |
Whether to output the locations of division events (defaults to false).
Definition at line 147 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellBirth(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetOutputDivisionLocations(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters(), AbstractCellBasedSimulation< DIM >::serialize(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputDivisionLocations(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
CellBasedPdeHandler<SPACE_DIM>* AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpCellBasedPdeHandler [protected] |
Pointer to a CellBasedPdeHandler object.
Definition at line 176 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetCellBasedPdeHandler(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters(), AbstractCellBasedSimulation< DIM >::serialize(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetCellBasedPdeHandler(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::~AbstractCellBasedSimulation().
out_stream AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpCellVelocitiesFile [protected] |
Results file for cell velocities.
Definition at line 159 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
out_stream AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpDivisionLocationFile [protected] |
Output file for location of division events.
Definition at line 150 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellBirth(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
out_stream AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpVizSetupFile [protected] |
Visualizer setup file.
Definition at line 138 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve(), and OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::WriteVisualizerSetupFile().
AbstractCellPopulation<ELEMENT_DIM, SPACE_DIM>& AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation [protected] |
Facade encapsulating cells in the cell population being simulated.
Definition at line 117 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::AbstractCellBasedSimulation(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::CalculateCellDivisionVector(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellBirth(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::DoCellRemoval(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::rGetCellPopulation(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::SetupSolve(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellLocationsAndTopology(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateNodePositions(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::WriteVisualizerSetupFile(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::~AbstractCellBasedSimulation().
unsigned AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSamplingTimestepMultiple [protected] |
The ratio of the number of actual timesteps to the number of timesteps at which results are written to file.
Definition at line 171 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters(), AbstractCellBasedSimulation< DIM >::serialize(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetSamplingTimestepMultiple(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
std::vector<boost::shared_ptr<AbstractCellBasedSimulationModifier<ELEMENT_DIM, SPACE_DIM> > > AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationModifiers [protected] |
List of SimulationModifier rules.
Definition at line 165 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::AddSimulationModifier(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetSimulationModifiers(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup(), AbstractCellBasedSimulation< DIM >::serialize(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
std::string AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mSimulationOutputDirectory [protected] |
Simulation Output directory either the same as mOutputDirectory or includes mOutputDirectory/results_from_time_[TIME].
Definition at line 135 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationSetup(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputDirectory(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::Solve().
bool AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mUpdateCellPopulation [protected] |
Whether to update the topology of the cell population at each time step (defaults to true).
Definition at line 129 of file AbstractCellBasedSimulation.hpp.
Referenced by AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::GetUpdateCellPopulationRule(), AbstractCellBasedSimulation< DIM >::serialize(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::SetUpdateCellPopulationRule(), and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation().