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

Commit 9550148

Browse files
qichenghuaOpenModelica-Hudson
authored andcommitted
fixed bad cast error when homotopy solver within Nox is used.
1 parent d633a30 commit 9550148

File tree

1 file changed

+9
-2
lines changed
  • SimulationRuntime/cpp/Solver/Nox

1 file changed

+9
-2
lines changed

SimulationRuntime/cpp/Solver/Nox/Nox.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void Nox::initialize()
9494
_statusTestsCombo = Teuchos::rcp(new NOX::StatusTest::Combo(NOX::StatusTest::Combo::OR, _statusTestNormF, _statusTestMaxIters));
9595
_statusTestsCombo->addStatusTest(_statusTestStagnation);
9696
_statusTestsCombo->addStatusTest(_statusTestDivergence);
97-
_statusTestsCombo->addStatusTest(_statusTestSgnChange);
97+
//_statusTestsCombo->addStatusTest(_statusTestSgnChange);
9898

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

116-
if (_firstCall) initialize();
116+
if (_firstCall){
117+
initialize();
118+
_statusTestsCombo->addStatusTest(_statusTestSgnChange);
119+
}
117120

118121

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

364+
_statusTestsCombo = Teuchos::rcp(new NOX::StatusTest::Combo(NOX::StatusTest::Combo::OR, _statusTestNormF, _statusTestMaxIters));
365+
_statusTestsCombo->addStatusTest(_statusTestStagnation);
366+
_statusTestsCombo->addStatusTest(_statusTestDivergence);
367+
361368
if(_generateoutput) std::cout << "We are going to solve algloop " << _algLoop->getEquationIndex() << std::endl;
362369

363370
// Reset initial guess

0 commit comments

Comments
 (0)