Skip to content

Commit

Permalink
fixed bad cast error when homotopy solver within Nox is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
qichenghua authored and OpenModelica-Hudson committed Jul 18, 2017
1 parent d633a30 commit 9550148
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions SimulationRuntime/cpp/Solver/Nox/Nox.cpp
Expand Up @@ -94,7 +94,7 @@ void Nox::initialize()
_statusTestsCombo = Teuchos::rcp(new NOX::StatusTest::Combo(NOX::StatusTest::Combo::OR, _statusTestNormF, _statusTestMaxIters));
_statusTestsCombo->addStatusTest(_statusTestStagnation);
_statusTestsCombo->addStatusTest(_statusTestDivergence);
_statusTestsCombo->addStatusTest(_statusTestSgnChange);
//_statusTestsCombo->addStatusTest(_statusTestSgnChange);

if (_generateoutput) std::cout << "ending init" << std::endl;
}
Expand All @@ -113,7 +113,10 @@ void Nox::solve()
_locTol=5.0e-7;
_currentIterateNorm=1.0e2;

if (_firstCall) initialize();
if (_firstCall){
initialize();
_statusTestsCombo->addStatusTest(_statusTestSgnChange);
}


// Create the list of solver parameters. For detailed calibration, check https://trilinos.org/docs/dev/packages/nox/doc/html/parameters.html
Expand Down Expand Up @@ -358,6 +361,10 @@ void Nox::LocaHomotopySolve(const int numberofhomotopytries)
{
if (_firstCall) initialize();

_statusTestsCombo = Teuchos::rcp(new NOX::StatusTest::Combo(NOX::StatusTest::Combo::OR, _statusTestNormF, _statusTestMaxIters));
_statusTestsCombo->addStatusTest(_statusTestStagnation);
_statusTestsCombo->addStatusTest(_statusTestDivergence);

if(_generateoutput) std::cout << "We are going to solve algloop " << _algLoop->getEquationIndex() << std::endl;

// Reset initial guess
Expand Down

0 comments on commit 9550148

Please sign in to comment.