AbstractParameterisedSystem< VECTOR > Class Template Reference

#include <AbstractParameterisedSystem.hpp>

Inherits AbstractUntemplatedParameterisedSystem.

Collaboration diagram for AbstractParameterisedSystem< VECTOR >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AbstractParameterisedSystem (unsigned numberOfStateVariables)
VECTOR & rGetStateVariables ()
VECTOR GetStateVariables ()
void SetStateVariables (const VECTOR &rStateVariables)
double GetStateVariable (unsigned index) const
double GetStateVariable (const std::string &rName) const
void SetStateVariable (unsigned index, double newValue)
void SetStateVariable (const std::string &rName, double newValue)
virtual void VerifyStateVariables ()
void SetDefaultInitialConditions (const VECTOR &rInitialConditions)
void SetDefaultInitialCondition (unsigned index, double initialCondition)
VECTOR GetInitialConditions () const
void ResetToInitialConditions ()
double GetParameter (unsigned index) const
double GetParameter (const std::string &rName) const
void SetParameter (const std::string &rName, double value)
void SetParameter (unsigned index, double value)
double GetAnyVariable (unsigned index, double time=0.0, VECTOR *pDerivedQuantities=NULL)
double GetAnyVariable (const std::string &rName, double time=0.0, VECTOR *pDerivedQuantities=NULL)
void SetAnyVariable (unsigned index, double value)
void SetAnyVariable (const std::string &rName, double value)
virtual VECTOR ComputeDerivedQuantities (double time, const VECTOR &rState)
VECTOR ComputeDerivedQuantitiesFromCurrentState (double time)

Protected Member Functions

std::string DumpState (const std::string &rMessage)
std::string DumpState (const std::string &rMessage, VECTOR Y)

Protected Attributes

VECTOR mStateVariables
VECTOR mParameters

Private Member Functions

std::string GetStateMessage (const std::string &message, VECTOR Y)

Friends

class TestAbstractCvodeSystem

Detailed Description

template<typename VECTOR>
class AbstractParameterisedSystem< VECTOR >

This class contains the state variable and parameter vectors for an ODE system, along with methods to access these.

Its main purpose is to be a common base class for both AbstractOdeSystem and AbstractCvodeSystem, which require similar functionality but use different vector types.

Definition at line 303 of file AbstractParameterisedSystem.hpp.


Constructor & Destructor Documentation

template<typename VECTOR >
AbstractParameterisedSystem< VECTOR >::AbstractParameterisedSystem ( unsigned  numberOfStateVariables  )  [inline]

Constructor.

Parameters:
numberOfStateVariables the number of state variables in the ODE system

Definition at line 45 of file AbstractParameterisedSystem.cpp.

References InitialiseEmptyVector(), AbstractParameterisedSystem< VECTOR >::mParameters, and AbstractParameterisedSystem< VECTOR >::mStateVariables.


Member Function Documentation

template<typename VECTOR>
VECTOR AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantities ( double  time,
const VECTOR &  rState 
) [inline, virtual]

Compute the derived quantities from the given system state. Uses the current values for the parameters.

Parameters:
time the time at which to compute the derived quantities
rState values for the state variables

Definition at line 407 of file AbstractParameterisedSystem.cpp.

References EXCEPTION.

Referenced by AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantitiesFromCurrentState(), and OdeSolution::rGetDerivedQuantities().

template<typename VECTOR >
VECTOR AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantitiesFromCurrentState ( double  time  )  [inline]

Compute the derived quantities based on the current system state.

Parameters:
time the time at which to compute the derived quantities

Definition at line 414 of file AbstractParameterisedSystem.cpp.

References AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantities(), and AbstractParameterisedSystem< VECTOR >::mStateVariables.

Referenced by AbstractParameterisedSystem< VECTOR >::GetAnyVariable().

template<typename VECTOR>
std::string AbstractParameterisedSystem< VECTOR >::DumpState ( const std::string &  rMessage,
VECTOR  Y 
) [inline, protected]

Used to include extra debugging information in exception messages. For example, EXCEPTION(DumpState("Gating variable out of range", state_variables));

Parameters:
rMessage the exception message
Y the values of the state variables

Definition at line 77 of file AbstractParameterisedSystem.cpp.

References AbstractParameterisedSystem< VECTOR >::GetStateMessage().

template<typename VECTOR >
std::string AbstractParameterisedSystem< VECTOR >::DumpState ( const std::string &  rMessage  )  [inline, protected]

Used to include extra debugging information in exception messages. For example, EXCEPTION(DumpState("Gating variable out of range"));

Parameters:
rMessage the exception message

Definition at line 71 of file AbstractParameterisedSystem.cpp.

References AbstractParameterisedSystem< VECTOR >::GetStateMessage(), and AbstractParameterisedSystem< VECTOR >::mStateVariables.

template<typename VECTOR>
double AbstractParameterisedSystem< VECTOR >::GetAnyVariable ( const std::string &  rName,
double  time = 0.0,
VECTOR *  pDerivedQuantities = NULL 
) [inline]

Get the value of a variable, whether a state variable, parameter, or derived quantity.

Note that if the variable is a derived quantity, this method will compute all derived quantities, so may not be very efficient. To avoid this, pass a pre-computed vector of derived quantities as the optional third argument.

Parameters:
rName the name of the variable, (this method is the same as doing GetAnyVariableIndex(rName) and then calling the method above).
time the current simulation time, possibly needed if the variable is a derived quantity.
pDerivedQuantities optional vector of pre-computed derived quantity values.

Definition at line 345 of file AbstractParameterisedSystem.cpp.

References AbstractParameterisedSystem< VECTOR >::GetAnyVariable(), and AbstractUntemplatedParameterisedSystem::GetAnyVariableIndex().

template<typename VECTOR>
double AbstractParameterisedSystem< VECTOR >::GetAnyVariable ( unsigned  index,
double  time = 0.0,
VECTOR *  pDerivedQuantities = NULL 
) [inline]

Get the value of a variable, whether a state variable, parameter, or derived quantity.

Note that if the variable is a derived quantity, this method will compute all derived quantities, so may not be very efficient. To avoid this, pass a pre-computed vector of derived quantities as the optional third argument.

Parameters:
index the index of the variable, as given by GetAnyVariableIndex.
time the current simulation time, possibly needed if the variable is a derived quantity.
pDerivedQuantities optional vector of pre-computed derived quantity values.

Definition at line 308 of file AbstractParameterisedSystem.cpp.

References AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantitiesFromCurrentState(), DeleteVector(), EXCEPTION, AbstractUntemplatedParameterisedSystem::GetNumberOfDerivedQuantities(), GetVectorComponent(), GetVectorSize(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, AbstractParameterisedSystem< VECTOR >::mParameters, and AbstractParameterisedSystem< VECTOR >::mStateVariables.

Referenced by AbstractParameterisedSystem< VECTOR >::GetAnyVariable(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep().

template<typename VECTOR >
VECTOR AbstractParameterisedSystem< VECTOR >::GetInitialConditions (  )  const [inline]
template<typename VECTOR >
double AbstractParameterisedSystem< VECTOR >::GetParameter ( const std::string &  rName  )  const [inline]

Get the value of a given parameter.

Parameters:
rName the name of the parameter

Definition at line 272 of file AbstractParameterisedSystem.cpp.

References AbstractParameterisedSystem< VECTOR >::GetParameter(), and AbstractUntemplatedParameterisedSystem::GetParameterIndex().

template<typename VECTOR >
double AbstractParameterisedSystem< VECTOR >::GetParameter ( unsigned  index  )  const [inline]
template<typename VECTOR>
std::string AbstractParameterisedSystem< VECTOR >::GetStateMessage ( const std::string &  message,
VECTOR  Y 
) [inline, private]

Helper method to construct a string containing a dump of the vector

Parameters:
message a string to prefix (e.g. an error or the name of the vector)
Y a vector
Returns:
a string containing the contents of the vector.

Definition at line 84 of file AbstractParameterisedSystem.cpp.

References GetVectorComponent(), GetVectorSize(), and AbstractUntemplatedParameterisedSystem::rGetStateVariableNames().

Referenced by AbstractParameterisedSystem< VECTOR >::DumpState().

template<typename VECTOR >
double AbstractParameterisedSystem< VECTOR >::GetStateVariable ( const std::string &  rName  )  const [inline]

Get the value of a given state variable.

Parameters:
rName the name of the state variable

Definition at line 142 of file AbstractParameterisedSystem.cpp.

References AbstractParameterisedSystem< VECTOR >::GetStateVariable(), and AbstractUntemplatedParameterisedSystem::GetStateVariableIndex().

template<typename VECTOR >
double AbstractParameterisedSystem< VECTOR >::GetStateVariable ( unsigned  index  )  const [inline]

Get the value of a given state variable.

Parameters:
index the index of the state variable

Definition at line 132 of file AbstractParameterisedSystem.cpp.

References EXCEPTION, GetVectorComponent(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, and AbstractParameterisedSystem< VECTOR >::mStateVariables.

Referenced by AbstractParameterisedSystem< VECTOR >::GetStateVariable().

template<typename VECTOR >
VECTOR AbstractParameterisedSystem< VECTOR >::GetStateVariables (  )  [inline]

Get a copy of the state variable vector. Caller takes responsibility for deleting the returned vector (if required for the VECTOR type).

Definition at line 112 of file AbstractParameterisedSystem.cpp.

References CopyVector(), and AbstractParameterisedSystem< VECTOR >::mStateVariables.

template<typename VECTOR >
void AbstractParameterisedSystem< VECTOR >::ResetToInitialConditions (  )  [inline]

Reset the system's state variables to the default initial conditions.

Definition at line 229 of file AbstractParameterisedSystem.cpp.

References DeleteVector(), AbstractParameterisedSystem< VECTOR >::GetInitialConditions(), and AbstractParameterisedSystem< VECTOR >::SetStateVariables().

template<typename VECTOR >
VECTOR & AbstractParameterisedSystem< VECTOR >::rGetStateVariables (  )  [inline]

Get the values of the state variables in the ODE system.

Definition at line 106 of file AbstractParameterisedSystem.cpp.

References AbstractParameterisedSystem< VECTOR >::mStateVariables.

Referenced by WntCellCycleModel::AdjustOdeParameters(), SingleOdeWntCellCycleModel::AdjustOdeParameters(), AbstractVanLeeuwen2009WntSwatCellCycleModel::AdjustOdeParameters(), Alarcon2004OxygenBasedCellCycleModel::AdjustOdeParameters(), WntCellCycleModel::ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel(), AbstractVanLeeuwen2009WntSwatCellCycleModel::ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel(), WntCellCycleModel::CreateCellCycleModel(), VanLeeuwen2009WntSwatCellCycleModelHypothesisTwo::CreateCellCycleModel(), VanLeeuwen2009WntSwatCellCycleModelHypothesisOne::CreateCellCycleModel(), StochasticWntCellCycleModel::CreateCellCycleModel(), SingleOdeWntCellCycleModel::CreateCellCycleModel(), TysonNovakCellCycleModel::CreateCellCycleModel(), DeltaNotchCellCycleModel::CreateCellCycleModel(), Alarcon2004OxygenBasedCellCycleModel::CreateCellCycleModel(), SingleOdeWntCellCycleModel::GetBetaCateninConcentration(), AbstractVanLeeuwen2009WntSwatCellCycleModel::GetCytoplasmicBetaCateninLevel(), DeltaNotchCellCycleModel::GetDelta(), DeltaNotchCellCycleModel::GetMeanNeighbouringDelta(), AbstractVanLeeuwen2009WntSwatCellCycleModel::GetMembraneBoundBetaCateninLevel(), DeltaNotchCellCycleModel::GetNotch(), AbstractVanLeeuwen2009WntSwatCellCycleModel::GetNuclearBetaCateninLevel(), AbstractOdeBasedCellCycleModel::GetProteinConcentrations(), AbstractWntOdeBasedCellCycleModel::ResetForDivision(), TysonNovakCellCycleModel::ResetForDivision(), Alarcon2004OxygenBasedCellCycleModel::ResetForDivision(), AbstractOdeBasedCellCycleModel::SetProteinConcentrationsForTestsOnly(), AbstractIvpOdeSolver::SolveAndUpdateStateVariable(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems(), AbstractOdeBasedCellCycleModel::UpdateCellCyclePhase(), and DeltaNotchCellCycleModel::UpdateDeltaNotch().

template<typename VECTOR >
void AbstractParameterisedSystem< VECTOR >::SetAnyVariable ( const std::string &  rName,
double  value 
) [inline]

Set the value of a variable, whether a state variable or parameter. Attempting to set the value of a derived quantity will raise an exception.

Parameters:
rName the name of the variable.
value the value to give the variable.

Definition at line 381 of file AbstractParameterisedSystem.cpp.

References AbstractUntemplatedParameterisedSystem::GetAnyVariableIndex(), and AbstractParameterisedSystem< VECTOR >::SetAnyVariable().

template<typename VECTOR >
void AbstractParameterisedSystem< VECTOR >::SetAnyVariable ( unsigned  index,
double  value 
) [inline]

Set the value of a variable, whether a state variable or parameter. Attempting to set the value of a derived quantity will raise an exception.

Parameters:
index the index of the variable, as given by GetAnyVariableIndex.
value the value to give the variable.

Definition at line 364 of file AbstractParameterisedSystem.cpp.

References EXCEPTION, GetVectorSize(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, AbstractParameterisedSystem< VECTOR >::mParameters, AbstractParameterisedSystem< VECTOR >::mStateVariables, and SetVectorComponent().

Referenced by AbstractParameterisedSystem< VECTOR >::SetAnyVariable().

template<typename VECTOR >
void AbstractParameterisedSystem< VECTOR >::SetDefaultInitialCondition ( unsigned  index,
double  initialCondition 
) [inline]

Set a single component of the default initial conditions for the system.

Note:
The default initial conditions are shared among all instances of the particular concrete system class.
This method DOES NOT change the state variables of the object on which it is called.
Parameters:
index the index of the state variable in the system
initialCondition the initial value for the state variable

Definition at line 207 of file AbstractParameterisedSystem.cpp.

References EXCEPTION, AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, and AbstractUntemplatedParameterisedSystem::mpSystemInfo.

template<typename VECTOR>
void AbstractParameterisedSystem< VECTOR >::SetDefaultInitialConditions ( const VECTOR &  rInitialConditions  )  [inline]

Set the default initial conditions for the system.

Note:
The default initial conditions are shared among all instances of the particular concrete system class.
This method DOES NOT change the state variables of the object on which it is called.
Parameters:
rInitialConditions vector containing initial values for the state variables

Definition at line 194 of file AbstractParameterisedSystem.cpp.

References CopyToStdVector(), EXCEPTION, GetVectorSize(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, and AbstractUntemplatedParameterisedSystem::mpSystemInfo.

template<typename VECTOR >
void AbstractParameterisedSystem< VECTOR >::SetParameter ( unsigned  index,
double  value 
) [inline]

Set the value of a given parameter.

Parameters:
index the index of the parameter
value the value

Definition at line 256 of file AbstractParameterisedSystem.cpp.

References EXCEPTION, GetVectorSize(), AbstractParameterisedSystem< VECTOR >::mParameters, and SetVectorComponent().

template<typename VECTOR >
void AbstractParameterisedSystem< VECTOR >::SetParameter ( const std::string &  rName,
double  value 
) [inline]

Set the value of a given parameter.

Parameters:
rName the name of the parameter
value the value

Definition at line 266 of file AbstractParameterisedSystem.cpp.

References AbstractUntemplatedParameterisedSystem::GetParameterIndex(), AbstractParameterisedSystem< VECTOR >::mParameters, and SetVectorComponent().

Referenced by HeartConfigRelatedCellFactory< SPACE_DIM >::SetCellParameters().

template<typename VECTOR >
void AbstractParameterisedSystem< VECTOR >::SetStateVariable ( const std::string &  rName,
double  newValue 
) [inline]

Set the value of a single state variable in the ODE system.

Parameters:
rName name of the state variable to be set
newValue new value of the state variable

Definition at line 158 of file AbstractParameterisedSystem.cpp.

References AbstractUntemplatedParameterisedSystem::GetStateVariableIndex(), and AbstractParameterisedSystem< VECTOR >::SetStateVariable().

template<typename VECTOR >
void AbstractParameterisedSystem< VECTOR >::SetStateVariable ( unsigned  index,
double  newValue 
) [inline]

Set the value of a single state variable in the ODE system.

Parameters:
index index of the state variable to be set
newValue new value of the state variable

Definition at line 148 of file AbstractParameterisedSystem.cpp.

References EXCEPTION, AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, AbstractParameterisedSystem< VECTOR >::mStateVariables, and SetVectorComponent().

Referenced by AdaptiveBidomainProblem::InitializeSolutionOnAdaptedMesh(), and AbstractParameterisedSystem< VECTOR >::SetStateVariable().

template<typename VECTOR>
void AbstractParameterisedSystem< VECTOR >::SetStateVariables ( const VECTOR &  rStateVariables  )  [inline]
template<typename VECTOR>
virtual void AbstractParameterisedSystem< VECTOR >::VerifyStateVariables (  )  [inline, virtual]

Empty method which can be over-ridden and used in solvers to go through the current state vector and do range checking on the values (e.g. check that concentrations are positive and probabilities are between zero and one).

This method is overridden with a currently commented out method in AbstractCardiacCell which would be called by the ComputeExceptVoltage method (in heart).

This method is called by the AbstractCvodeSystem::Solve() method (in ode).

Reimplemented in CorriasBuistICCModified, and CorriasBuistSMCModified.

Definition at line 417 of file AbstractParameterisedSystem.hpp.


Member Data Documentation

template<typename VECTOR>
VECTOR AbstractParameterisedSystem< VECTOR >::mParameters [protected]
template<typename VECTOR>
VECTOR AbstractParameterisedSystem< VECTOR >::mStateVariables [protected]

The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:01:24 2011 for Chaste by  doxygen 1.6.3