[bugfix] Do not check verbosity when increase omega due to oscillation.

If oscillating then the same measures have to be taken on all
processes. This was not the case before the commit. Instead only
process 0 would have adapted omegas and we have produced wrong
results.

Kudos to Atgeirr for detecting this while reading the code.
This commit is contained in:
Markus Blatt 2015-02-20 15:56:34 +01:00
parent 9517dc08b3
commit 62507b9cf6

View File

@ -296,10 +296,13 @@ namespace detail {
detectNewtonOscillations(residual_norms_history, it, relaxRelTol(), isOscillate, isStagnate);
if (isOscillate && verbosity_) {
if (isOscillate) {
omega -= relaxIncrement();
omega = std::max(omega, relaxMax());
std::cout << " Oscillating behavior detected: Relaxation set to " << omega << std::endl;
if (verbosity_)
{
std::cout << " Oscillating behavior detected: Relaxation set to " << omega << std::endl;
}
}
stablizeNewton(dx, dxOld, omega, relaxtype);