Chaste Release::3.1
AbstractOdeSystemInformation.hpp
00001 /*
00002 
00003 Copyright (c) 2005-2012, University of Oxford.
00004 All rights reserved.
00005 
00006 University of Oxford means the Chancellor, Masters and Scholars of the
00007 University of Oxford, having an administrative office at Wellington
00008 Square, Oxford OX1 2JD, UK.
00009 
00010 This file is part of Chaste.
00011 
00012 Redistribution and use in source and binary forms, with or without
00013 modification, are permitted provided that the following conditions are met:
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019  * Neither the name of the University of Oxford nor the names of its
00020    contributors may be used to endorse or promote products derived from this
00021    software without specific prior written permission.
00022 
00023 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00026 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00027 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00028 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00029 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00030 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00032 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 
00034 */
00035 
00036 
00037 #ifndef _ABSTRACTODESYSTEMINFORMATION_HPP_
00038 #define _ABSTRACTODESYSTEMINFORMATION_HPP_
00039 
00040 #include <vector>
00041 #include <string>
00042 #include <map>
00043 
00062 class AbstractOdeSystemInformation
00063 {
00064     friend class TestAbstractOdeSystem;
00065 
00066 protected:
00068     std::string mSystemName;
00069 
00071     std::string mFreeVariableName;
00072 
00074     std::string mFreeVariableUnits;
00075 
00077     std::vector<std::string> mVariableNames;
00078 
00080     std::vector<std::string> mVariableUnits;
00081 
00083     std::vector<std::string> mParameterNames;
00084 
00086     std::vector<std::string> mParameterUnits;
00087 
00089     std::vector<std::string> mDerivedQuantityNames;
00090 
00092     std::vector<std::string> mDerivedQuantityUnits;
00093 
00095     std::map<std::string, double> mAttributes;
00096 
00098     std::vector<double> mInitialConditions;
00099 
00101     bool mInitialised;
00102 
00108     virtual void Initialise()=0;
00109 
00110 public:
00111 
00115     AbstractOdeSystemInformation();
00116 
00120     virtual ~AbstractOdeSystemInformation();
00121 
00125     std::string GetSystemName() const;
00126 
00130     std::string GetFreeVariableName() const;
00131 
00135     std::string GetFreeVariableUnits() const;
00136 
00143     void SetDefaultInitialConditions(const std::vector<double>& rInitialConditions);
00144 
00152     void SetDefaultInitialCondition(unsigned index, double initialCondition);
00153 
00157     std::vector<double> GetInitialConditions() const;
00158 
00162     const std::vector<std::string>& rGetStateVariableNames() const;
00163 
00167     const std::vector<std::string>& rGetStateVariableUnits() const;
00168 
00178     unsigned GetStateVariableIndex(const std::string& rName) const;
00179 
00188     bool HasStateVariable(const std::string& rName) const;
00189 
00197     std::string GetStateVariableUnits(unsigned index) const;
00198 
00202     const std::vector<std::string>& rGetParameterNames() const;
00203 
00207     const std::vector<std::string>& rGetParameterUnits() const;
00208 
00218     unsigned GetParameterIndex(const std::string& rName) const;
00219 
00228     bool HasParameter(const std::string& rName) const;
00229 
00237     std::string GetParameterUnits(unsigned index) const;
00238 
00242     unsigned GetNumberOfParameters() const;
00243 
00253     unsigned GetAnyVariableIndex(const std::string& rName) const;
00254 
00264     bool HasAnyVariable(const std::string& rName) const;
00265 
00273     std::string GetAnyVariableUnits(unsigned index) const;
00274 
00278     const std::vector<std::string>& rGetDerivedQuantityNames() const;
00279 
00283     const std::vector<std::string>& rGetDerivedQuantityUnits() const;
00284 
00290     unsigned GetDerivedQuantityIndex(const std::string& rName) const;
00291 
00300     bool HasDerivedQuantity(const std::string& rName) const;
00301 
00308     std::string GetDerivedQuantityUnits(unsigned index) const;
00309 
00313     unsigned GetNumberOfDerivedQuantities() const;
00314 
00315     //
00316     // Attribute methods
00317     //
00318 
00322     unsigned GetNumberOfAttributes() const;
00323 
00328     bool HasAttribute(const std::string& rName) const;
00329 
00334     double GetAttribute(const std::string& rName) const;
00335 
00336 };
00337 
00338 
00339 #endif /*_ABSTRACTODESYSTEMINFORMATION_HPP_*/