fixed the tolerance also in RegulaFalsiBisection

This commit is contained in:
hnil 2020-05-10 22:47:37 +02:00
parent ded8ef1a66
commit 47df32ef1a

View File

@ -43,7 +43,7 @@ namespace Opm
{
OPM_THROW(std::runtime_error, "Maximum number of iterations exceeded: " << maxiter << "\n"
<< "Current interval is [" << std::min(x0, x1) << ", "
<< std::max(x0, x1) << "]");
<< std::max(x0, x1) << "] abs(x0-x1) " << std::abs(x0-x1));
return -1e100; // Never reached.
}
};
@ -64,7 +64,7 @@ namespace Opm
OPM_REPORT;
std::cerr << "Maximum number of iterations exceeded: " << maxiter
<< ", current interval is [" << std::min(x0, x1) << ", "
<< std::max(x0, x1) << "]";
<< std::max(x0, x1) << "] abs(x0-x1) " << std::abs(x0-x1);
return 0.5*(x0 + x1);
}
};
@ -327,7 +327,7 @@ namespace Opm
// and x0 is the last point computed that makes it a bracket.
double width = fabs(x1 - x0);
double contraction = 1.0;
while (width >= 1e-9 * eps) {
while (width >= eps) {
// If we are contracting sufficiently to at least halve
// the interval width in two iterations we use regula
// falsi. Otherwise, we take a bisection step to avoid