Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit e19e1ee

Browse files
Niklas WorschechOpenModelica-Hudson
authored andcommitted
added simple NoxSettings
1 parent 315bbe1 commit e19e1ee

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

SimulationRuntime/cpp/Solver/Nox/Nox.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ void Nox::initialize()
102102

103103

104104
// Set up the status tests
105-
_statusTestNormF = Teuchos::rcp(new NOX::StatusTest::NormF(1.0e-13));
106-
_statusTestMaxIters = Teuchos::rcp(new NOX::StatusTest::MaxIters(100));
105+
_statusTestNormF = Teuchos::rcp(new NOX::StatusTest::NormF(_noxsettings->getRtol()));
106+
_statusTestMaxIters = Teuchos::rcp(new NOX::StatusTest::MaxIters(_noxsettings->getNewtMax()));
107107
_statusTestStagnation = Teuchos::rcp(new NOX::StatusTest::Stagnation(15,0.99));
108108
_statusTestDivergence = Teuchos::rcp(new NOX::StatusTest::Divergence(1.0e13));
109109
//_statusTestSgnChange = Teuchos::rcp(new NOX::StatusTest::SgnChange(5.0e-7));

SimulationRuntime/cpp/Solver/Nox/NoxSettings.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#include <Solver/Nox/NoxSettings.h>
1111

1212
NoxSettings::NoxSettings()
13-
: _iNewt_max (700)
14-
, _dRtol (1e-12)
15-
, _dAtol (1.0)
13+
: _iNewt_max (100)
14+
, _dRtol (1.0e-13)
15+
, _dAtol (1.0e-13)
1616
, _dDelta (0.9)
1717
, _continueOnError(false)
1818
{
@@ -26,7 +26,7 @@ void NoxSettings::setNewtMax(long int max)
2626
{
2727
_iNewt_max =max;
2828
}
29-
/* Relative Toleranz für die Newtoniteration (default: 1e-6)*/
29+
/* Relative Toleranz für die Newtoniteration (default: 1e-13)*/
3030
double NoxSettings::getRtol()
3131
{
3232
return _dRtol;
@@ -35,22 +35,26 @@ void NoxSettings::setRtol(double t)
3535
{
3636
_dRtol=t;
3737
}
38-
/*Absolute Toleranz für die Newtoniteration (default: 1e-6)*/
38+
/*Absolute Toleranz für die Newtoniteration (default: n/a)*/
3939
double NoxSettings::getAtol()
4040
{
41-
return _dAtol;
41+
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not use absolute tolerances in Nox' nonlinear solver settings.");
42+
return _dAtol;
4243
}
4344
void NoxSettings::setAtol(double t)
4445
{
45-
_dAtol =t;
46+
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not use absolute tolerances in Nox' nonlinear solver settings.");
47+
_dAtol =t;
4648
}
4749
/*Dämpfungsfaktor (default: 0.9)*/
4850
double NoxSettings::getDelta()
4951
{
52+
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not use Delta in Nox' nonlinear solver settings.");
5053
return _dDelta;
5154
}
5255
void NoxSettings::setDelta(double t)
5356
{
57+
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not set Delta in Nox' nonlinear solver settings.");
5458
_dDelta = t;
5559
}
5660

0 commit comments

Comments
 (0)