00001 /* 00002 00003 Copyright (C) University of Oxford, 2005-2011 00004 00005 University of Oxford means the Chancellor, Masters and Scholars of the 00006 University of Oxford, having an administrative office at Wellington 00007 Square, Oxford OX1 2JD, UK. 00008 00009 This file is part of Chaste. 00010 00011 Chaste is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU Lesser General Public License as published 00013 by the Free Software Foundation, either version 2.1 of the License, or 00014 (at your option) any later version. 00015 00016 Chaste is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00019 License for more details. The offer of Chaste under the terms of the 00020 License is subject to the License being interpreted in accordance with 00021 English Law and subject to any action against the University of Oxford 00022 being under the jurisdiction of the English Courts. 00023 00024 You should have received a copy of the GNU Lesser General Public License 00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>. 00026 00027 */ 00028 00029 00030 #ifndef _ABSTRACTODESYSTEMINFORMATION_HPP_ 00031 #define _ABSTRACTODESYSTEMINFORMATION_HPP_ 00032 00033 #include <vector> 00034 #include <string> 00035 #include <map> 00036 00056 class AbstractOdeSystemInformation 00057 { 00058 friend class TestAbstractOdeSystem; 00059 00060 protected: 00062 std::string mSystemName; 00063 00065 std::vector<std::string> mVariableNames; 00066 00068 std::vector<std::string> mVariableUnits; 00069 00071 std::vector<std::string> mParameterNames; 00072 00074 std::vector<std::string> mParameterUnits; 00075 00077 std::vector<std::string> mDerivedQuantityNames; 00078 00080 std::vector<std::string> mDerivedQuantityUnits; 00081 00083 std::map<std::string, double> mAttributes; 00084 00086 std::vector<double> mInitialConditions; 00087 00089 bool mInitialised; 00090 00096 virtual void Initialise()=0; 00097 00098 public: 00099 00103 AbstractOdeSystemInformation(); 00104 00108 virtual ~AbstractOdeSystemInformation(); 00109 00113 std::string GetSystemName() const; 00114 00121 void SetDefaultInitialConditions(const std::vector<double>& rInitialConditions); 00122 00130 void SetDefaultInitialCondition(unsigned index, double initialCondition); 00131 00135 std::vector<double> GetInitialConditions() const; 00136 00140 const std::vector<std::string>& rGetStateVariableNames() const; 00141 00145 const std::vector<std::string>& rGetStateVariableUnits() const; 00146 00156 unsigned GetStateVariableIndex(const std::string& rName) const; 00157 00166 bool HasStateVariable(const std::string& rName) const; 00167 00175 std::string GetStateVariableUnits(unsigned index) const; 00176 00180 const std::vector<std::string>& rGetParameterNames() const; 00181 00185 const std::vector<std::string>& rGetParameterUnits() const; 00186 00196 unsigned GetParameterIndex(const std::string& rName) const; 00197 00206 bool HasParameter(const std::string& rName) const; 00207 00215 std::string GetParameterUnits(unsigned index) const; 00216 00220 unsigned GetNumberOfParameters() const; 00221 00231 unsigned GetAnyVariableIndex(const std::string& rName) const; 00232 00242 bool HasAnyVariable(const std::string& rName) const; 00243 00251 std::string GetAnyVariableUnits(unsigned index) const; 00252 00256 const std::vector<std::string>& rGetDerivedQuantityNames() const; 00257 00261 const std::vector<std::string>& rGetDerivedQuantityUnits() const; 00262 00268 unsigned GetDerivedQuantityIndex(const std::string& rName) const; 00269 00278 bool HasDerivedQuantity(const std::string& rName) const; 00279 00286 std::string GetDerivedQuantityUnits(unsigned index) const; 00287 00291 unsigned GetNumberOfDerivedQuantities() const; 00292 00293 // 00294 // Attribute methods 00295 // 00296 00300 unsigned GetNumberOfAttributes() const; 00301 00306 bool HasAttribute(const std::string& rName) const; 00307 00312 double GetAttribute(const std::string& rName) const; 00313 00314 }; 00315 00316 00317 #endif /*_ABSTRACTODESYSTEMINFORMATION_HPP_*/