#include <AbstractCellCycleModelOdeSolver.hpp>
Public Member Functions | |
AbstractCellCycleModelOdeSolver () | |
virtual | ~AbstractCellCycleModelOdeSolver () |
virtual bool | IsSetUp ()=0 |
virtual void | Reset () |
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 int numSteps) |
void | SetTolerances (double relTol=1e-4, double absTol=1e-6) |
virtual bool | IsAdaptive () |
Protected Attributes | |
boost::shared_ptr < AbstractIvpOdeSolver > | mpOdeSolver |
unsigned | mSizeOfOdeSystem |
Private Member Functions | |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
Friends | |
class | boost::serialization::access |
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 49 of file AbstractCellCycleModelOdeSolver.hpp.
AbstractCellCycleModelOdeSolver::AbstractCellCycleModelOdeSolver | ( | ) |
Constructor.
Definition at line 33 of file AbstractCellCycleModelOdeSolver.cpp.
AbstractCellCycleModelOdeSolver::~AbstractCellCycleModelOdeSolver | ( | ) | [virtual] |
Virtual destructor since we have virtual methods.
Definition at line 38 of file AbstractCellCycleModelOdeSolver.cpp.
void AbstractCellCycleModelOdeSolver::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archive the member variables.
Serialization of singleton objects must be done with care. Before the object is serialized via a pointer, it *MUST* be serialized directly, or an assertion will trip when a second instance of the class is created on de-serialization.
archive | the archive | |
version | the current version of this class |
Reimplemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >, and CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >.
Definition at line 67 of file AbstractCellCycleModelOdeSolver.hpp.
References mpOdeSolver, and mSizeOfOdeSystem.
virtual bool AbstractCellCycleModelOdeSolver::IsSetUp | ( | ) | [pure virtual] |
Is the instance in existence and fully set up.
Implemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >, and CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >.
Referenced by CheckForStoppingEvents(), GetStoppingTime(), IsAdaptive(), SetMaxSteps(), SetTolerances(), SolveAndUpdateStateVariable(), and StoppingEventOccurred().
void AbstractCellCycleModelOdeSolver::Reset | ( | ) | [virtual] |
Reset the instance.
Reimplemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >.
Definition at line 42 of file AbstractCellCycleModelOdeSolver.cpp.
void AbstractCellCycleModelOdeSolver::SolveAndUpdateStateVariable | ( | AbstractOdeSystem * | pAbstractOdeSystem, | |
double | startTime, | |||
double | endTime, | |||
double | timeStep | |||
) |
Call mpOdeSolver->SolveAndUpdateStateVariable.
pAbstractOdeSystem | pointer to the concrete ODE system to be solved | |
startTime | the time at which the initial conditions are specified | |
endTime | the time to which the system should be solved and the solution returned | |
timeStep | the time interval to be used by the solver |
Definition at line 46 of file AbstractCellCycleModelOdeSolver.cpp.
References IsSetUp(), and mpOdeSolver.
virtual void AbstractCellCycleModelOdeSolver::Initialise | ( | ) | [pure virtual] |
Initialise the ODE solver.
Implemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >, and CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >.
bool AbstractCellCycleModelOdeSolver::StoppingEventOccurred | ( | ) |
Determine whether the solver quit due to the ODE's stopping event triggering
Definition at line 55 of file AbstractCellCycleModelOdeSolver.cpp.
References IsSetUp(), and mpOdeSolver.
double AbstractCellCycleModelOdeSolver::GetStoppingTime | ( | ) |
Call mpOdeSolver->GetStoppingTime.
Definition at line 61 of file AbstractCellCycleModelOdeSolver.cpp.
References IsSetUp(), and mpOdeSolver.
void AbstractCellCycleModelOdeSolver::SetSizeOfOdeSystem | ( | unsigned | sizeOfOdeSystem | ) |
Set method for mSizeOfOdeSystem.
sizeOfOdeSystem | the new value of mSizeOfOdeSystem |
Definition at line 67 of file AbstractCellCycleModelOdeSolver.cpp.
References mSizeOfOdeSystem.
unsigned AbstractCellCycleModelOdeSolver::GetSizeOfOdeSystem | ( | ) |
Definition at line 72 of file AbstractCellCycleModelOdeSolver.cpp.
References mSizeOfOdeSystem.
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 77 of file AbstractCellCycleModelOdeSolver.cpp.
References IsSetUp(), and mpOdeSolver.
void AbstractCellCycleModelOdeSolver::SetMaxSteps | ( | long int | 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).
numSteps | the new maximum number of steps |
Definition at line 88 of file AbstractCellCycleModelOdeSolver.cpp.
References IsSetUp(), and mpOdeSolver.
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.
relTol | the relative tolerance for the solver | |
absTol | the absolute tolerance for the solver |
Definition at line 99 of file AbstractCellCycleModelOdeSolver.cpp.
References IsSetUp(), and mpOdeSolver.
bool AbstractCellCycleModelOdeSolver::IsAdaptive | ( | ) | [virtual] |
Return 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 110 of file AbstractCellCycleModelOdeSolver.cpp.
References IsSetUp(), and mpOdeSolver.
Referenced by CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >::IsAdaptive().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented in CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >, and CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >.
Definition at line 54 of file AbstractCellCycleModelOdeSolver.hpp.
boost::shared_ptr<AbstractIvpOdeSolver> AbstractCellCycleModelOdeSolver::mpOdeSolver [protected] |
The ODE solver.
Definition at line 76 of file AbstractCellCycleModelOdeSolver.hpp.
Referenced by CheckForStoppingEvents(), GetStoppingTime(), CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >::Initialise(), CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >::Initialise(), IsAdaptive(), CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >::IsSetUp(), CellCycleModelOdeSolver< CELL_CYCLE_MODEL, ODE_SOLVER >::IsSetUp(), CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >::Reset(), serialize(), SetMaxSteps(), SetTolerances(), SolveAndUpdateStateVariable(), and StoppingEventOccurred().
unsigned AbstractCellCycleModelOdeSolver::mSizeOfOdeSystem [protected] |
The size of the ODE system to be solved.
Definition at line 79 of file AbstractCellCycleModelOdeSolver.hpp.
Referenced by GetSizeOfOdeSystem(), CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >::Initialise(), CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >::IsSetUp(), CellCycleModelOdeSolver< CELL_CYCLE_MODEL, BackwardEulerIvpOdeSolver >::Reset(), serialize(), and SetSizeOfOdeSystem().