Chaste
Release::2017.1
|
#include <AbstractParameterisedSystem.hpp>
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) |
Public Member Functions inherited from AbstractUntemplatedParameterisedSystem | |
AbstractUntemplatedParameterisedSystem (unsigned numberOfStateVariables) | |
virtual | ~AbstractUntemplatedParameterisedSystem () |
boost::shared_ptr< const AbstractOdeSystemInformation > | GetSystemInformation () const |
std::string | GetSystemName () const |
unsigned | GetNumberOfAttributes () const |
bool | HasAttribute (const std::string &rName) const |
double | GetAttribute (const std::string &rName) const |
unsigned | GetNumberOfStateVariables () const |
const std::vector< std::string > & | rGetStateVariableNames () const |
const std::vector< std::string > & | rGetStateVariableUnits () const |
unsigned | GetStateVariableIndex (const std::string &rName) const |
bool | HasStateVariable (const std::string &rName) const |
std::string | GetStateVariableUnits (unsigned index) const |
unsigned | GetNumberOfParameters () const |
const std::vector< std::string > & | rGetParameterNames () const |
const std::vector< std::string > & | rGetParameterUnits () const |
unsigned | GetParameterIndex (const std::string &rName) const |
bool | HasParameter (const std::string &rName) const |
std::string | GetParameterUnits (unsigned index) const |
unsigned | GetNumberOfDerivedQuantities () const |
const std::vector< std::string > & | rGetDerivedQuantityNames () const |
const std::vector< std::string > & | rGetDerivedQuantityUnits () const |
unsigned | GetDerivedQuantityIndex (const std::string &rName) const |
bool | HasDerivedQuantity (const std::string &rName) const |
std::string | GetDerivedQuantityUnits (unsigned index) const |
unsigned | GetAnyVariableIndex (const std::string &rName) const |
bool | HasAnyVariable (const std::string &rName) const |
std::string | GetAnyVariableUnits (unsigned index) const |
std::string | GetAnyVariableUnits (const std::string &rName) const |
Protected Member Functions | |
std::string | DumpState (const std::string &rMessage) |
std::string | DumpState (const std::string &rMessage, VECTOR Y) |
std::string | DumpState (const std::string &rMessage, VECTOR Y, double time) |
void | CheckParametersOnLoad (const std::vector< double > &rParameters, const std::vector< std::string > &rParameterNames) |
Protected Attributes | |
VECTOR | mStateVariables |
VECTOR | mParameters |
Protected Attributes inherited from AbstractUntemplatedParameterisedSystem | |
unsigned | mNumberOfStateVariables |
boost::shared_ptr< AbstractOdeSystemInformation > | mpSystemInfo |
Private Member Functions | |
std::string | GetStateMessage (const std::string &rMessage, VECTOR Y) |
Friends | |
class | TestAbstractCvodeSystem |
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 55 of file AbstractParameterisedSystem.hpp.
AbstractParameterisedSystem< VECTOR >::AbstractParameterisedSystem | ( | unsigned | numberOfStateVariables | ) |
Constructor.
numberOfStateVariables | the number of state variables in the ODE system |
Definition at line 46 of file AbstractParameterisedSystem.cpp.
References InitialiseEmptyVector(), AbstractParameterisedSystem< VECTOR >::mParameters, and AbstractParameterisedSystem< VECTOR >::mStateVariables.
|
protected |
This method is called by subclasses on completion of the load method of serialization.
It checks that the parameters that were loaded match those that should be in the class, and fills in with default values any that are missing. Hence this method updates mParameters.
rParameters | the parameters that were loaded. |
rParameterNames | the parameter names that were loaded. |
Definition at line 97 of file AbstractParameterisedSystem.cpp.
References CreateVectorIfEmpty(), EXCEPTION, GetVectorSize(), AbstractParameterisedSystem< VECTOR >::mParameters, AbstractUntemplatedParameterisedSystem::rGetParameterNames(), and SetVectorComponent().
|
virtual |
Compute the derived quantities from the given system state. Uses the current values for the parameters.
time | the time at which to compute the derived quantities |
rState | values for the state variables |
Definition at line 354 of file AbstractParameterisedSystem.cpp.
References EXCEPTION.
Referenced by AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantitiesFromCurrentState(), OdeSolution::rGetDerivedQuantities(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
VECTOR AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantitiesFromCurrentState | ( | double | time | ) |
Compute the derived quantities based on the current system state.
time | the time at which to compute the derived quantities |
Definition at line 361 of file AbstractParameterisedSystem.cpp.
References AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantities(), and AbstractParameterisedSystem< VECTOR >::mStateVariables.
Referenced by AbstractParameterisedSystem< VECTOR >::GetAnyVariable(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
|
protected |
Used to include extra debugging information in exception messages. For example, EXCEPTION(DumpState("Gating variable out of range"));
rMessage | the exception message |
Definition at line 54 of file AbstractParameterisedSystem.cpp.
References AbstractParameterisedSystem< VECTOR >::GetStateMessage(), and AbstractParameterisedSystem< VECTOR >::mStateVariables.
|
protected |
Used to include extra debugging information in exception messages. For example, EXCEPTION(DumpState("Gating variable out of range", state_variables));
rMessage | the exception message |
Y | the values of the state variables |
Definition at line 60 of file AbstractParameterisedSystem.cpp.
References AbstractParameterisedSystem< VECTOR >::GetStateMessage().
|
protected |
Used to include extra debugging information in exception messages. For example, EXCEPTION(DumpState("Gating variable out of range", state_variables, time));
rMessage | the exception message |
Y | the values of the state variables |
time | the independent variable (usually time). |
Definition at line 67 of file AbstractParameterisedSystem.cpp.
References AbstractParameterisedSystem< VECTOR >::GetStateMessage().
double AbstractParameterisedSystem< VECTOR >::GetAnyVariable | ( | unsigned | index, |
double | time = 0.0 , |
||
VECTOR * | pDerivedQuantities = NULL |
||
) |
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.
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 282 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 AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
double AbstractParameterisedSystem< VECTOR >::GetAnyVariable | ( | const std::string & | rName, |
double | time = 0.0 , |
||
VECTOR * | pDerivedQuantities = NULL |
||
) |
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.
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 319 of file AbstractParameterisedSystem.cpp.
References AbstractParameterisedSystem< VECTOR >::GetAnyVariable(), and AbstractUntemplatedParameterisedSystem::GetAnyVariableIndex().
VECTOR AbstractParameterisedSystem< VECTOR >::GetInitialConditions | ( | ) | const |
Definition at line 223 of file AbstractParameterisedSystem.cpp.
References CopyFromStdVector(), CreateVectorIfEmpty(), InitialiseEmptyVector(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, and AbstractUntemplatedParameterisedSystem::mpSystemInfo.
Referenced by AbstractOdeSrnModel::Initialise(), TysonNovakCellCycleModel::Initialise(), AbstractVanLeeuwen2009WntSwatCellCycleModel::Initialise(), SingleOdeWntCellCycleModel::Initialise(), WntCellCycleModel::Initialise(), Alarcon2004OxygenBasedCellCycleModel::ResetForDivision(), TysonNovakCellCycleModel::ResetForDivision(), AbstractWntOdeBasedCellCycleModel::ResetForDivision(), AbstractParameterisedSystem< VECTOR >::ResetToInitialConditions(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
double AbstractParameterisedSystem< VECTOR >::GetParameter | ( | unsigned | index | ) | const |
index | the index of the parameter |
Definition at line 246 of file AbstractParameterisedSystem.cpp.
References EXCEPTION, GetVectorComponent(), GetVectorSize(), and AbstractParameterisedSystem< VECTOR >::mParameters.
Referenced by DeltaNotchSrnModel::GetMeanNeighbouringDelta(), AbstractParameterisedSystem< VECTOR >::GetParameter(), OdeSolution::rGetParameters(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
double AbstractParameterisedSystem< VECTOR >::GetParameter | ( | const std::string & | rName | ) | const |
rName | the name of the parameter |
Definition at line 272 of file AbstractParameterisedSystem.cpp.
References AbstractParameterisedSystem< VECTOR >::GetParameter(), and AbstractUntemplatedParameterisedSystem::GetParameterIndex().
|
private |
Helper method to construct a string containing a dump of the vector
rMessage | a string to prefix (e.g. an error or the name of the vector) |
Y | a vector |
Definition at line 78 of file AbstractParameterisedSystem.cpp.
References GetVectorComponent(), GetVectorSize(), AbstractUntemplatedParameterisedSystem::rGetStateVariableNames(), and AbstractUntemplatedParameterisedSystem::rGetStateVariableUnits().
Referenced by AbstractParameterisedSystem< VECTOR >::DumpState().
double AbstractParameterisedSystem< VECTOR >::GetStateVariable | ( | unsigned | index | ) | const |
index | the index of the state variable |
Definition at line 163 of file AbstractParameterisedSystem.cpp.
References EXCEPTION, GetVectorComponent(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, and AbstractParameterisedSystem< VECTOR >::mStateVariables.
Referenced by AbstractParameterisedSystem< VECTOR >::GetStateVariable().
double AbstractParameterisedSystem< VECTOR >::GetStateVariable | ( | const std::string & | rName | ) | const |
rName | the name of the state variable |
Definition at line 173 of file AbstractParameterisedSystem.cpp.
References AbstractParameterisedSystem< VECTOR >::GetStateVariable(), and AbstractUntemplatedParameterisedSystem::GetStateVariableIndex().
VECTOR AbstractParameterisedSystem< VECTOR >::GetStateVariables | ( | ) |
Definition at line 142 of file AbstractParameterisedSystem.cpp.
References CopyVector(), and AbstractParameterisedSystem< VECTOR >::mStateVariables.
|
virtual |
Reset the system's state variables to the default initial conditions.
Implements AbstractUntemplatedParameterisedSystem.
Definition at line 234 of file AbstractParameterisedSystem.cpp.
References DeleteVector(), AbstractParameterisedSystem< VECTOR >::GetInitialConditions(), and AbstractParameterisedSystem< VECTOR >::SetStateVariables().
Referenced by AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
VECTOR & AbstractParameterisedSystem< VECTOR >::rGetStateVariables | ( | ) |
Definition at line 136 of file AbstractParameterisedSystem.cpp.
References AbstractParameterisedSystem< VECTOR >::mStateVariables.
Referenced by Alarcon2004OxygenBasedCellCycleModel::AdjustOdeParameters(), AbstractVanLeeuwen2009WntSwatCellCycleModel::AdjustOdeParameters(), WntCellCycleModel::AdjustOdeParameters(), SingleOdeWntCellCycleModel::AdjustOdeParameters(), Alarcon2004OxygenBasedCellCycleModel::Alarcon2004OxygenBasedCellCycleModel(), AbstractVanLeeuwen2009WntSwatCellCycleModel::ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel(), WntCellCycleModel::ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel(), DeltaNotchSrnModel::DeltaNotchSrnModel(), SingleOdeWntCellCycleModel::GetBetaCateninConcentration(), Goldbeter1991SrnModel::GetC(), AbstractVanLeeuwen2009WntSwatCellCycleModel::GetCytoplasmicBetaCateninLevel(), DeltaNotchSrnModel::GetDelta(), Goldbeter1991SrnModel::GetM(), AbstractVanLeeuwen2009WntSwatCellCycleModel::GetMembraneBoundBetaCateninLevel(), DeltaNotchSrnModel::GetNotch(), AbstractVanLeeuwen2009WntSwatCellCycleModel::GetNuclearBetaCateninLevel(), CellCycleModelOdeHandler::GetProteinConcentrations(), Goldbeter1991SrnModel::GetX(), Goldbeter1991SrnModel::Goldbeter1991SrnModel(), AbstractOdeBasedCellCycleModel::ReadyToDivide(), Alarcon2004OxygenBasedCellCycleModel::ResetForDivision(), TysonNovakCellCycleModel::ResetForDivision(), AbstractWntOdeBasedCellCycleModel::ResetForDivision(), CellCycleModelOdeHandler::SetProteinConcentrationsForTestsOnly(), SingleOdeWntCellCycleModel::SingleOdeWntCellCycleModel(), AbstractIvpOdeSolver::SolveAndUpdateStateVariable(), TysonNovakCellCycleModel::TysonNovakCellCycleModel(), AbstractOdeBasedPhaseBasedCellCycleModel::UpdateCellCyclePhase(), VanLeeuwen2009WntSwatCellCycleModelHypothesisOne::VanLeeuwen2009WntSwatCellCycleModelHypothesisOne(), VanLeeuwen2009WntSwatCellCycleModelHypothesisTwo::VanLeeuwen2009WntSwatCellCycleModelHypothesisTwo(), and WntCellCycleModel::WntCellCycleModel().
void AbstractParameterisedSystem< VECTOR >::SetAnyVariable | ( | unsigned | index, |
double | value | ||
) |
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.
index | the index of the variable, as given by GetAnyVariableIndex. |
value | the value to give the variable. |
Definition at line 327 of file AbstractParameterisedSystem.cpp.
References EXCEPTION, GetVectorSize(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, AbstractParameterisedSystem< VECTOR >::mParameters, AbstractParameterisedSystem< VECTOR >::mStateVariables, and SetVectorComponent().
Referenced by AbstractParameterisedSystem< VECTOR >::SetAnyVariable(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
void AbstractParameterisedSystem< VECTOR >::SetAnyVariable | ( | const std::string & | rName, |
double | value | ||
) |
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.
rName | the name of the variable. |
value | the value to give the variable. |
Definition at line 344 of file AbstractParameterisedSystem.cpp.
References AbstractUntemplatedParameterisedSystem::GetAnyVariableIndex(), and AbstractParameterisedSystem< VECTOR >::SetAnyVariable().
void AbstractParameterisedSystem< VECTOR >::SetDefaultInitialCondition | ( | unsigned | index, |
double | initialCondition | ||
) |
Set a single component of the default initial conditions for the system.
index | the index of the state variable in the system |
initialCondition | the initial value for the state variable |
Definition at line 212 of file AbstractParameterisedSystem.cpp.
References EXCEPTION, AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, and AbstractUntemplatedParameterisedSystem::mpSystemInfo.
Referenced by AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
void AbstractParameterisedSystem< VECTOR >::SetDefaultInitialConditions | ( | const VECTOR & | rInitialConditions | ) |
Set the default initial conditions for the system.
rInitialConditions | vector containing initial values for the state variables |
Definition at line 199 of file AbstractParameterisedSystem.cpp.
References CopyToStdVector(), EXCEPTION, GetVectorSize(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, and AbstractUntemplatedParameterisedSystem::mpSystemInfo.
Referenced by AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
void AbstractParameterisedSystem< VECTOR >::SetParameter | ( | const std::string & | rName, |
double | value | ||
) |
Set the value of a given parameter.
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 DeltaNotchSrnModel::UpdateDeltaNotch(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
void AbstractParameterisedSystem< VECTOR >::SetParameter | ( | unsigned | index, |
double | value | ||
) |
Set the value of a given parameter.
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().
void AbstractParameterisedSystem< VECTOR >::SetStateVariable | ( | unsigned | index, |
double | newValue | ||
) |
Set the value of a single state variable in the ODE system.
index | index of the state variable to be set |
newValue | new value of the state variable |
Definition at line 179 of file AbstractParameterisedSystem.cpp.
References EXCEPTION, AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, AbstractParameterisedSystem< VECTOR >::mStateVariables, and SetVectorComponent().
Referenced by AbstractParameterisedSystem< VECTOR >::SetStateVariable().
void AbstractParameterisedSystem< VECTOR >::SetStateVariable | ( | const std::string & | rName, |
double | newValue | ||
) |
Set the value of a single state variable in the ODE system.
rName | name of the state variable to be set |
newValue | new value of the state variable |
Definition at line 189 of file AbstractParameterisedSystem.cpp.
References AbstractUntemplatedParameterisedSystem::GetStateVariableIndex(), and AbstractParameterisedSystem< VECTOR >::SetStateVariable().
void AbstractParameterisedSystem< VECTOR >::SetStateVariables | ( | const VECTOR & | rStateVariables | ) |
Set the state variables equal to the values in the given vector, copying it. Caller thus maintains responsibility for deleting the input vector (if required for the VECTOR type).
rStateVariables | new values for the state variables |
Definition at line 148 of file AbstractParameterisedSystem.cpp.
References CreateVectorIfEmpty(), EXCEPTION, GetVectorComponent(), GetVectorSize(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, AbstractParameterisedSystem< VECTOR >::mStateVariables, and SetVectorComponent().
Referenced by AbstractOdeSrnModel::Initialise(), TysonNovakCellCycleModel::Initialise(), AbstractVanLeeuwen2009WntSwatCellCycleModel::Initialise(), SingleOdeWntCellCycleModel::Initialise(), WntCellCycleModel::Initialise(), TysonNovakCellCycleModel::ResetForDivision(), AbstractParameterisedSystem< VECTOR >::ResetToInitialConditions(), CellCycleModelOdeHandler::SetProteinConcentrationsForTestsOnly(), and CellCycleModelOdeHandler::SetStateVariables().
|
inlinevirtual |
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 198 of file AbstractParameterisedSystem.hpp.
|
protected |
Vector containing parameter values.
Definition at line 74 of file AbstractParameterisedSystem.hpp.
Referenced by AbstractParameterisedSystem< VECTOR >::AbstractParameterisedSystem(), AbstractParameterisedSystem< VECTOR >::CheckParametersOnLoad(), AbstractParameterisedSystem< VECTOR >::GetAnyVariable(), AbstractParameterisedSystem< VECTOR >::GetParameter(), AbstractParameterisedSystem< VECTOR >::SetAnyVariable(), and AbstractParameterisedSystem< VECTOR >::SetParameter().
|
protected |
Vector containing the current values of the state variables.
Definition at line 71 of file AbstractParameterisedSystem.hpp.
Referenced by AbstractParameterisedSystem< VECTOR >::AbstractParameterisedSystem(), AbstractParameterisedSystem< VECTOR >::ComputeDerivedQuantitiesFromCurrentState(), AbstractParameterisedSystem< VECTOR >::DumpState(), AbstractParameterisedSystem< VECTOR >::GetAnyVariable(), AbstractParameterisedSystem< VECTOR >::GetStateVariable(), AbstractParameterisedSystem< VECTOR >::GetStateVariables(), AbstractParameterisedSystem< VECTOR >::rGetStateVariables(), AbstractParameterisedSystem< VECTOR >::SetAnyVariable(), AbstractParameterisedSystem< VECTOR >::SetStateVariable(), and AbstractParameterisedSystem< VECTOR >::SetStateVariables().