Skip to content

Commit

Permalink
added simple NoxSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Worschech authored and OpenModelica-Hudson committed Jul 18, 2017
1 parent 315bbe1 commit e19e1ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Solver/Nox/Nox.cpp
Expand Up @@ -102,8 +102,8 @@ void Nox::initialize()


// Set up the status tests
_statusTestNormF = Teuchos::rcp(new NOX::StatusTest::NormF(1.0e-13));
_statusTestMaxIters = Teuchos::rcp(new NOX::StatusTest::MaxIters(100));
_statusTestNormF = Teuchos::rcp(new NOX::StatusTest::NormF(_noxsettings->getRtol()));
_statusTestMaxIters = Teuchos::rcp(new NOX::StatusTest::MaxIters(_noxsettings->getNewtMax()));
_statusTestStagnation = Teuchos::rcp(new NOX::StatusTest::Stagnation(15,0.99));
_statusTestDivergence = Teuchos::rcp(new NOX::StatusTest::Divergence(1.0e13));
//_statusTestSgnChange = Teuchos::rcp(new NOX::StatusTest::SgnChange(5.0e-7));
Expand Down
18 changes: 11 additions & 7 deletions SimulationRuntime/cpp/Solver/Nox/NoxSettings.cpp
Expand Up @@ -10,9 +10,9 @@
#include <Solver/Nox/NoxSettings.h>

NoxSettings::NoxSettings()
: _iNewt_max (700)
, _dRtol (1e-12)
, _dAtol (1.0)
: _iNewt_max (100)
, _dRtol (1.0e-13)
, _dAtol (1.0e-13)
, _dDelta (0.9)
, _continueOnError(false)
{
Expand All @@ -26,7 +26,7 @@ void NoxSettings::setNewtMax(long int max)
{
_iNewt_max =max;
}
/* Relative Toleranz für die Newtoniteration (default: 1e-6)*/
/* Relative Toleranz für die Newtoniteration (default: 1e-13)*/
double NoxSettings::getRtol()
{
return _dRtol;
Expand All @@ -35,22 +35,26 @@ void NoxSettings::setRtol(double t)
{
_dRtol=t;
}
/*Absolute Toleranz für die Newtoniteration (default: 1e-6)*/
/*Absolute Toleranz für die Newtoniteration (default: n/a)*/
double NoxSettings::getAtol()
{
return _dAtol;
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Do not use absolute tolerances in Nox' nonlinear solver settings.");
return _dAtol;
}
void NoxSettings::setAtol(double t)
{
_dAtol =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;
}

Expand Down

0 comments on commit e19e1ee

Please sign in to comment.