Chaste
Release::2017.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 () |
void | SetNumericalMethod (boost::shared_ptr< AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM > > pNumericalMethod) |
const boost::shared_ptr< AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM > > | GetNumericalMethod () const |
void | OutputAdditionalSimulationSetup (out_stream &rParamsFile) |
virtual void | OutputSimulationParameters (out_stream &rParamsFile) |
const std::vector< boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > > & | rGetForceCollection () const |
Public Member Functions inherited from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM > | |
AbstractCellBasedSimulation (AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > &rCellPopulation, bool deleteCellPopulationInDestructor=false, bool initialiseCells=true) | |
virtual | ~AbstractCellBasedSimulation () |
std::vector< double > | GetNodeLocation (const unsigned &rNodeIndex) |
double | GetDt () |
unsigned | GetNumBirths () |
unsigned | GetNumDeaths () |
std::string | GetOutputDirectory () |
void | SetDt (double dt) |
void | SetEndTime (double endTime) |
void | SetOutputDirectory (std::string outputDirectory) |
void | SetSamplingTimestepMultiple (unsigned samplingTimestepMultiple) |
void | SetNoBirth (bool noBirth) |
void | SetUpdateCellPopulationRule (bool updateCellPopulation) |
bool | GetUpdateCellPopulationRule () |
void | AddCellKiller (boost::shared_ptr< AbstractCellKiller< SPACE_DIM > > pCellKiller) |
void | RemoveAllCellKillers () |
void | AddSimulationModifier (boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM > > pSimulationModifier) |
std::vector< boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM > > > * | GetSimulationModifiers () |
void | Solve () |
AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > & | rGetCellPopulation () |
const AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > & | rGetCellPopulation () const |
bool | GetOutputDivisionLocations () |
void | SetOutputDivisionLocations (bool outputDivisionLocations) |
bool | GetOutputCellVelocities () |
void | SetOutputCellVelocities (bool outputCellVelocities) |
Public Member Functions inherited from Identifiable | |
virtual | ~Identifiable () |
std::string | GetIdentifier () const |
Protected Member Functions | |
virtual void | UpdateCellLocationsAndTopology () |
void | RevertToOldLocations (std::map< Node< SPACE_DIM > *, c_vector< double, SPACE_DIM > > oldNodeLoctions) |
void | ApplyBoundaries (std::map< Node< SPACE_DIM > *, c_vector< double, SPACE_DIM > > oldNodeLoctions) |
virtual void | SetupSolve () |
virtual void | WriteVisualizerSetupFile () |
Protected Member Functions inherited from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM > | |
virtual unsigned | DoCellBirth () |
unsigned | DoCellRemoval () |
virtual bool | StoppingEventHasOccurred () |
virtual void | UpdateCellPopulation () |
void | OutputSimulationSetup () |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Friends | |
class | boost::serialization::access |
class | TestOffLatticeSimulation |
class | TestOffLatticeSimulationWithNodeBasedCellPopulation |
Run an off-lattice 2D or 3D cell-based simulation using an off-lattice 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. Alternative cell populations may be defined by the user.
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 71 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 45 of file OffLatticeSimulation.cpp.
References EXCEPTION.
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 69 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions.
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 57 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection.
|
protected |
Applies any boundary conditions.
oldNodeLoctions | Mapping between node indices and old node locations |
Definition at line 169 of file OffLatticeSimulation.cpp.
References EXCEPTION, and OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions.
Referenced by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellLocationsAndTopology().
const boost::shared_ptr< AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM > > OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::GetNumericalMethod | ( | ) | const |
Definition at line 87 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod.
|
virtual |
Overridden OutputAdditionalSimulationSetup() method.
Output any force, boundary condition or numerical method information.
rParamsFile | the file stream to which the parameters are output |
Implements AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 226 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions, OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection, and OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod.
|
virtual |
Overridden OutputSimulationParameters() method.
rParamsFile | the file stream to which the parameters are output |
Implements AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in CryptSimulation2d, and CryptSimulation1d.
Definition at line 257 of file OffLatticeSimulation.cpp.
References EXPORT_TEMPLATE_CLASS_ALL_DIMS, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters().
Referenced by CryptSimulation1d::OutputSimulationParameters(), and CryptSimulation2d::OutputSimulationParameters().
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllCellPopulationBoundaryConditions | ( | ) |
Method to remove all the cell population boundary conditions
Definition at line 75 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllForces | ( | ) |
Remove all the forces.
Definition at line 63 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection.
|
protected |
Sends nodes back to the positions given in the input map. Used after a failed step when adaptivity is turned on.
oldNodeLoctions | A map linking nodes to their old positions. |
Definition at line 158 of file OffLatticeSimulation.cpp.
References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
Referenced by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellLocationsAndTopology().
const std::vector< boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > > & OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::rGetForceCollection | ( | ) | const |
Directly access the forces attached to this simulation, to allow their manipulation after archiving.
Definition at line 93 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection.
|
inlineprivate |
Save or restore the simulation.
archive | the archive |
version | the current version of this class |
Definition at line 87 of file OffLatticeSimulation.hpp.
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::SetNumericalMethod | ( | boost::shared_ptr< AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM > > | pNumericalMethod | ) |
Set the numerical method to be used in this simulation (use this to solve the mechanics system).
pNumericalMethod | pointer to a numerical method object |
Definition at line 81 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod.
|
protectedvirtual |
Overridden SetupSolve() method to clear the forces applied to the nodes.
Reimplemented from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in CryptSimulation2d.
Definition at line 206 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection, OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
Referenced by CryptSimulation2d::SetupSolve().
|
protectedvirtual |
Overridden UpdateCellLocationsAndTopology() method.
Calculate forces and update node positions.
Implements AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 99 of file OffLatticeSimulation.cpp.
References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::ApplyBoundaries(), GenericEventHandler< 11, CellBasedEventHandler >::BeginEvent(), GenericEventHandler< 11, CellBasedEventHandler >::EndEvent(), EXCEPTION, StepSizeException::GetSuggestedNewStep(), AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mDt, OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation, OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RevertToOldLocations(), and StepSizeException::what().
|
protectedvirtual |
Overridden WriteVisualizerSetupFile() method.
Reimplemented from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 192 of file OffLatticeSimulation.cpp.
References PetscTools::AmMaster(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection, AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mpVizSetupFile, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.
|
friend |
Needed for serialization.
Definition at line 76 of file OffLatticeSimulation.hpp.
|
protected |
List of boundary conditions.
Definition at line 101 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::AddCellPopulationBoundaryCondition(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::ApplyBoundaries(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OutputAdditionalSimulationSetup(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllCellPopulationBoundaryConditions(), and OffLatticeSimulation< 2 >::serialize().
|
protected |
The mechanics used to determine the new location of the cells, a list of the forces.
Definition at line 98 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::AddForce(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OutputAdditionalSimulationSetup(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllForces(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::rGetForceCollection(), OffLatticeSimulation< 2 >::serialize(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::SetupSolve(), and OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::WriteVisualizerSetupFile().
|
protected |
The numerical method to use in this simulation. Defaults to the explicit forward Euler method.
Definition at line 104 of file OffLatticeSimulation.hpp.
Referenced by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::GetNumericalMethod(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OutputAdditionalSimulationSetup(), OffLatticeSimulation< 2 >::serialize(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::SetNumericalMethod(), OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::SetupSolve(), and OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellLocationsAndTopology().