if all the phase are stagnate then stagnate will be true.

This commit is contained in:
Liu Ming 2014-10-11 13:46:24 +08:00
parent 5b28b38056
commit b183fdfa6d

View File

@ -1736,6 +1736,7 @@ namespace {
return; return;
} }
stagnate = true;
int oscillatePhase = 0; int oscillatePhase = 0;
const std::vector<double>& F0 = residual_history[it]; const std::vector<double>& F0 = residual_history[it];
const std::vector<double>& F1 = residual_history[it - 1]; const std::vector<double>& F1 = residual_history[it - 1];
@ -1746,7 +1747,9 @@ namespace {
oscillatePhase += (d1 < relaxRelTol) && (relaxRelTol < d2); oscillatePhase += (d1 < relaxRelTol) && (relaxRelTol < d2);
stagnate = ! (std::abs((F1[p] - F2[p]) / F2[p]) > 1.0e-3); // Process is 'stagnate' unless at least one phase
// exhibits significant residual change.
stagnate = (stagnate && !(std::abs((F1[p] - F2[p]) / F2[p]) > 1.0e-3));
} }
oscillate = (oscillatePhase > 1); oscillate = (oscillatePhase > 1);