/
GlobalSettings.cpp
203 lines (167 loc) · 3.51 KB
/
GlobalSettings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/** @addtogroup coreSimulationSettings
*
* @{
*/
#include <Core/ModelicaDefine.h>
#include <Core/Modelica.h>
//#define BOOST_EXTENSION_GLOBALSETTINGS_DECL BOOST_EXTENSION_EXPORT_DECL
#include <Core/SimulationSettings/GlobalSettings.h>
GlobalSettings::GlobalSettings()
: _startTime(0.0)
, _endTime(5.0)
, _hOutput(0.001)
, _resultsOutput(true)
, _infoOutput(true)
, _selected_solver("Euler")
, _selected_lin_solver("Newton")
, _selected_nonlin_solver("Newton")
, _resultsfile_name("results.csv")
, _endless_sim(false)
, _outputFormat(OM_EMPTY)
, _outputPointType(OM_ALL)
, _alarm_time(0)
{
}
GlobalSettings::~GlobalSettings()
{
}
///< Start time of integration (default: 0.0)
double GlobalSettings::getStartTime()
{
return _startTime;
}
void GlobalSettings::setStartTime(double time)
{
_startTime = time;
}
///< End time of integraiton (default: 1.0)
double GlobalSettings::getEndTime()
{
return _endTime;
}
void GlobalSettings::setEndTime(double time)
{
_endTime = time;
}
///< Output step size (default: 20 ms)
double GlobalSettings::gethOutput()
{
return _hOutput;
}
void GlobalSettings::sethOutput(double h)
{
_hOutput = h;
}
bool GlobalSettings::useEndlessSim()
{
return _endless_sim ;
}
void GlobalSettings::useEndlessSim(bool endles)
{
_endless_sim = endles;
}
OutputFormat GlobalSettings::getOutputFormat()
{
return _outputFormat;
}
void GlobalSettings::setOutputFormat(OutputFormat format)
{
_outputFormat = format;
}
OutputPointType GlobalSettings::getOutputPointType()
{
return _outputPointType;
}
void GlobalSettings::setOutputPointType(OutputPointType type)
{
_outputPointType = type;
}
LogSettings GlobalSettings::getLogSettings()
{
return _log_settings;
}
void GlobalSettings::setLogSettings(LogSettings set)
{
_log_settings = set;
}
///< Write out results ([false,true]; default: true)
bool GlobalSettings::getResultsOutput()
{
return _resultsOutput;
}
void GlobalSettings::setResultsOutput(bool output)
{
_resultsOutput = output;
}
void GlobalSettings::setResultsFileName(string name)
{
_resultsfile_name = name;
}
string GlobalSettings::getResultsFileName()
{
return _resultsfile_name;
}
///< Write out statistical simulation infos, e.g. number of steps (at the end of simulation); [false,true]; default: true)
bool GlobalSettings::getInfoOutput()
{
return _infoOutput;
}
void GlobalSettings::setInfoOutput(bool output)
{
_infoOutput = output;
}
string GlobalSettings::getOutputPath()
{
return _output_path ;
}
void GlobalSettings::setOutputPath(string path)
{
_output_path = path;
}
string GlobalSettings::getSelectedSolver()
{
return _selected_solver;
}
void GlobalSettings::setSelectedSolver(string solver)
{
_selected_solver = solver;
}
string GlobalSettings::getSelectedLinSolver()
{
return _selected_lin_solver;
}
void GlobalSettings::setSelectedLinSolver(string solver)
{
_selected_lin_solver = solver;
}
string GlobalSettings::getSelectedNonLinSolver()
{
return _selected_nonlin_solver;
}
void GlobalSettings::setSelectedNonLinSolver(string solver)
{
_selected_nonlin_solver = solver;
}
/**
initializes settings object by an xml file
*/
void GlobalSettings::load(std::string xml_file)
{
}
void GlobalSettings::setRuntimeLibrarypath(string path)
{
_runtimeLibraryPath = path;
}
string GlobalSettings::getRuntimeLibrarypath()
{
return _runtimeLibraryPath;
}
void GlobalSettings::setAlarmTime(unsigned int t)
{
_alarm_time = t;
}
unsigned int GlobalSettings::getAlarmTime()
{
return _alarm_time;
}
/** @} */ // end of coreSimulationSettings