Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
AbstractOdeSystemInformation.hpp
1/*
2
3Copyright (c) 2005-2024, University of Oxford.
4All rights reserved.
5
6University of Oxford means the Chancellor, Masters and Scholars of the
7University of Oxford, having an administrative office at Wellington
8Square, Oxford OX1 2JD, UK.
9
10This file is part of Chaste.
11
12Redistribution and use in source and binary forms, with or without
13modification, 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
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32OF 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
66protected:
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
110public:
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_*/
const std::vector< std::string > & rGetDerivedQuantityNames() const
std::string GetDerivedQuantityUnits(unsigned index) const
unsigned GetParameterIndex(const std::string &rName) const
std::string GetParameterUnits(unsigned index) const
bool HasStateVariable(const std::string &rName) const
bool HasParameter(const std::string &rName) const
std::vector< std::string > mDerivedQuantityUnits
std::string GetAnyVariableUnits(unsigned index) const
void SetDefaultInitialConditions(const std::vector< double > &rInitialConditions)
const std::vector< std::string > & rGetStateVariableNames() const
std::vector< double > GetInitialConditions() const
virtual void Initialise()=0
const std::vector< std::string > & rGetStateVariableUnits() const
std::map< std::string, double > mAttributes
const std::vector< std::string > & rGetParameterUnits() const
double GetAttribute(const std::string &rName) const
std::vector< std::string > mDerivedQuantityNames
bool HasAnyVariable(const std::string &rName) const
const std::vector< std::string > & rGetDerivedQuantityUnits() const
const std::vector< std::string > & rGetParameterNames() const
std::string GetStateVariableUnits(unsigned index) const
unsigned GetStateVariableIndex(const std::string &rName) const
void SetDefaultInitialCondition(unsigned index, double initialCondition)
bool HasDerivedQuantity(const std::string &rName) const
unsigned GetAnyVariableIndex(const std::string &rName) const
unsigned GetDerivedQuantityIndex(const std::string &rName) const
bool HasAttribute(const std::string &rName) const