Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <OffLatticeSimulation.hpp>

+ Inheritance diagram for OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >:

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< 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 SetUpdatingTimestepMultiple (unsigned updatingTimestepMultiple)
 
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 AddTopologyUpdateSimulationModifier (boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM > > pSimulationModifier)
 
std::vector< boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM > > > * GetTopologyUpdateSimulationModifiers ()
 
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 ()
 

Protected Attributes

std::vector< boost::shared_ptr< AbstractForce< ELEMENT_DIM, SPACE_DIM > > > mForceCollection
 
std::vector< boost::shared_ptr< AbstractCellPopulationBoundaryCondition< ELEMENT_DIM, SPACE_DIM > > > mBoundaryConditions
 
boost::shared_ptr< AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM > > mpNumericalMethod
 
- Protected Attributes inherited from AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >
double mDt
 
double mEndTime
 
AbstractCellPopulation< ELEMENT_DIM, SPACE_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< SPACE_DIM > > > mCellKillers
 
std::vector< boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM > > > mSimulationModifiers
 
std::vector< boost::shared_ptr< AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM > > > mTopologyUpdateSimulationModifiers
 
unsigned mSamplingTimestepMultiple
 
unsigned mUpdatingTimestepMultiple
 

Private Member Functions

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

Friends

class boost::serialization::access
 
class TestOffLatticeSimulation
 
class TestOffLatticeSimulationWithNodeBasedCellPopulation
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
class OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >

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.

Constructor & Destructor Documentation

◆ OffLatticeSimulation()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OffLatticeSimulation ( AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > &  rCellPopulation,
bool  deleteCellPopulationInDestructor = false,
bool  initialiseCells = true 
)

Constructor.

Parameters
rCellPopulationReference to a 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 OffLatticeSimulation.cpp.

References EXCEPTION.

Member Function Documentation

◆ AddCellPopulationBoundaryCondition()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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.

Parameters
pBoundaryConditionpointer to a boundary condition

Definition at line 69 of file OffLatticeSimulation.cpp.

◆ AddForce()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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).

Parameters
pForcepointer to a force law

Definition at line 57 of file OffLatticeSimulation.cpp.

◆ ApplyBoundaries()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::ApplyBoundaries ( std::map< Node< SPACE_DIM > *, c_vector< double, SPACE_DIM > >  oldNodeLoctions)
protected

Applies any boundary conditions.

Parameters
oldNodeLoctionsMapping between node indices and old node locations

Definition at line 169 of file OffLatticeSimulation.cpp.

◆ GetNumericalMethod()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
const boost::shared_ptr< AbstractNumericalMethod< ELEMENT_DIM, SPACE_DIM > > OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::GetNumericalMethod ( ) const
Returns
the current numerical method.

Definition at line 87 of file OffLatticeSimulation.cpp.

◆ OutputAdditionalSimulationSetup()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OutputAdditionalSimulationSetup ( out_stream &  rParamsFile)
virtual

Overridden OutputAdditionalSimulationSetup() method.

Output any force, boundary condition or numerical method information.

Parameters
rParamsFilethe file stream to which the parameters are output

Implements AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 227 of file OffLatticeSimulation.cpp.

◆ OutputSimulationParameters()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters ( out_stream &  rParamsFile)
virtual

◆ RemoveAllCellPopulationBoundaryConditions()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllCellPopulationBoundaryConditions ( )

Method to remove all the cell population boundary conditions

Definition at line 75 of file OffLatticeSimulation.cpp.

◆ RemoveAllForces()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RemoveAllForces ( )

Remove all the forces.

Definition at line 63 of file OffLatticeSimulation.cpp.

◆ RevertToOldLocations()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::RevertToOldLocations ( std::map< Node< SPACE_DIM > *, c_vector< double, SPACE_DIM > >  oldNodeLoctions)
protected

Sends nodes back to the positions given in the input map. Used after a failed step when adaptivity is turned on.

Parameters
oldNodeLoctionsA map linking nodes to their old positions.

Definition at line 158 of file OffLatticeSimulation.cpp.

◆ rGetForceCollection()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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.

Returns
mForceCollection the vector of pointers to forces attached to this simulation

Definition at line 93 of file OffLatticeSimulation.cpp.

◆ serialize()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
template<class Archive >
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Save or restore the simulation.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 87 of file OffLatticeSimulation.hpp.

References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions, OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection, and OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod.

◆ SetNumericalMethod()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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).

Parameters
pNumericalMethodpointer to a numerical method object

Definition at line 81 of file OffLatticeSimulation.cpp.

◆ SetupSolve()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::SetupSolve ( )
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.

Referenced by CryptSimulation2d::SetupSolve().

◆ UpdateCellLocationsAndTopology()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::UpdateCellLocationsAndTopology ( )
protectedvirtual

Overridden UpdateCellLocationsAndTopology() method.

Calculate forces and update node positions.

Todo:
#2087 Make this a settable member variable

Implements AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 99 of file OffLatticeSimulation.cpp.

References GenericEventHandler< 11, CellBasedEventHandler >::BeginEvent().

◆ WriteVisualizerSetupFile()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::WriteVisualizerSetupFile ( )
protectedvirtual

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 76 of file OffLatticeSimulation.hpp.

◆ TestOffLatticeSimulation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
friend class TestOffLatticeSimulation
friend

Definition at line 77 of file OffLatticeSimulation.hpp.

◆ TestOffLatticeSimulationWithNodeBasedCellPopulation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
friend class TestOffLatticeSimulationWithNodeBasedCellPopulation
friend

Definition at line 78 of file OffLatticeSimulation.hpp.

Member Data Documentation

◆ mBoundaryConditions

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
std::vector<boost::shared_ptr<AbstractCellPopulationBoundaryCondition<ELEMENT_DIM,SPACE_DIM> > > OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions
protected

List of boundary conditions.

Definition at line 101 of file OffLatticeSimulation.hpp.

Referenced by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::serialize().

◆ mForceCollection

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
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 98 of file OffLatticeSimulation.hpp.

Referenced by OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::serialize().

◆ mpNumericalMethod

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
boost::shared_ptr<AbstractNumericalMethod<ELEMENT_DIM, SPACE_DIM> > OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod
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 >::serialize().


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