Chaste  Release::3.4
OnLatticeSimulation< DIM > Class Template Reference

#include <OnLatticeSimulation.hpp>

+ Inheritance diagram for OnLatticeSimulation< DIM >:
+ Collaboration diagram for OnLatticeSimulation< DIM >:

Public Member Functions

 OnLatticeSimulation (AbstractCellPopulation< DIM > &rCellPopulation, bool deleteCellPopulationInDestructor=false, bool initialiseCells=true)
 
void AddCaUpdateRule (boost::shared_ptr< AbstractCaUpdateRule< DIM > > pUpdateRule)
 
void RemoveAllCaUpdateRules ()
 
void AddCaSwitchingUpdateRule (boost::shared_ptr< AbstractCaSwitchingUpdateRule< DIM > > pUpdateRule)
 
void RemoveAllCaSwitchingUpdateRules ()
 
void AddPottsUpdateRule (boost::shared_ptr< AbstractPottsUpdateRule< DIM > > pUpdateRule)
 
void RemoveAllPottsUpdateRules ()
 
void OutputAdditionalSimulationSetup (out_stream &rParamsFile)
 
void OutputSimulationParameters (out_stream &rParamsFile)
 
- Public Member Functions inherited from AbstractCellBasedSimulation< DIM >
 AbstractCellBasedSimulation (AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM > &rCellPopulation, bool deleteCellPopulationInDestructor=false, bool initialiseCells=true)
 
virtual ~AbstractCellBasedSimulation ()
 
void SetCellBasedPdeHandler (CellBasedPdeHandler< ELEMENT_DIM > *pCellBasedPdeHandler)
 
CellBasedPdeHandler
< ELEMENT_DIM > * 
GetCellBasedPdeHandler ()
 
std::vector< doubleGetNodeLocation (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< ELEMENT_DIM > > pCellKiller)
 
void RemoveAllCellKillers ()
 
void AddSimulationModifier (boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, ELEMENT_DIM > > pSimulationModifier)
 
std::vector< boost::shared_ptr
< AbstractCellBasedSimulationModifier
< ELEMENT_DIM, ELEMENT_DIM > > > * 
GetSimulationModifiers ()
 
void Solve ()
 
AbstractCellPopulation
< ELEMENT_DIM, ELEMENT_DIM > & 
rGetCellPopulation ()
 
const AbstractCellPopulation
< ELEMENT_DIM, ELEMENT_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

void UpdateCellPopulation ()
 
void UpdateCellLocationsAndTopology ()
 
virtual c_vector< double, DIM > CalculateCellDivisionVector (CellPtr pParentCell)
 
virtual void WriteVisualizerSetupFile ()
 
- Protected Member Functions inherited from AbstractCellBasedSimulation< DIM >
virtual unsigned DoCellBirth ()
 
unsigned DoCellRemoval ()
 
virtual void SetupSolve ()
 
virtual bool StoppingEventHasOccurred ()
 
void OutputSimulationSetup ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from AbstractCellBasedSimulation< DIM >
double mDt
 
double mEndTime
 
AbstractCellPopulation
< ELEMENT_DIM, ELEMENT_DIM > & 
mrCellPopulation
 
bool mDeleteCellPopulationInDestructor
 
bool mInitialiseCells
 
bool mNoBirth
 
bool mUpdateCellPopulation
 
std::string mOutputDirectory
 
std::string mSimulationOutputDirectory
 
out_stream mpVizSetupFile
 
unsigned mNumBirths
 
unsigned mNumDeaths
 
bool mOutputDivisionLocations
 
out_stream mpDivisionLocationFile
 
bool mOutputCellVelocities
 
out_stream mpCellVelocitiesFile
 
std::vector< boost::shared_ptr
< AbstractCellKiller
< ELEMENT_DIM > > > 
mCellKillers
 
std::vector< boost::shared_ptr
< AbstractCellBasedSimulationModifier
< ELEMENT_DIM, ELEMENT_DIM > > > 
mSimulationModifiers
 
unsigned mSamplingTimestepMultiple
 
CellBasedPdeHandler
< ELEMENT_DIM > * 
mpCellBasedPdeHandler
 

Detailed Description

template<unsigned DIM>
class OnLatticeSimulation< DIM >

Run an on-lattice 2D or 3D cell-based simulation.

The OnLatticeSimulation 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 Update rules may be passed to the OnLatticeSimulation object, to define the processes which update cells in the CellPopulation. Similarly, one or more CellKillers may be passed to the OnLatticeSimulation object to specify conditions in which Cells may die.

Definition at line 59 of file OnLatticeSimulation.hpp.

Constructor & Destructor Documentation

template<unsigned DIM>
OnLatticeSimulation< DIM >::OnLatticeSimulation ( AbstractCellPopulation< DIM > &  rCellPopulation,
bool  deleteCellPopulationInDestructor = false,
bool  initialiseCells = true 
)

Constructor.

Parameters
rCellPopulationA cell population object
deleteCellPopulationInDestructorWhether to delete the cell population on destruction to free up memory (defaults to false)
initialiseCellsWhether to initialise cells (defaults to true, set to false when loading from an archive)

Definition at line 45 of file OnLatticeSimulation.cpp.

References EXCEPTION, and AbstractCellBasedSimulation< DIM >::mDt.

Member Function Documentation

template<unsigned DIM>
void OnLatticeSimulation< DIM >::AddCaSwitchingUpdateRule ( boost::shared_ptr< AbstractCaSwitchingUpdateRule< DIM > >  pUpdateRule)

Add a switching update rule to be used in this simulation.

Parameters
pUpdateRuleshared pointer to a CA switching update rule law

Definition at line 80 of file OnLatticeSimulation.cpp.

References CaBasedCellPopulation< DIM >::AddSwitchingUpdateRule().

template<unsigned DIM>
void OnLatticeSimulation< DIM >::AddCaUpdateRule ( boost::shared_ptr< AbstractCaUpdateRule< DIM > >  pUpdateRule)

Add an update rule to be used in this simulation.

Parameters
pUpdateRuleshared pointer to a CA update rule law

Definition at line 61 of file OnLatticeSimulation.cpp.

References CaBasedCellPopulation< DIM >::AddUpdateRule().

template<unsigned DIM>
void OnLatticeSimulation< DIM >::AddPottsUpdateRule ( boost::shared_ptr< AbstractPottsUpdateRule< DIM > >  pUpdateRule)

Add an update rule to be used in this simulation (use this to set the Hamiltonian).

Parameters
pUpdateRuleshared pointer to a Potts update rule law

Definition at line 98 of file OnLatticeSimulation.cpp.

References PottsBasedCellPopulation< DIM >::AddUpdateRule().

template<unsigned DIM>
c_vector< double, DIM > OnLatticeSimulation< DIM >::CalculateCellDivisionVector ( CellPtr  pParentCell)
protectedvirtual

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.

Parameters
pParentCellthe parent cell
Returns
a vector containing information on cell division.
Todo:
do something for Potts models here

Implements AbstractCellBasedSimulation< DIM >.

Definition at line 116 of file OnLatticeSimulation.cpp.

template<unsigned DIM>
void OnLatticeSimulation< DIM >::OutputAdditionalSimulationSetup ( out_stream &  rParamsFile)
virtual

Overridden OutputAdditionalSimulationSetup() method to output the force and cell population boundary condition information.

Parameters
rParamsFilethe file stream to which the parameters are output

Reimplemented from AbstractCellBasedSimulation< DIM >.

Definition at line 170 of file OnLatticeSimulation.cpp.

References NEVER_REACHED, CaBasedCellPopulation< DIM >::rGetSwitchingUpdateRuleCollection(), PottsBasedCellPopulation< DIM >::rGetUpdateRuleCollection(), and CaBasedCellPopulation< DIM >::rGetUpdateRuleCollection().

template<unsigned DIM>
void OnLatticeSimulation< DIM >::OutputSimulationParameters ( out_stream &  rParamsFile)
virtual

Overridden OutputSimulationParameters() method.

Parameters
rParamsFilethe file stream to which the parameters are output

Implements AbstractCellBasedSimulation< DIM >.

Definition at line 217 of file OnLatticeSimulation.cpp.

References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters().

template<unsigned DIM>
void OnLatticeSimulation< DIM >::RemoveAllCaSwitchingUpdateRules ( )

Method to remove all the CaSwitchingUpdateRules

Definition at line 89 of file OnLatticeSimulation.cpp.

References CaBasedCellPopulation< DIM >::RemoveAllSwitchingUpdateRules().

template<unsigned DIM>
void OnLatticeSimulation< DIM >::RemoveAllCaUpdateRules ( )

Method to remove all the CaUpdateRules

Definition at line 70 of file OnLatticeSimulation.cpp.

References CaBasedCellPopulation< DIM >::RemoveAllUpdateRules().

template<unsigned DIM>
void OnLatticeSimulation< DIM >::RemoveAllPottsUpdateRules ( )

Method to remove all the PottsUpdateRules

Definition at line 107 of file OnLatticeSimulation.cpp.

References PottsBasedCellPopulation< DIM >::RemoveAllUpdateRules().

template<unsigned DIM>
template<class Archive >
void OnLatticeSimulation< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Serialize the object and any member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 72 of file OnLatticeSimulation.hpp.

template<unsigned DIM>
void OnLatticeSimulation< DIM >::UpdateCellLocationsAndTopology ( )
protectedvirtual
template<unsigned DIM>
void OnLatticeSimulation< DIM >::UpdateCellPopulation ( )
protectedvirtual

Overridden UpdateCellPopulation() method.

If using a CaBasedCellPopulation, this method does nothing if at the start of a simulation that has just been loaded, to ensure consistency in random number generation.

Todo:
#2066 This code should be covered by cell_based/test/simulation/TestOnLatticeSimulationWithCaBasedCellPopulation.hpp TestLoad

Reimplemented from AbstractCellBasedSimulation< DIM >.

Definition at line 141 of file OnLatticeSimulation.cpp.

References SimulationTime::Instance(), NEVER_REACHED, and AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellPopulation().

template<unsigned DIM>
void OnLatticeSimulation< DIM >::WriteVisualizerSetupFile ( )
protectedvirtual

Overridden WriteVisualizerSetupFile() method.

Reimplemented from AbstractCellBasedSimulation< DIM >.

Definition at line 123 of file OnLatticeSimulation.cpp.

Friends And Related Function Documentation

template<unsigned DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 64 of file OnLatticeSimulation.hpp.


The documentation for this class was generated from the following files: