Chaste
Release::2018.1
|
#include <AbstractOdeSystemInformation.hpp>
Public Member Functions | |
AbstractOdeSystemInformation () | |
virtual | ~AbstractOdeSystemInformation () |
std::string | GetSystemName () const |
std::string | GetFreeVariableName () const |
std::string | GetFreeVariableUnits () const |
void | SetDefaultInitialConditions (const std::vector< double > &rInitialConditions) |
void | SetDefaultInitialCondition (unsigned index, double initialCondition) |
std::vector< double > | GetInitialConditions () 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 |
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 | GetNumberOfParameters () const |
unsigned | GetAnyVariableIndex (const std::string &rName) const |
bool | HasAnyVariable (const std::string &rName) const |
std::string | GetAnyVariableUnits (unsigned index) 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 | GetNumberOfDerivedQuantities () const |
unsigned | GetNumberOfAttributes () const |
bool | HasAttribute (const std::string &rName) const |
double | GetAttribute (const std::string &rName) const |
Protected Member Functions | |
virtual void | Initialise ()=0 |
Protected Attributes | |
std::string | mSystemName |
std::string | mFreeVariableName |
std::string | mFreeVariableUnits |
std::vector< std::string > | mVariableNames |
std::vector< std::string > | mVariableUnits |
std::vector< std::string > | mParameterNames |
std::vector< std::string > | mParameterUnits |
std::vector< std::string > | mDerivedQuantityNames |
std::vector< std::string > | mDerivedQuantityUnits |
std::map< std::string, double > | mAttributes |
std::vector< double > | mInitialConditions |
bool | mInitialised |
Friends | |
class | TestAbstractOdeSystem |
An abstract class which provides access to information about a particular ODE system *class* (as opposed to an instance).
The information available includes:
This class requires a subclass defining the Initialise method in order to set up the information. Developers may do this by defining their own subclass, but the most convenient method is likely to be to use the OdeSystemInformation class, which is a templated singleton subclass of this AbstractOdeSystemInformation class. See its documentation for details of how to use it.
Definition at line 62 of file AbstractOdeSystemInformation.hpp.
AbstractOdeSystemInformation::AbstractOdeSystemInformation | ( | ) |
Constructor.
Definition at line 43 of file AbstractOdeSystemInformation.cpp.
|
virtual |
Virtual destructor since we have virtual methods.
Definition at line 48 of file AbstractOdeSystemInformation.cpp.
unsigned AbstractOdeSystemInformation::GetAnyVariableIndex | ( | const std::string & | rName | ) | const |
Indices go through Variables, Parameters then derived quantities.
rName | the name of a variable |
Definition at line 171 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, GetDerivedQuantityIndex(), GetParameterIndex(), GetStateVariableIndex(), HasDerivedQuantity(), HasParameter(), HasStateVariable(), mInitialised, mParameterNames, and mVariableNames.
std::string AbstractOdeSystemInformation::GetAnyVariableUnits | ( | unsigned | index | ) | const |
Get the units of a variable, whether a state variable, parameter, or derived quantity, given its index as returned by GetAnyVariableIndex.
index | an index from GetAnyVariableIndex. |
Definition at line 199 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, mDerivedQuantityUnits, mInitialised, mParameterUnits, and mVariableUnits.
double AbstractOdeSystemInformation::GetAttribute | ( | const std::string & | rName | ) | const |
rName | the attribute name. |
Definition at line 287 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, mAttributes, and mInitialised.
unsigned AbstractOdeSystemInformation::GetDerivedQuantityIndex | ( | const std::string & | rName | ) | const |
rName | the name of a derived quantity. |
Definition at line 241 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, mDerivedQuantityNames, and mInitialised.
Referenced by GetAnyVariableIndex().
std::string AbstractOdeSystemInformation::GetDerivedQuantityUnits | ( | unsigned | index | ) | const |
Get the units of a derived quantity.
index | an index from GetDerivedQuantityIndex. |
Definition at line 259 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, mDerivedQuantityUnits, and mInitialised.
std::string AbstractOdeSystemInformation::GetFreeVariableName | ( | ) | const |
Definition at line 57 of file AbstractOdeSystemInformation.cpp.
References mFreeVariableName.
std::string AbstractOdeSystemInformation::GetFreeVariableUnits | ( | ) | const |
Definition at line 62 of file AbstractOdeSystemInformation.cpp.
References mFreeVariableUnits.
std::vector< double > AbstractOdeSystemInformation::GetInitialConditions | ( | ) | const |
Definition at line 79 of file AbstractOdeSystemInformation.cpp.
References mInitialConditions, and mInitialised.
unsigned AbstractOdeSystemInformation::GetNumberOfAttributes | ( | ) | const |
Definition at line 275 of file AbstractOdeSystemInformation.cpp.
References mAttributes, and mInitialised.
unsigned AbstractOdeSystemInformation::GetNumberOfDerivedQuantities | ( | ) | const |
Definition at line 269 of file AbstractOdeSystemInformation.cpp.
References mDerivedQuantityUnits, and mInitialised.
unsigned AbstractOdeSystemInformation::GetNumberOfParameters | ( | ) | const |
Definition at line 165 of file AbstractOdeSystemInformation.cpp.
References mInitialised, and mParameterUnits.
unsigned AbstractOdeSystemInformation::GetParameterIndex | ( | const std::string & | rName | ) | const |
This method is used to establish a parameter's position within the vector of parameters of an ODE system. This number can then be used with the method GetParameterUnits.
rName | the name of a parameter |
Definition at line 137 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, mInitialised, and mParameterNames.
Referenced by GetAnyVariableIndex().
std::string AbstractOdeSystemInformation::GetParameterUnits | ( | unsigned | index | ) | const |
Get the units of a parameter given its index in the ODE system.
index | a state variable's position within the vector of state variables associated with the ODE system. |
Definition at line 155 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, mInitialised, and mParameterUnits.
unsigned AbstractOdeSystemInformation::GetStateVariableIndex | ( | const std::string & | rName | ) | const |
This method is used to establish a state varible's position within the vector of state variables of an ODE system. This number can then be used with the method GetStateVariableUnits.
rName | the name of a state variable |
Definition at line 97 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, mInitialised, and mVariableNames.
Referenced by GetAnyVariableIndex().
std::string AbstractOdeSystemInformation::GetStateVariableUnits | ( | unsigned | index | ) | const |
index | a state variable's position within the vector of state variables associated with the ODE system. |
Definition at line 115 of file AbstractOdeSystemInformation.cpp.
References EXCEPTION, mInitialised, and mVariableUnits.
std::string AbstractOdeSystemInformation::GetSystemName | ( | ) | const |
Definition at line 52 of file AbstractOdeSystemInformation.cpp.
References mSystemName.
bool AbstractOdeSystemInformation::HasAnyVariable | ( | const std::string & | rName | ) | const |
This method is used to establish whether a variable is in an ODE system's state vars, parameters or derived quantitites. You can then safely call GetAnyVariableIndex without a try...catch statement.
rName | the name of a variable |
Definition at line 193 of file AbstractOdeSystemInformation.cpp.
References HasDerivedQuantity(), HasParameter(), HasStateVariable(), and mInitialised.
bool AbstractOdeSystemInformation::HasAttribute | ( | const std::string & | rName | ) | const |
rName | the attribute name. |
Definition at line 281 of file AbstractOdeSystemInformation.cpp.
References mAttributes, and mInitialised.
bool AbstractOdeSystemInformation::HasDerivedQuantity | ( | const std::string & | rName | ) | const |
This method is used to establish whether a derived quantity is in an ODE system. You can then safely call GetDerivedQuantityIndex without a try...catch statement.
rName | the name of a derived quantity |
Definition at line 252 of file AbstractOdeSystemInformation.cpp.
References mDerivedQuantityNames, and mInitialised.
Referenced by GetAnyVariableIndex(), and HasAnyVariable().
bool AbstractOdeSystemInformation::HasParameter | ( | const std::string & | rName | ) | const |
This method is used to establish whether a parameter is in an ODE system. You can then safely call GetParameterIndex without a try...catch statement.
rName | the name of a parameter |
Definition at line 148 of file AbstractOdeSystemInformation.cpp.
References mInitialised, and mParameterNames.
Referenced by GetAnyVariableIndex(), and HasAnyVariable().
bool AbstractOdeSystemInformation::HasStateVariable | ( | const std::string & | rName | ) | const |
This method is used to establish whether a state variable is in an ODE system. You can then safely call GetStateVariableIndex without a try...catch statement.
rName | the name of a state variable |
Definition at line 108 of file AbstractOdeSystemInformation.cpp.
References mInitialised, and mVariableNames.
Referenced by GetAnyVariableIndex(), and HasAnyVariable().
|
protectedpure virtual |
Initialise the ODE system information.
This must be provided by subclasses.
Implemented in OdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, CellwiseOdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, CellwiseOdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, CellwiseOdeSystemInformation< ODE_SYSTEM >, CellwiseOdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, CombinedOdeSystemInformation, OdeSystemInformation< ODE_SYSTEM >, CellwiseOdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, CellwiseOdeSystemInformation< ODE_SYSTEM >, CellwiseOdeSystemInformation< ODE_SYSTEM >, OdeSystemInformation< ODE_SYSTEM >, and OdeSystemInformation< ODE_SYSTEM >.
const std::vector< std::string > & AbstractOdeSystemInformation::rGetDerivedQuantityNames | ( | ) | const |
Definition at line 229 of file AbstractOdeSystemInformation.cpp.
References mDerivedQuantityNames, and mInitialised.
const std::vector< std::string > & AbstractOdeSystemInformation::rGetDerivedQuantityUnits | ( | ) | const |
Definition at line 235 of file AbstractOdeSystemInformation.cpp.
References mDerivedQuantityUnits, and mInitialised.
const std::vector< std::string > & AbstractOdeSystemInformation::rGetParameterNames | ( | ) | const |
Definition at line 125 of file AbstractOdeSystemInformation.cpp.
References mInitialised, and mParameterNames.
const std::vector< std::string > & AbstractOdeSystemInformation::rGetParameterUnits | ( | ) | const |
Definition at line 131 of file AbstractOdeSystemInformation.cpp.
References mInitialised, and mParameterUnits.
const std::vector< std::string > & AbstractOdeSystemInformation::rGetStateVariableNames | ( | ) | const |
Definition at line 85 of file AbstractOdeSystemInformation.cpp.
References mInitialised, and mVariableNames.
const std::vector< std::string > & AbstractOdeSystemInformation::rGetStateVariableUnits | ( | ) | const |
Definition at line 91 of file AbstractOdeSystemInformation.cpp.
References mInitialised, and mVariableUnits.
void AbstractOdeSystemInformation::SetDefaultInitialCondition | ( | unsigned | index, |
double | initialCondition | ||
) |
Set a single component of the default initial conditions for the ODE system. This method DOES NOT change the state variables of the ODE object on which it is called.
index | the index of the state variable in the system |
initialCondition | the initial value for the state variable |
Definition at line 73 of file AbstractOdeSystemInformation.cpp.
References mInitialConditions, and mInitialised.
void AbstractOdeSystemInformation::SetDefaultInitialConditions | ( | const std::vector< double > & | rInitialConditions | ) |
Set the default initial conditions for the ODE system. This method DOES NOT change the state variables of the ODE object on which it is called.
rInitialConditions | vector containing initial values for the state variables |
Definition at line 67 of file AbstractOdeSystemInformation.cpp.
References mInitialConditions, and mInitialised.
|
protected |
Named attributes
Definition at line 95 of file AbstractOdeSystemInformation.hpp.
Referenced by GetAttribute(), GetNumberOfAttributes(), and HasAttribute().
|
protected |
Derived quantity names
Definition at line 89 of file AbstractOdeSystemInformation.hpp.
Referenced by GetDerivedQuantityIndex(), HasDerivedQuantity(), and rGetDerivedQuantityNames().
|
protected |
Derived quantity units
Definition at line 92 of file AbstractOdeSystemInformation.hpp.
Referenced by GetAnyVariableUnits(), GetDerivedQuantityUnits(), GetNumberOfDerivedQuantities(), and rGetDerivedQuantityUnits().
|
protected |
The name of the free variable.
Definition at line 71 of file AbstractOdeSystemInformation.hpp.
Referenced by GetFreeVariableName().
|
protected |
The units of the free variable.
Definition at line 74 of file AbstractOdeSystemInformation.hpp.
Referenced by GetFreeVariableUnits().
|
protected |
Suggested initial conditions
Definition at line 98 of file AbstractOdeSystemInformation.hpp.
Referenced by CombinedOdeSystemInformation::CombinedOdeSystemInformation(), GetInitialConditions(), SetDefaultInitialCondition(), and SetDefaultInitialConditions().
|
protected |
Whether a 'real' Initialise method has been called
Definition at line 101 of file AbstractOdeSystemInformation.hpp.
Referenced by CombinedOdeSystemInformation::CombinedOdeSystemInformation(), GetAnyVariableIndex(), GetAnyVariableUnits(), GetAttribute(), GetDerivedQuantityIndex(), GetDerivedQuantityUnits(), GetInitialConditions(), GetNumberOfAttributes(), GetNumberOfDerivedQuantities(), GetNumberOfParameters(), GetParameterIndex(), GetParameterUnits(), GetStateVariableIndex(), GetStateVariableUnits(), HasAnyVariable(), HasAttribute(), HasDerivedQuantity(), HasParameter(), HasStateVariable(), rGetDerivedQuantityNames(), rGetDerivedQuantityUnits(), rGetParameterNames(), rGetParameterUnits(), rGetStateVariableNames(), rGetStateVariableUnits(), SetDefaultInitialCondition(), and SetDefaultInitialConditions().
|
protected |
Parameter names
Definition at line 83 of file AbstractOdeSystemInformation.hpp.
Referenced by GetAnyVariableIndex(), GetParameterIndex(), HasParameter(), and rGetParameterNames().
|
protected |
Parameter units
Definition at line 86 of file AbstractOdeSystemInformation.hpp.
Referenced by GetAnyVariableUnits(), GetNumberOfParameters(), GetParameterUnits(), and rGetParameterUnits().
|
protected |
Human-friendly name for the ODE system
Definition at line 68 of file AbstractOdeSystemInformation.hpp.
Referenced by GetSystemName().
|
protected |
State variable names
Definition at line 77 of file AbstractOdeSystemInformation.hpp.
Referenced by CombinedOdeSystemInformation::CombinedOdeSystemInformation(), GetAnyVariableIndex(), GetStateVariableIndex(), HasStateVariable(), and rGetStateVariableNames().
|
protected |
State variable units
Definition at line 80 of file AbstractOdeSystemInformation.hpp.
Referenced by CombinedOdeSystemInformation::CombinedOdeSystemInformation(), GetAnyVariableUnits(), GetStateVariableUnits(), and rGetStateVariableUnits().