Commit 14b9f128 authored by Bernd Flemisch's avatar Bernd Flemisch

[nonlinear] Fix occurrence of uninitialized variables in Newton

The problem was that `newtonConverged` was executed before
`newtonUpdate`, the place where the variables are initialized.
Change the while loop logic such that `newtonConverged` is called
at the end of each loop cycle, particularly after `newtonUpdate`.
parent 7b3c60a0
......@@ -746,7 +746,8 @@ private:
// execute the method as long as the solver thinks
// that we should do another iteration
while (newtonProceed(uCurrentIter, newtonConverged()))
bool converged = false;
while (newtonProceed(uCurrentIter, converged))
{
// notify the solver that we're about to start
// a new timestep
......@@ -818,6 +819,9 @@ private:
assembler_->assembleResidual(uCurrentIter);
convWriter->write(uLastIter, deltaU, assembler_->residual());
}
// detect if the method has converged
converged = newtonConverged();
}
// tell solver we are done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment