Chaste  Release::2017.1
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 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 ()
 

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
 
unsigned mSamplingTimestepMultiple
 

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

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

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.

References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions.

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.

References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection.

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.

References EXCEPTION, and OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions.

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

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.

References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod.

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 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.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::OutputSimulationParameters ( out_stream &  rParamsFile)
virtual
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.

References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mBoundaryConditions.

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.

References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection.

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.

References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::mrCellPopulation.

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

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.

References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mForceCollection.

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.

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.

References OffLatticeSimulation< ELEMENT_DIM, SPACE_DIM >::mpNumericalMethod.

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

Friends And Related Function Documentation

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.

Member Data Documentation

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 documentation for this class was generated from the following files: