Chaste Release::3.1
|
#include <OffLatticeSimulation.hpp>
Public Member Functions | |
OffLatticeSimulation (AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > &rCellPopulation, bool deleteCellPopulationInDestructor=false, bool initialiseCells=true) | |
void | AddForce (boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > pForce) |
void | RemoveAllForces () |
void | AddCellPopulationBoundaryCondition (boost::shared_ptr< AbstractCellPopulationBoundaryCondition< ELEMENT_DIM, SPACE_DIM > > pBoundaryCondition) |
void | RemoveAllCellPopulationBoundaryConditions () |
bool | GetOutputNodeVelocities () |
void | SetOutputNodeVelocities (bool outputNodeVelocities) |
void | OutputAdditionalSimulationSetup (out_stream &rParamsFile) |
virtual void | OutputSimulationParameters (out_stream &rParamsFile) |
Protected Member Functions | |
virtual void | UpdateCellLocationsAndTopology () |
virtual void | UpdateNodePositions (const std::vector< c_vector< double, SPACE_DIM > > &rNodeForces) |
virtual void | SetupSolve () |
virtual void | UpdateAtEndOfSolve () |
virtual c_vector< double, SPACE_DIM > | CalculateCellDivisionVector (CellPtr pParentCell) |
virtual void | WriteVisualizerSetupFile () |
Protected Attributes | |
std::vector< boost::shared_ptr < AbstractForce< ELEMENT_DIM, SPACE_DIM > > > | mForceCollection |
std::vector< boost::shared_ptr < AbstractCellPopulationBoundaryCondition < ELEMENT_DIM, SPACE_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 69 of file OffLatticeSimulation.hpp.
OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OffLatticeSimulation | ( | AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > & | rCellPopulation, |
bool | deleteCellPopulationInDestructor = false , |
||
bool | initialiseCells = true |
||
) |
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 50 of file OffLatticeSimulation.cpp.
References EXCEPTION, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDt.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::AddCellPopulationBoundaryCondition | ( | boost::shared_ptr< AbstractCellPopulationBoundaryCondition< ELEMENT_DIM, SPACE_DIM > > | pBoundaryCondition | ) |
Add a cell population boundary condition to be used in this simulation.
pBoundaryCondition | pointer to a boundary condition |
Definition at line 86 of file OffLatticeSimulation.cpp.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::AddForce | ( | boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > | pForce | ) |
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 74 of file OffLatticeSimulation.cpp.
c_vector< double, SPACE_DIM > OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::CalculateCellDivisionVector | ( | CellPtr | pParentCell | ) | [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< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in CryptSimulation1d, and CryptSimulation2d.
Definition at line 137 of file OffLatticeSimulation.cpp.
References AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetMeinekeDivisionSeparation(), RandomNumberGenerator::Instance(), NEVER_REACHED, and RandomNumberGenerator::ranf().
bool OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::GetOutputNodeVelocities | ( | ) |
Definition at line 392 of file OffLatticeSimulation.cpp.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OutputAdditionalSimulationSetup | ( | out_stream & | rParamsFile | ) | [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< ELEMENT_DIM, SPACE_DIM >.
Definition at line 366 of file OffLatticeSimulation.cpp.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters | ( | out_stream & | rParamsFile | ) | [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< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in CryptSimulation1d, and CryptSimulation2d.
Definition at line 404 of file OffLatticeSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters().
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllCellPopulationBoundaryConditions | ( | ) |
Method to remove all the cell population boundary conditions
Definition at line 92 of file OffLatticeSimulation.cpp.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllForces | ( | ) |
Method to remove all the Forces
Definition at line 80 of file OffLatticeSimulation.cpp.
void OffLatticeSimulation< 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 from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in DeltaNotchOffLatticeSimulation< DIM >, VolumeTrackedOffLatticeSimulation< DIM >, CryptSimulation1d, and CryptSimulation2d.
Definition at line 83 of file OffLatticeSimulation.hpp.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::SetOutputNodeVelocities | ( | bool | outputNodeVelocities | ) |
Set mOutputNodeVelocities.
outputNodeVelocities | the new value of mOutputNodeVelocities |
Definition at line 398 of file OffLatticeSimulation.cpp.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::SetupSolve | ( | ) | [protected, virtual] |
Overridden SetupSolve() method to setup the node velocities file.
Reimplemented from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in DeltaNotchOffLatticeSimulation< DIM >, VolumeTrackedOffLatticeSimulation< DIM >, and CryptSimulation2d.
Definition at line 347 of file OffLatticeSimulation.cpp.
References PetscTools::AmMaster(), and OutputFileHandler::OpenOutputFile().
Referenced by DeltaNotchOffLatticeSimulation< DIM >::SetupSolve().
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateAtEndOfSolve | ( | ) | [protected, virtual] |
Overridden UpdateAtEndOfSolve() method to close the node velocities file.
Reimplemented from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in CryptSimulation2d.
Definition at line 357 of file OffLatticeSimulation.cpp.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellLocationsAndTopology | ( | ) | [protected, virtual] |
Overridden UpdateCellLocationsAndTopology() method.
Calculate forces and update node positions.
Implements AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 98 of file OffLatticeSimulation.cpp.
References GenericEventHandler< 11, CellBasedEventHandler >::BeginEvent(), and GenericEventHandler< 11, CellBasedEventHandler >::EndEvent().
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateNodePositions | ( | const std::vector< c_vector< double, SPACE_DIM > > & | rNodeForces | ) | [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 247 of file OffLatticeSimulation.cpp.
References PetscTools::AmMaster(), PetscTools::BeginRoundRobin(), EXCEPTION, AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetDampingConstant(), SimulationTime::GetTime(), SimulationTime::Instance(), AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::IsGhostNode(), OutputFileHandler::OpenOutputFile(), and AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM >::UpdateNodeLocations().
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::WriteVisualizerSetupFile | ( | ) | [protected, virtual] |
Overridden WriteVisualizerSetupFile() method.
Reimplemented from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 211 of file OffLatticeSimulation.cpp.
References PetscTools::AmMaster().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in DeltaNotchOffLatticeSimulation< DIM >, VolumeTrackedOffLatticeSimulation< DIM >, CryptSimulation1d, and CryptSimulation2d.
Definition at line 74 of file OffLatticeSimulation.hpp.
std::vector<boost::shared_ptr<AbstractCellPopulationBoundaryCondition<ELEMENT_DIM,SPACE_DIM> > > OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions [protected] |
List of boundary conditions.
Definition at line 97 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< 2 >::serialize().
std::vector<boost::shared_ptr<AbstractForce<ELEMENT_DIM, SPACE_DIM> > > OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection [protected] |
The mechanics used to determine the new location of the cells, a list of the forces.
Definition at line 94 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< 2 >::serialize().
bool OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mOutputNodeVelocities [protected] |
Whether to write the node velocities to a file.
Definition at line 100 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< 2 >::serialize().
out_stream OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNodeVelocitiesFile [protected] |
Results file node velocities.
Definition at line 103 of file OffLatticeSimulation.hpp.