#include <OffLatticeSimulation.hpp>
Inherits AbstractCellBasedSimulation< DIM >.
Inherited by DeltaNotchOffLatticeSimulation< DIM >, and VolumeTrackedOffLatticeSimulation< DIM >.
Public Member Functions | |
OffLatticeSimulation (AbstractCellPopulation< DIM > &rCellPopulation, bool deleteCellPopulationInDestructor=false, bool initialiseCells=true) | |
void | AddForce (boost::shared_ptr< AbstractForce< DIM > > pForce) |
void | AddCellPopulationBoundaryCondition (boost::shared_ptr< AbstractCellPopulationBoundaryCondition< DIM > > pBoundaryCondition) |
bool | GetOutputNodeVelocities () |
void | SetOutputNodeVelocities (bool outputNodeVelocities) |
void | OutputAdditionalSimulationSetup (out_stream &rParamsFile) |
void | OutputSimulationParameters (out_stream &rParamsFile) |
Protected Member Functions | |
virtual void | UpdateCellLocationsAndTopology () |
virtual void | UpdateNodePositions (const std::vector< c_vector< double, DIM > > &rNodeForces) |
virtual void | SetupSolve () |
virtual void | AfterSolve () |
virtual c_vector< double, DIM > | CalculateCellDivisionVector (CellPtr pParentCell) |
virtual void | WriteVisualizerSetupFile () |
Protected Attributes | |
std::vector< boost::shared_ptr < AbstractForce< DIM > > > | mForceCollection |
std::vector< boost::shared_ptr < AbstractCellPopulationBoundaryCondition < DIM > > > | mBoundaryConditions |
bool | mOutputNodeVelocities |
out_stream | mpNodeVelocitiesFile |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Friends | |
class | boost::serialization::access |
Run an off-lattice 2D or 3D cell-based simulation using a cell-centre- or vertex-based cell population.
In cell-centre-based cell populations, each cell is represented by a single node (corresponding to its centre), and connectivity is defined either by a Delaunay triangulation or a radius of influence. In vertex- based cell populations, each cell is represented by a polytope (corresponding to its membrane) with a variable number of vertices.
The OffLatticeSimulation 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 Force laws may be passed to the OffLatticeSimulation object, to define the mechanical properties of the CellPopulation. Similarly, one or more CellKillers may be passed to the OffLatticeSimulation object to specify conditions in which Cells may die, and one or more CellPopulationBoundaryConditions to specify regions in space beyond which Cells may not move.
Definition at line 62 of file OffLatticeSimulation.hpp.
OffLatticeSimulation< DIM >::OffLatticeSimulation | ( | AbstractCellPopulation< DIM > & | rCellPopulation, | |
bool | deleteCellPopulationInDestructor = false , |
|||
bool | initialiseCells = true | |||
) | [inline] |
Constructor.
rCellPopulation | Reference to 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 43 of file OffLatticeSimulation.cpp.
References EXCEPTION, and AbstractCellBasedSimulation< DIM >::mDt.
void OffLatticeSimulation< DIM >::AddCellPopulationBoundaryCondition | ( | boost::shared_ptr< AbstractCellPopulationBoundaryCondition< DIM > > | pBoundaryCondition | ) | [inline] |
Add a cell population boundary condition to be used in this simulation.
pBoundaryCondition | pointer to a boundary condition |
Definition at line 73 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mBoundaryConditions.
void OffLatticeSimulation< DIM >::AddForce | ( | boost::shared_ptr< AbstractForce< DIM > > | pForce | ) | [inline] |
Add a force to be used in this simulation (use this to set the mechanics system).
pForce | pointer to a force law |
Definition at line 67 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mForceCollection.
void OffLatticeSimulation< DIM >::AfterSolve | ( | ) | [inline, protected, virtual] |
Overridden AfterSolve() method to close the node velocities file.
Reimplemented from AbstractCellBasedSimulation< DIM >.
Reimplemented in CryptSimulation2d.
Definition at line 325 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mOutputNodeVelocities, and OffLatticeSimulation< DIM >::mpNodeVelocitiesFile.
c_vector< double, DIM > OffLatticeSimulation< DIM >::CalculateCellDivisionVector | ( | CellPtr | pParentCell | ) | [inline, protected, virtual] |
Overridden CalculateCellDivisionVector() method for determining how cell division occurs. This method returns a vector which is then passed into the CellPopulation method AddCell(). This method may be overridden by subclasses.
For a centre-based cell population, this method calculates the new locations of the cell centres of a dividing cell, moves the parent cell and returns the location of the daughter cell. The new locations are found by picking a random direction and placing the parent and daughter in opposing directions along this axis.
For a vertex-based cell population, the method returns the zero vector.
pParentCell | the parent cell |
Implements AbstractCellBasedSimulation< DIM >.
Reimplemented in CryptSimulation1d, and CryptSimulation2d.
Definition at line 118 of file OffLatticeSimulation.cpp.
References RandomNumberGenerator::Instance(), AbstractCellBasedSimulation< DIM >::mrCellPopulation, NEVER_REACHED, and RandomNumberGenerator::ranf().
bool OffLatticeSimulation< DIM >::GetOutputNodeVelocities | ( | ) | [inline] |
Definition at line 363 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mOutputNodeVelocities.
void OffLatticeSimulation< DIM >::OutputAdditionalSimulationSetup | ( | out_stream & | rParamsFile | ) | [inline, virtual] |
Overridden OutputAdditionalSimulationSetup method to output the force and cell population boundary condition information.
rParamsFile | the file stream to which the parameters are output |
Reimplemented from AbstractCellBasedSimulation< DIM >.
Definition at line 337 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mBoundaryConditions, and OffLatticeSimulation< DIM >::mForceCollection.
void OffLatticeSimulation< DIM >::OutputSimulationParameters | ( | out_stream & | rParamsFile | ) | [inline, 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 |
Implements AbstractCellBasedSimulation< DIM >.
Reimplemented in CryptSimulation1d, and CryptSimulation2d.
Definition at line 375 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mOutputNodeVelocities.
void OffLatticeSimulation< 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 from AbstractCellBasedSimulation< DIM >.
Reimplemented in DeltaNotchOffLatticeSimulation< DIM >, VolumeTrackedOffLatticeSimulation< DIM >, CryptSimulation1d, and CryptSimulation2d.
Definition at line 76 of file OffLatticeSimulation.hpp.
void OffLatticeSimulation< DIM >::SetOutputNodeVelocities | ( | bool | outputNodeVelocities | ) | [inline] |
Set mOutputNodeVelocities.
outputNodeVelocities | the new value of mOutputNodeVelocities |
Definition at line 369 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mOutputNodeVelocities.
void OffLatticeSimulation< DIM >::SetupSolve | ( | ) | [inline, protected, virtual] |
Overridden SetupSolve() method to setup the node velocities file.
Reimplemented from AbstractCellBasedSimulation< DIM >.
Reimplemented in CryptSimulation2d.
Definition at line 312 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mOutputNodeVelocities, OffLatticeSimulation< DIM >::mpNodeVelocitiesFile, AbstractCellBasedSimulation< DIM >::mSimulationOutputDirectory, and OutputFileHandler::OpenOutputFile().
void OffLatticeSimulation< DIM >::UpdateCellLocationsAndTopology | ( | ) | [inline, protected, virtual] |
Overridden UpdateCellLocationsAndTopology() method.
Calculate forces and update node positions.
Implements AbstractCellBasedSimulation< DIM >.
Definition at line 79 of file OffLatticeSimulation.cpp.
References GenericEventHandler< 10, CellBasedEventHandler >::BeginEvent(), GenericEventHandler< 10, CellBasedEventHandler >::EndEvent(), OffLatticeSimulation< DIM >::mForceCollection, AbstractCellBasedSimulation< DIM >::mrCellPopulation, and OffLatticeSimulation< DIM >::UpdateNodePositions().
void OffLatticeSimulation< DIM >::UpdateNodePositions | ( | const std::vector< c_vector< double, DIM > > & | rNodeForces | ) | [inline, protected, virtual] |
Moves each node to a new position for this timestep by calling the CellPopulation::UpdateNodeLocations() method then applying any boundary conditions.
rNodeForces | the forces on nodes |
Definition at line 223 of file OffLatticeSimulation.cpp.
References EXCEPTION, SimulationTime::GetTime(), SimulationTime::Instance(), OffLatticeSimulation< DIM >::mBoundaryConditions, AbstractCellBasedSimulation< DIM >::mDt, OffLatticeSimulation< DIM >::mOutputNodeVelocities, OffLatticeSimulation< DIM >::mpNodeVelocitiesFile, AbstractCellBasedSimulation< DIM >::mrCellPopulation, and AbstractCellBasedSimulation< DIM >::mSamplingTimestepMultiple.
Referenced by OffLatticeSimulation< DIM >::UpdateCellLocationsAndTopology().
void OffLatticeSimulation< DIM >::WriteVisualizerSetupFile | ( | ) | [inline, protected, virtual] |
Overridden WriteVisualizerSetupFile() method.
Reimplemented from AbstractCellBasedSimulation< DIM >.
Definition at line 192 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< DIM >::mForceCollection, AbstractCellBasedSimulation< DIM >::mpVizSetupFile, and AbstractCellBasedSimulation< DIM >::mrCellPopulation.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractCellBasedSimulation< DIM >.
Reimplemented in DeltaNotchOffLatticeSimulation< DIM >, VolumeTrackedOffLatticeSimulation< DIM >, CryptSimulation1d, and CryptSimulation2d.
Definition at line 67 of file OffLatticeSimulation.hpp.
std::vector<boost::shared_ptr<AbstractCellPopulationBoundaryCondition<DIM> > > OffLatticeSimulation< DIM >::mBoundaryConditions [protected] |
List of boundary conditions.
Definition at line 90 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< DIM >::AddCellPopulationBoundaryCondition(), OffLatticeSimulation< DIM >::OutputAdditionalSimulationSetup(), OffLatticeSimulation< 2 >::serialize(), and OffLatticeSimulation< DIM >::UpdateNodePositions().
std::vector<boost::shared_ptr<AbstractForce<DIM> > > OffLatticeSimulation< DIM >::mForceCollection [protected] |
The mechanics used to determine the new location of the cells, a list of the forces.
Definition at line 87 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< DIM >::AddForce(), OffLatticeSimulation< DIM >::OutputAdditionalSimulationSetup(), OffLatticeSimulation< 2 >::serialize(), OffLatticeSimulation< DIM >::UpdateCellLocationsAndTopology(), and OffLatticeSimulation< DIM >::WriteVisualizerSetupFile().
bool OffLatticeSimulation< DIM >::mOutputNodeVelocities [protected] |
Whether to write the node velocities to a file.
Definition at line 93 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< DIM >::AfterSolve(), OffLatticeSimulation< DIM >::GetOutputNodeVelocities(), OffLatticeSimulation< DIM >::OutputSimulationParameters(), OffLatticeSimulation< 2 >::serialize(), OffLatticeSimulation< DIM >::SetOutputNodeVelocities(), OffLatticeSimulation< DIM >::SetupSolve(), and OffLatticeSimulation< DIM >::UpdateNodePositions().
out_stream OffLatticeSimulation< DIM >::mpNodeVelocitiesFile [protected] |
Results file node velocities.
Definition at line 96 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< DIM >::AfterSolve(), OffLatticeSimulation< DIM >::SetupSolve(), and OffLatticeSimulation< DIM >::UpdateNodePositions().