Chaste  Release::2017.1
AbstractUntemplatedParameterisedSystem.cpp
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 #include "AbstractUntemplatedParameterisedSystem.hpp"
37 
38 
39 #include "Exception.hpp"
41 
42 
44  : mNumberOfStateVariables(numberOfStateVariables)
45 {
46 }
47 
49 {
50 }
51 
52 boost::shared_ptr<const AbstractOdeSystemInformation> AbstractUntemplatedParameterisedSystem::GetSystemInformation() const
53 {
54  assert(mpSystemInfo);
55  return mpSystemInfo;
56 }
57 
58 
60 {
61  return GetSystemInformation()->GetSystemName();
62 }
63 
64 //
65 // State variable methods
66 //
67 
69 {
71 }
72 
74 {
75  return GetSystemInformation()->rGetStateVariableNames();
76 }
77 
79 {
80  return GetSystemInformation()->rGetStateVariableUnits();
81 }
82 
83 unsigned AbstractUntemplatedParameterisedSystem::GetStateVariableIndex(const std::string& rName) const
84 {
85  return GetSystemInformation()->GetStateVariableIndex(rName);
86 }
87 
89 {
90  return GetSystemInformation()->HasStateVariable(rName);
91 }
92 
94 {
95  return GetSystemInformation()->GetStateVariableUnits(index);
96 }
97 
98 //
99 // Parameter methods
100 //
101 
103 {
104  return GetSystemInformation()->rGetParameterNames().size();
105 }
106 
107 const std::vector<std::string>& AbstractUntemplatedParameterisedSystem::rGetParameterNames() const
108 {
109  return GetSystemInformation()->rGetParameterNames();
110 }
111 
112 const std::vector<std::string>& AbstractUntemplatedParameterisedSystem::rGetParameterUnits() const
113 {
114  return GetSystemInformation()->rGetParameterUnits();
115 }
116 
117 unsigned AbstractUntemplatedParameterisedSystem::GetParameterIndex(const std::string& rName) const
118 {
119  return GetSystemInformation()->GetParameterIndex(rName);
120 }
121 
122 bool AbstractUntemplatedParameterisedSystem::HasParameter(const std::string& rName) const
123 {
124  return GetSystemInformation()->HasParameter(rName);
125 }
126 
128 {
129  return GetSystemInformation()->GetParameterUnits(index);
130 }
131 
132 //
133 // "Any variable" methods
134 //
135 
136 unsigned AbstractUntemplatedParameterisedSystem::GetAnyVariableIndex(const std::string& rName) const
137 {
138  return GetSystemInformation()->GetAnyVariableIndex(rName);
139 }
140 
141 bool AbstractUntemplatedParameterisedSystem::HasAnyVariable(const std::string& rName) const
142 {
143  return GetSystemInformation()->HasAnyVariable(rName);
144 }
145 
147 {
148  return GetSystemInformation()->GetAnyVariableUnits(index);
149 }
150 
151 std::string AbstractUntemplatedParameterisedSystem::GetAnyVariableUnits(const std::string& rName) const
152 {
154 }
155 
156 //
157 // "Derived quantities" methods
158 //
159 
161 {
162  return GetSystemInformation()->rGetDerivedQuantityNames().size();
163 }
164 
166 {
167  return GetSystemInformation()->rGetDerivedQuantityNames();
168 }
169 
171 {
172  return GetSystemInformation()->rGetDerivedQuantityUnits();
173 }
174 
176 {
177  return GetSystemInformation()->GetDerivedQuantityIndex(rName);
178 }
179 
181 {
182  return GetSystemInformation()->HasDerivedQuantity(rName);
183 }
184 
186 {
187  return GetSystemInformation()->GetDerivedQuantityUnits(index);
188 }
189 
190 
192 {
193  return GetSystemInformation()->GetNumberOfAttributes();
194 }
195 
196 bool AbstractUntemplatedParameterisedSystem::HasAttribute(const std::string& rName) const
197 {
198  return GetSystemInformation()->HasAttribute(rName);
199 }
200 
201 double AbstractUntemplatedParameterisedSystem::GetAttribute(const std::string& rName) const
202 {
203  return GetSystemInformation()->GetAttribute(rName);
204 }
const std::vector< std::string > & rGetStateVariableUnits() const
AbstractUntemplatedParameterisedSystem(unsigned numberOfStateVariables)
const std::vector< std::string > & rGetParameterUnits() const
const std::vector< std::string > & rGetStateVariableNames() const
unsigned GetParameterIndex(const std::string &rName) const
unsigned GetAnyVariableIndex(const std::string &rName) const
unsigned GetStateVariableIndex(const std::string &rName) const
boost::shared_ptr< const AbstractOdeSystemInformation > GetSystemInformation() const
const std::vector< std::string > & rGetDerivedQuantityUnits() const
boost::shared_ptr< AbstractOdeSystemInformation > mpSystemInfo
const std::vector< std::string > & rGetDerivedQuantityNames() const
const std::vector< std::string > & rGetParameterNames() const
unsigned GetDerivedQuantityIndex(const std::string &rName) const