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 void SetStateVariables(const VECTOR& rStateVariables);
00120
00126 double GetStateVariable(unsigned index) const;
00127
00133 double GetStateVariable(const std::string& rName) const;
00134
00141 void SetStateVariable(unsigned index, double newValue);
00142
00149 void SetStateVariable(const std::string& rName, double newValue);
00150
00154 const std::vector<std::string>& rGetStateVariableNames() const;
00155
00159 const std::vector<std::string>& rGetStateVariableUnits() const;
00160
00171 unsigned GetStateVariableIndex(const std::string& rName) const;
00172
00181 bool HasStateVariable(const std::string& rName) const;
00182
00190 std::string GetStateVariableUnits(unsigned index) const;
00191
00192
00193
00194
00195
00205 void SetDefaultInitialConditions(const VECTOR& rInitialConditions);
00206
00217 void SetDefaultInitialCondition(unsigned index, double initialCondition);
00218
00224 VECTOR GetInitialConditions() const;
00225
00229 void ResetToInitialConditions();
00230
00231
00232
00233
00234
00238 unsigned GetNumberOfParameters() const;
00239
00245 double GetParameter(unsigned index) const;
00246
00252 double GetParameter(const std::string& rName) const;
00253
00260 void SetParameter(const std::string& rName, double value);
00261
00268 void SetParameter(unsigned index, double value);
00269
00273 const std::vector<std::string>& rGetParameterNames() const;
00274
00278 const std::vector<std::string>& rGetParameterUnits() const;
00279
00289 unsigned GetParameterIndex(const std::string& rName) const;
00290
00299 bool HasParameter(const std::string& rName) const;
00300
00308 std::string GetParameterUnits(unsigned index) const;
00309
00310
00311
00312
00313
00327 double GetAnyVariable(unsigned index, double time=0.0,
00328 VECTOR* pDerivedQuantities=NULL);
00329
00343 double GetAnyVariable(const std::string& rName, double time=0.0,
00344 VECTOR* pDerivedQuantities=NULL);
00345
00354 unsigned GetAnyVariableIndex(const std::string& rName) const;
00355
00365 bool HasAnyVariable(const std::string& rName) const;
00366
00374 void SetAnyVariable(unsigned index, double value);
00375
00383 void SetAnyVariable(const std::string& rName, double value);
00384
00392 std::string GetAnyVariableUnits(unsigned index) const;
00393
00401 std::string GetAnyVariableUnits(const std::string& rName) const;
00402
00403
00404
00405
00406
00407
00411 unsigned GetNumberOfDerivedQuantities() const;
00412
00420 virtual VECTOR ComputeDerivedQuantities(double time,
00421 const VECTOR& rState);
00422
00428 VECTOR ComputeDerivedQuantitiesFromCurrentState(double time);
00429
00433 const std::vector<std::string>& rGetDerivedQuantityNames() const;
00434
00438 const std::vector<std::string>& rGetDerivedQuantityUnits() const;
00439
00445 unsigned GetDerivedQuantityIndex(const std::string& rName) const;
00446
00455 bool HasDerivedQuantity(const std::string& rName) const;
00456
00463 std::string GetDerivedQuantityUnits(unsigned index) const;
00464
00465
00466
00467
00468
00472 unsigned GetNumberOfAttributes() const;
00473
00478 bool HasAttribute(const std::string& rName) const;
00479
00484 double GetAttribute(const std::string& rName) const;
00485 };
00486
00487 #endif