Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
AbstractCellCycleModelOdeSolver Class Referenceabstract

#include <AbstractCellCycleModelOdeSolver.hpp>

+ Inheritance diagram for AbstractCellCycleModelOdeSolver:
+ Collaboration diagram for AbstractCellCycleModelOdeSolver:

Public Member Functions

 AbstractCellCycleModelOdeSolver ()
 
virtual ~AbstractCellCycleModelOdeSolver ()
 
virtual bool IsSetUp ()=0
 
virtual void Reset ()=0
 
void SolveAndUpdateStateVariable (AbstractOdeSystem *pAbstractOdeSystem, double startTime, double endTime, double timeStep)
 
virtual void Initialise ()=0
 
bool StoppingEventOccurred ()
 
double GetStoppingTime ()
 
void SetSizeOfOdeSystem (unsigned sizeOfOdeSystem)
 
unsigned GetSizeOfOdeSystem ()
 
void CheckForStoppingEvents ()
 
void SetMaxSteps (long numSteps)
 
void SetTolerances (double relTol=1e-4, double absTol=1e-6)
 
virtual bool IsAdaptive ()
 

Protected Attributes

boost::shared_ptr< AbstractIvpOdeSolvermpOdeSolver
 
unsigned mSizeOfOdeSystem
 

Private Member Functions

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

Friends

class boost::serialization::access
 

Detailed Description

This provides a wrapper around any ODE solver class, exposing roughly the same interface, for use by ODE-based cell-cycle models. Its main purpose is to allow multiple instances of the same cell-cycle model to share the same ODE solver instance.

The recommended way to use this wrapper is via the CellCycleModelOdeSolver subclass, which is templated over cell-cycle model class and ODE solver class, providing a singleton instance for each combination of template parameters.

Definition at line 56 of file AbstractCellCycleModelOdeSolver.hpp.

Constructor & Destructor Documentation

◆ AbstractCellCycleModelOdeSolver()

AbstractCellCycleModelOdeSolver::AbstractCellCycleModelOdeSolver ( )

Constructor.

Definition at line 39 of file AbstractCellCycleModelOdeSolver.cpp.

◆ ~AbstractCellCycleModelOdeSolver()

AbstractCellCycleModelOdeSolver::~AbstractCellCycleModelOdeSolver ( )
virtual

Virtual destructor since we have virtual methods.

Definition at line 44 of file AbstractCellCycleModelOdeSolver.cpp.

Member Function Documentation

◆ CheckForStoppingEvents()

void AbstractCellCycleModelOdeSolver::CheckForStoppingEvents ( )

If using CVODE, make the solver check for stopping events using CVODE's rootfinding functionality (by default we do not check).

Definition at line 79 of file AbstractCellCycleModelOdeSolver.cpp.

References CheckForStoppingEvents(), IsSetUp(), and mpOdeSolver.

Referenced by CheckForStoppingEvents().

◆ GetSizeOfOdeSystem()

unsigned AbstractCellCycleModelOdeSolver::GetSizeOfOdeSystem ( )
Returns
mSizeOfOdeSystem

Definition at line 74 of file AbstractCellCycleModelOdeSolver.cpp.

References mSizeOfOdeSystem.

◆ GetStoppingTime()

double AbstractCellCycleModelOdeSolver::GetStoppingTime ( )

Call mpOdeSolver->GetStoppingTime.

Returns
mStoppingTime.

Definition at line 63 of file AbstractCellCycleModelOdeSolver.cpp.

References IsSetUp(), and mpOdeSolver.

◆ Initialise()

virtual void AbstractCellCycleModelOdeSolver::Initialise ( )
pure virtual

Initialise the ODE solver.

As this method is pure virtual, it must be overridden in subclasses.

Implemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >, and CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >.

◆ IsAdaptive()

bool AbstractCellCycleModelOdeSolver::IsAdaptive ( )
virtual
Returns
true iff this is an adaptive solver such as CVODE for which it is safe to set the 'timestep' to be the outer simulation timestep, because the ODE solver will use this as its maximum, not actual, timestep.

The base class version just returns true iff the solver is the CvodeAdaptor class.

Reimplemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >.

Definition at line 112 of file AbstractCellCycleModelOdeSolver.cpp.

References IsSetUp(), and mpOdeSolver.

Referenced by CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >::IsAdaptive().

◆ IsSetUp()

virtual bool AbstractCellCycleModelOdeSolver::IsSetUp ( )
pure virtual
Returns
whether the instance in existence and fully set up.

As this method is pure virtual, it must be overridden in subclasses.

Implemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >, and CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >.

Referenced by CheckForStoppingEvents(), GetStoppingTime(), IsAdaptive(), SetMaxSteps(), SetTolerances(), SolveAndUpdateStateVariable(), and StoppingEventOccurred().

◆ Reset()

virtual void AbstractCellCycleModelOdeSolver::Reset ( )
pure virtual

Reset the instance.

As this method is pure virtual, it must be overridden in subclasses.

Implemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >, and CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >.

◆ serialize()

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

Archive the object and its the member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 69 of file AbstractCellCycleModelOdeSolver.hpp.

References mpOdeSolver, and mSizeOfOdeSystem.

◆ SetMaxSteps()

void AbstractCellCycleModelOdeSolver::SetMaxSteps ( long  numSteps)

If using CVODE, change the maximum number of steps to be taken by the solver in its attempt to reach the next output time (default is 500).

Parameters
numStepsthe new maximum number of steps

Definition at line 90 of file AbstractCellCycleModelOdeSolver.cpp.

References IsSetUp(), mpOdeSolver, and SetMaxSteps().

Referenced by SetMaxSteps().

◆ SetSizeOfOdeSystem()

void AbstractCellCycleModelOdeSolver::SetSizeOfOdeSystem ( unsigned  sizeOfOdeSystem)

Set method for mSizeOfOdeSystem.

Parameters
sizeOfOdeSystemthe new value of mSizeOfOdeSystem

Definition at line 69 of file AbstractCellCycleModelOdeSolver.cpp.

References mSizeOfOdeSystem.

◆ SetTolerances()

void AbstractCellCycleModelOdeSolver::SetTolerances ( double  relTol = 1e-4,
double  absTol = 1e-6 
)

If using CVODE, set relative and absolute tolerances; both scalars. If no parameters are given, tolerances will be reset to default values.

Parameters
relTolthe relative tolerance for the solver
absTolthe absolute tolerance for the solver

Definition at line 101 of file AbstractCellCycleModelOdeSolver.cpp.

References IsSetUp(), mpOdeSolver, and SetTolerances().

Referenced by SetTolerances().

◆ SolveAndUpdateStateVariable()

void AbstractCellCycleModelOdeSolver::SolveAndUpdateStateVariable ( AbstractOdeSystem pAbstractOdeSystem,
double  startTime,
double  endTime,
double  timeStep 
)

Call mpOdeSolver->SolveAndUpdateStateVariable.

Parameters
pAbstractOdeSystempointer to the concrete ODE system to be solved
startTimethe time at which the initial conditions are specified
endTimethe time to which the system should be solved and the solution returned
timeStepthe time interval to be used by the solver

Definition at line 48 of file AbstractCellCycleModelOdeSolver.cpp.

References IsSetUp(), and mpOdeSolver.

◆ StoppingEventOccurred()

bool AbstractCellCycleModelOdeSolver::StoppingEventOccurred ( )
Returns
whether the solver quit due to the ODE's stopping event triggering

Definition at line 57 of file AbstractCellCycleModelOdeSolver.cpp.

References IsSetUp(), and mpOdeSolver.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 61 of file AbstractCellCycleModelOdeSolver.hpp.

Member Data Documentation

◆ mpOdeSolver

boost::shared_ptr<AbstractIvpOdeSolver> AbstractCellCycleModelOdeSolver::mpOdeSolver
protected

◆ mSizeOfOdeSystem

unsigned AbstractCellCycleModelOdeSolver::mSizeOfOdeSystem
protected

The size of the ODE system to be solved.

Definition at line 81 of file AbstractCellCycleModelOdeSolver.hpp.

Referenced by GetSizeOfOdeSystem(), serialize(), and SetSizeOfOdeSystem().


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