Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
AbstractUntemplatedParameterisedSystem.cpp
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#include "AbstractUntemplatedParameterisedSystem.hpp"
37
38
39#include "Exception.hpp"
41
42
44 : mNumberOfStateVariables(numberOfStateVariables)
45{
46}
47
51
52boost::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
72
74{
75 return GetSystemInformation()->rGetStateVariableNames();
76}
77
79{
80 return GetSystemInformation()->rGetStateVariableUnits();
81}
82
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
108{
109 return GetSystemInformation()->rGetParameterNames();
110}
111
113{
114 return GetSystemInformation()->rGetParameterUnits();
115}
116
117unsigned AbstractUntemplatedParameterisedSystem::GetParameterIndex(const std::string& rName) const
118{
119 return GetSystemInformation()->GetParameterIndex(rName);
120}
121
123{
124 return GetSystemInformation()->HasParameter(rName);
125}
126
128{
129 return GetSystemInformation()->GetParameterUnits(index);
130}
131
132//
133// "Any variable" methods
134//
135
137{
138 return GetSystemInformation()->GetAnyVariableIndex(rName);
139}
140
142{
143 return GetSystemInformation()->HasAnyVariable(rName);
144}
145
147{
148 return GetSystemInformation()->GetAnyVariableUnits(index);
149}
150
151std::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
197{
198 return GetSystemInformation()->HasAttribute(rName);
199}
200
201double AbstractUntemplatedParameterisedSystem::GetAttribute(const std::string& rName) const
202{
203 return GetSystemInformation()->GetAttribute(rName);
204}
const std::vector< std::string > & rGetDerivedQuantityNames() const
const std::vector< std::string > & rGetParameterNames() const
boost::shared_ptr< const AbstractOdeSystemInformation > GetSystemInformation() const
boost::shared_ptr< AbstractOdeSystemInformation > mpSystemInfo
unsigned GetDerivedQuantityIndex(const std::string &rName) const
const std::vector< std::string > & rGetStateVariableNames() const
unsigned GetStateVariableIndex(const std::string &rName) const
const std::vector< std::string > & rGetStateVariableUnits() const
unsigned GetAnyVariableIndex(const std::string &rName) const
unsigned GetParameterIndex(const std::string &rName) const
const std::vector< std::string > & rGetDerivedQuantityUnits() const
AbstractUntemplatedParameterisedSystem(unsigned numberOfStateVariables)
const std::vector< std::string > & rGetParameterUnits() const