AbstractOdeSystemInformation Class Reference

#include <AbstractOdeSystemInformation.hpp>

Inherited by CellwiseOdeSystemInformation< ODE_SYSTEM >, CombinedOdeSystemInformation, and OdeSystemInformation< ODE_SYSTEM >.

Collaboration diagram for AbstractOdeSystemInformation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AbstractOdeSystemInformation ()
virtual ~AbstractOdeSystemInformation ()
std::string GetSystemName () const
void SetDefaultInitialConditions (const std::vector< double > &rInitialConditions)
void SetDefaultInitialCondition (unsigned index, double initialCondition)
std::vector< doubleGetInitialConditions () 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::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, doublemAttributes
std::vector< doublemInitialConditions
bool mInitialised

Friends

class TestAbstractOdeSystem

Detailed Description

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 56 of file AbstractOdeSystemInformation.hpp.


Constructor & Destructor Documentation

AbstractOdeSystemInformation::AbstractOdeSystemInformation (  ) 

Constructor.

Definition at line 36 of file AbstractOdeSystemInformation.cpp.

AbstractOdeSystemInformation::~AbstractOdeSystemInformation (  )  [virtual]

Virtual destructor since we have virtual methods.

Definition at line 41 of file AbstractOdeSystemInformation.cpp.


Member Function Documentation

unsigned AbstractOdeSystemInformation::GetAnyVariableIndex ( const std::string &  rName  )  const

Get the index of a variable, whether a state variable, parameter, or derived quantity, with the given name. The returned index is suitable for use with GetAnyVariableUnits.

Indices go through Variables, Parameters then derived quantities.

Parameters:
rName the name of a variable

Definition at line 154 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.

Parameters:
index an index from GetAnyVariableIndex.
Returns:
the units of the variable.

Definition at line 182 of file AbstractOdeSystemInformation.cpp.

References EXCEPTION, mDerivedQuantityUnits, mInitialised, mParameterUnits, and mVariableUnits.

double AbstractOdeSystemInformation::GetAttribute ( const std::string &  rName  )  const

Get the value of a named attribute.

Parameters:
rName the attribute name.

Definition at line 270 of file AbstractOdeSystemInformation.cpp.

References EXCEPTION, mAttributes, and mInitialised.

unsigned AbstractOdeSystemInformation::GetDerivedQuantityIndex ( const std::string &  rName  )  const

Get the index of a derived quantity, given its name.

Parameters:
rName the name of a derived quantity.

Definition at line 224 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.

Parameters:
index an index from GetDerivedQuantityIndex.
Returns:
the units of the variable.

Definition at line 242 of file AbstractOdeSystemInformation.cpp.

References EXCEPTION, mDerivedQuantityUnits, and mInitialised.

std::vector< double > AbstractOdeSystemInformation::GetInitialConditions (  )  const

Get a copy of the suggested initial conditions.

Definition at line 62 of file AbstractOdeSystemInformation.cpp.

References mInitialConditions, and mInitialised.

unsigned AbstractOdeSystemInformation::GetNumberOfAttributes (  )  const
Returns:
the number of named attributes that this system has.

Definition at line 258 of file AbstractOdeSystemInformation.cpp.

References mAttributes, and mInitialised.

unsigned AbstractOdeSystemInformation::GetNumberOfDerivedQuantities (  )  const
Returns:
the number of derived quantities in this system

Definition at line 252 of file AbstractOdeSystemInformation.cpp.

References mDerivedQuantityUnits, and mInitialised.

unsigned AbstractOdeSystemInformation::GetNumberOfParameters (  )  const
Returns:
The number of parameters in this parameterised system.

Definition at line 148 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.

Parameters:
rName the name of a parameter
Returns:
the parameter's position within the vector of parameters associated with the ODE system.

Definition at line 120 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.

Parameters:
index a state variable's position within the vector of state variables associated with the ODE system.
Returns:
the units of the state variable.

Definition at line 138 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.

Parameters:
rName the name of a state variable
Returns:
the state variable's position within the vector of state variables associated with the ODE system.

Definition at line 80 of file AbstractOdeSystemInformation.cpp.

References EXCEPTION, mInitialised, and mVariableNames.

Referenced by GetAnyVariableIndex().

std::string AbstractOdeSystemInformation::GetStateVariableUnits ( unsigned  index  )  const

Get the units of a state variable given its index in the ODE system.

Parameters:
index a state variable's position within the vector of state variables associated with the ODE system.
Returns:
the units of the state variable.

Definition at line 98 of file AbstractOdeSystemInformation.cpp.

References EXCEPTION, mInitialised, and mVariableUnits.

std::string AbstractOdeSystemInformation::GetSystemName (  )  const

Get the name of this system of ODEs.

Definition at line 45 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.

Parameters:
rName the name of a variable
Returns:
whether the variable is in this ODE system

Definition at line 176 of file AbstractOdeSystemInformation.cpp.

References HasDerivedQuantity(), HasParameter(), HasStateVariable(), and mInitialised.

bool AbstractOdeSystemInformation::HasAttribute ( const std::string &  rName  )  const

Test whether this system has a particular named attribute.

Parameters:
rName the attribute name.

Definition at line 264 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.

Parameters:
rName the name of a derived quantity
Returns:
whether the derived quantity is in this ODE system

Definition at line 235 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.

Parameters:
rName the name of a parameter
Returns:
whether the parameter is in this ODE system

Definition at line 131 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.

Parameters:
rName the name of a state variable
Returns:
whether the state variable is in this ODE system

Definition at line 91 of file AbstractOdeSystemInformation.cpp.

References mInitialised, and mVariableNames.

Referenced by GetAnyVariableIndex(), and HasAnyVariable().

virtual void AbstractOdeSystemInformation::Initialise (  )  [protected, pure virtual]
const std::vector< std::string > & AbstractOdeSystemInformation::rGetDerivedQuantityNames (  )  const

Get the vector of derived quantity names.

Definition at line 212 of file AbstractOdeSystemInformation.cpp.

References mDerivedQuantityNames, and mInitialised.

const std::vector< std::string > & AbstractOdeSystemInformation::rGetDerivedQuantityUnits (  )  const

Get the vector of derived quantity units.

Definition at line 218 of file AbstractOdeSystemInformation.cpp.

References mDerivedQuantityUnits, and mInitialised.

const std::vector< std::string > & AbstractOdeSystemInformation::rGetParameterNames (  )  const

Get the vector of parameter names.

Definition at line 108 of file AbstractOdeSystemInformation.cpp.

References mInitialised, and mParameterNames.

const std::vector< std::string > & AbstractOdeSystemInformation::rGetParameterUnits (  )  const

Get the vector of parameter units.

Definition at line 114 of file AbstractOdeSystemInformation.cpp.

References mInitialised, and mParameterUnits.

const std::vector< std::string > & AbstractOdeSystemInformation::rGetStateVariableNames (  )  const

Get the state variable names vector.

Definition at line 68 of file AbstractOdeSystemInformation.cpp.

References mInitialised, and mVariableNames.

const std::vector< std::string > & AbstractOdeSystemInformation::rGetStateVariableUnits (  )  const

Get the state variable units vector.

Definition at line 74 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.

Parameters:
index the index of the state variable in the system
initialCondition the initial value for the state variable

Definition at line 56 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.

Parameters:
rInitialConditions vector containing initial values for the state variables

Definition at line 50 of file AbstractOdeSystemInformation.cpp.

References mInitialConditions, and mInitialised.


Member Data Documentation

std::map<std::string, double> AbstractOdeSystemInformation::mAttributes [protected]

Named attributes

Definition at line 83 of file AbstractOdeSystemInformation.hpp.

Referenced by GetAttribute(), GetNumberOfAttributes(), and HasAttribute().

std::vector<std::string> AbstractOdeSystemInformation::mDerivedQuantityNames [protected]

Derived quantity names

Definition at line 77 of file AbstractOdeSystemInformation.hpp.

Referenced by GetDerivedQuantityIndex(), HasDerivedQuantity(), and rGetDerivedQuantityNames().

std::vector<std::string> AbstractOdeSystemInformation::mDerivedQuantityUnits [protected]
std::vector<std::string> AbstractOdeSystemInformation::mParameterNames [protected]

Parameter names

Definition at line 71 of file AbstractOdeSystemInformation.hpp.

Referenced by GetAnyVariableIndex(), GetParameterIndex(), HasParameter(), and rGetParameterNames().

std::vector<std::string> AbstractOdeSystemInformation::mParameterUnits [protected]

Human-friendly name for the ODE system

Definition at line 62 of file AbstractOdeSystemInformation.hpp.

Referenced by GetSystemName(), and OdeSystemInformation< ODE_SYSTEM >::Initialise().

std::vector<std::string> AbstractOdeSystemInformation::mVariableNames [protected]
std::vector<std::string> AbstractOdeSystemInformation::mVariableUnits [protected]

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