Chaste  Release::2017.1
AbstractOdeSystemInformation.hpp
1 /*
2 
3 Copyright (c) 2005-2017, University of Oxford.
4 All rights reserved.
5 
6 University of Oxford means the Chancellor, Masters and Scholars of the
7 University of Oxford, having an administrative office at Wellington
8 Square, Oxford OX1 2JD, UK.
9 
10 This file is part of Chaste.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 
37 #ifndef _ABSTRACTODESYSTEMINFORMATION_HPP_
38 #define _ABSTRACTODESYSTEMINFORMATION_HPP_
39 
40 #include <vector>
41 #include <string>
42 #include <map>
43 
63 {
64  friend class TestAbstractOdeSystem;
65 
66 protected:
68  std::string mSystemName;
69 
71  std::string mFreeVariableName;
72 
74  std::string mFreeVariableUnits;
75 
77  std::vector<std::string> mVariableNames;
78 
80  std::vector<std::string> mVariableUnits;
81 
83  std::vector<std::string> mParameterNames;
84 
86  std::vector<std::string> mParameterUnits;
87 
89  std::vector<std::string> mDerivedQuantityNames;
90 
92  std::vector<std::string> mDerivedQuantityUnits;
93 
95  std::map<std::string, double> mAttributes;
96 
98  std::vector<double> mInitialConditions;
99 
102 
108  virtual void Initialise()=0;
109 
110 public:
111 
116 
121 
125  std::string GetSystemName() const;
126 
130  std::string GetFreeVariableName() const;
131 
135  std::string GetFreeVariableUnits() const;
136 
143  void SetDefaultInitialConditions(const std::vector<double>& rInitialConditions);
144 
152  void SetDefaultInitialCondition(unsigned index, double initialCondition);
153 
157  std::vector<double> GetInitialConditions() const;
158 
162  const std::vector<std::string>& rGetStateVariableNames() const;
163 
167  const std::vector<std::string>& rGetStateVariableUnits() const;
168 
178  unsigned GetStateVariableIndex(const std::string& rName) const;
179 
188  bool HasStateVariable(const std::string& rName) const;
189 
197  std::string GetStateVariableUnits(unsigned index) const;
198 
202  const std::vector<std::string>& rGetParameterNames() const;
203 
207  const std::vector<std::string>& rGetParameterUnits() const;
208 
218  unsigned GetParameterIndex(const std::string& rName) const;
219 
228  bool HasParameter(const std::string& rName) const;
229 
237  std::string GetParameterUnits(unsigned index) const;
238 
242  unsigned GetNumberOfParameters() const;
243 
253  unsigned GetAnyVariableIndex(const std::string& rName) const;
254 
264  bool HasAnyVariable(const std::string& rName) const;
265 
273  std::string GetAnyVariableUnits(unsigned index) const;
274 
278  const std::vector<std::string>& rGetDerivedQuantityNames() const;
279 
283  const std::vector<std::string>& rGetDerivedQuantityUnits() const;
284 
290  unsigned GetDerivedQuantityIndex(const std::string& rName) const;
291 
300  bool HasDerivedQuantity(const std::string& rName) const;
301 
308  std::string GetDerivedQuantityUnits(unsigned index) const;
309 
313  unsigned GetNumberOfDerivedQuantities() const;
314 
315  //
316  // Attribute methods
317  //
318 
322  unsigned GetNumberOfAttributes() const;
323 
328  bool HasAttribute(const std::string& rName) const;
329 
334  double GetAttribute(const std::string& rName) const;
335 };
336 
337 #endif /*_ABSTRACTODESYSTEMINFORMATION_HPP_*/
std::string GetDerivedQuantityUnits(unsigned index) const
std::vector< std::string > mDerivedQuantityNames
const std::vector< std::string > & rGetStateVariableUnits() const
void SetDefaultInitialConditions(const std::vector< double > &rInitialConditions)
std::vector< std::string > mParameterNames
std::string GetParameterUnits(unsigned index) const
void SetDefaultInitialCondition(unsigned index, double initialCondition)
std::string GetStateVariableUnits(unsigned index) const
std::vector< double > GetInitialConditions() const
const std::vector< std::string > & rGetParameterNames() const
std::string GetAnyVariableUnits(unsigned index) const
unsigned GetStateVariableIndex(const std::string &rName) const
const std::vector< std::string > & rGetParameterUnits() const
std::vector< std::string > mVariableNames
std::vector< std::string > mParameterUnits
unsigned GetAnyVariableIndex(const std::string &rName) const
virtual void Initialise()=0
bool HasAnyVariable(const std::string &rName) const
std::vector< std::string > mVariableUnits
double GetAttribute(const std::string &rName) const
bool HasAttribute(const std::string &rName) const
std::vector< std::string > mDerivedQuantityUnits
bool HasStateVariable(const std::string &rName) const
unsigned GetDerivedQuantityIndex(const std::string &rName) const
bool HasDerivedQuantity(const std::string &rName) const
unsigned GetParameterIndex(const std::string &rName) const
bool HasParameter(const std::string &rName) const
const std::vector< std::string > & rGetDerivedQuantityUnits() const
const std::vector< std::string > & rGetStateVariableNames() const
std::map< std::string, double > mAttributes
const std::vector< std::string > & rGetDerivedQuantityNames() const