00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ABSTRACTPARAMETERISEDSYSTEM_HPP_
00030 #define ABSTRACTPARAMETERISEDSYSTEM_HPP_
00031
00032 #include <vector>
00033 #include <string>
00034 #include <boost/shared_ptr.hpp>
00035
00036 #include "AbstractOdeSystemInformation.hpp"
00037
00048 template<typename VECTOR>
00049 class AbstractParameterisedSystem
00050 {
00051 protected:
00053 unsigned mNumberOfStateVariables;
00054
00056 VECTOR mStateVariables;
00057
00059 VECTOR mParameters;
00060
00067 boost::shared_ptr<AbstractOdeSystemInformation> mpSystemInfo;
00068
00069 public:
00075 AbstractParameterisedSystem(unsigned numberOfStateVariables);
00076
00080 virtual ~AbstractParameterisedSystem();
00081
00085 boost::shared_ptr<const AbstractOdeSystemInformation> GetSystemInformation() const;
00086
00090 std::string GetSystemName() const;
00091
00092
00093
00094
00095
00101 unsigned GetNumberOfStateVariables() const;
00102
00106 VECTOR& rGetStateVariables();
00107
00112 VECTOR GetStateVariables();
00113
00119 double GetStateVariable(unsigned index) const;
00120
00126 double GetStateVariable(const std::string& rName) const;
00127
00134 void SetStateVariable(unsigned index, double newValue);
00135
00142 void SetStateVariable(const std::string& rName, double newValue);
00143
00147 const std::vector<std::string>& rGetStateVariableNames() const;
00148
00152 const std::vector<std::string>& rGetStateVariableUnits() const;
00153
00164 unsigned GetStateVariableIndex(const std::string& rName) const;
00165
00174 bool HasStateVariable(const std::string& rName) const;
00175
00183 std::string GetStateVariableUnits(unsigned index) const;
00184
00185
00186
00187
00188
00192 unsigned GetNumberOfParameters() const;
00193
00199 double GetParameter(unsigned index) const;
00200
00206 double GetParameter(const std::string& rName) const;
00207
00214 void SetParameter(const std::string& rName, double value);
00215
00222 void SetParameter(unsigned index, double value);
00223
00227 const std::vector<std::string>& rGetParameterNames() const;
00228
00232 const std::vector<std::string>& rGetParameterUnits() const;
00233
00243 unsigned GetParameterIndex(const std::string& rName) const;
00244
00253 bool HasParameter(const std::string& rName) const;
00254
00262 std::string GetParameterUnits(unsigned index) const;
00263
00264
00265
00266
00267
00281 double GetAnyVariable(unsigned index, double time=0.0,
00282 VECTOR* pDerivedQuantities=NULL);
00283
00297 double GetAnyVariable(const std::string& rName, double time=0.0,
00298 VECTOR* pDerivedQuantities=NULL);
00299
00308 unsigned GetAnyVariableIndex(const std::string& rName) const;
00309
00319 bool HasAnyVariable(const std::string& rName) const;
00320
00328 void SetAnyVariable(unsigned index, double value);
00329
00337 void SetAnyVariable(const std::string& rName, double value);
00338
00346 std::string GetAnyVariableUnits(unsigned index) const;
00347
00355 std::string GetAnyVariableUnits(const std::string& rName) const;
00356
00357
00358
00359
00360
00361
00365 unsigned GetNumberOfDerivedQuantities() const;
00366
00374 virtual VECTOR ComputeDerivedQuantities(double time,
00375 const VECTOR& rState);
00376
00382 VECTOR ComputeDerivedQuantitiesFromCurrentState(double time);
00383
00387 const std::vector<std::string>& rGetDerivedQuantityNames() const;
00388
00392 const std::vector<std::string>& rGetDerivedQuantityUnits() const;
00393
00399 unsigned GetDerivedQuantityIndex(const std::string& rName) const;
00400
00409 bool HasDerivedQuantity(const std::string& rName) const;
00410
00417 std::string GetDerivedQuantityUnits(unsigned index) const;
00418
00419
00420
00421
00422
00426 unsigned GetNumberOfAttributes() const;
00427
00432 bool HasAttribute(const std::string& rName) const;
00433
00438 double GetAttribute(const std::string& rName) const;
00439 };
00440
00441 #endif