-
Notifications
You must be signed in to change notification settings - Fork 298
/
NoxSettings.cpp
74 lines (68 loc) · 1.67 KB
/
NoxSettings.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
#include <Core/ModelicaDefine.h>
#include <Core/Modelica.h>
/** @addtogroup solverNox
*
* @{
*/
//throw everything away and implement new
#include <Solver/Nox/NoxSettings.h>
NoxSettings::NoxSettings()
: _iNewt_max (100)
, _dRtol (1.0e-13)
, _dAtol (1.0e-13)
, _dDelta (0.9)
, _continueOnError(false)
{
};
/*max. Anzahl an Newtonititerationen pro Schritt (default: 25)*/
long int NoxSettings::getNewtMax()
{
return _iNewt_max;
}
void NoxSettings::setNewtMax(long int max)
{
_iNewt_max =max;
}
/* Relative Toleranz für die Newtoniteration (default: 1e-13)*/
double NoxSettings::getRtol()
{
return _dRtol;
}
void NoxSettings::setRtol(double t)
{
_dRtol=t;
}
/*Absolute Toleranz für die Newtoniteration (default: n/a)*/
double NoxSettings::getAtol()
{
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not use absolute tolerances in Nox' nonlinear solver settings.");
return _dAtol;
}
void NoxSettings::setAtol(double t)
{
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not use absolute tolerances in Nox' nonlinear solver settings.");
_dAtol =t;
}
/*Dämpfungsfaktor (default: 0.9)*/
double NoxSettings::getDelta()
{
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not use Delta in Nox' nonlinear solver settings.");
return _dDelta;
}
void NoxSettings::setDelta(double t)
{
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not set Delta in Nox' nonlinear solver settings.");
_dDelta = t;
}
void NoxSettings::load(string)
{
}
void NoxSettings::setContinueOnError(bool value)
{
_continueOnError = value;
}
bool NoxSettings::getContinueOnError()
{
return _continueOnError;
}
/** @} */ // end of solverNox