Commit 8fff13af authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[newton] fix line search

This fixes a bug that resulted from the recent changes to the Newton
convergence measures. Instead of storing the residual, the residual
reduction is stored, but it has been forgotten to initialize this
reduction with 1.0 instead of the initial residual.

This only affected the line search where the current residual/reduction
is compared to the last one.

Reviewed by Alex.



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14895 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent a63948b5
......@@ -302,7 +302,14 @@ public:
void newtonBeginStep()
{
lastShift_ = shift_;
lastReduction_ = reduction_;
if (numSteps_ == 0)
{
lastReduction_ = 1.0;
}
else
{
lastReduction_ = reduction_;
}
}
/*!
......@@ -359,7 +366,6 @@ public:
norm2 = gridView_().comm().sum(norm2);
initialResidual_ = std::sqrt(norm2);
lastReduction_ = initialResidual_;
}
int converged = linearSolver_.solve(A, x, b);
......
Supports Markdown
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