Fix unused argument warning and wrong behaviour.
The class WarnAndContinueOnError should write warnings irrespective of the status of the OPM_VERBOSE symbol.
This commit is contained in:
@@ -68,16 +68,18 @@ namespace Opm
|
||||
{
|
||||
static double handleBracketingFailure(const double x0, const double x1, const double f0, const double f1)
|
||||
{
|
||||
OPM_MESSAGE("Error in parameters, zero not bracketed: [a, b] = ["
|
||||
<< x0 << ", " << x1 << "] f(a) = " << f0 << " f(b) = " << f1
|
||||
<< "");
|
||||
OPM_REPORT;
|
||||
std::cerr << "Error in parameters, zero not bracketed: [a, b] = ["
|
||||
<< x0 << ", " << x1 << "] f(a) = " << f0 << " f(b) = " << f1
|
||||
<< "";
|
||||
return std::fabs(f0) < std::fabs(f1) ? x0 : x1;
|
||||
}
|
||||
static double handleTooManyIterations(const double x0, const double x1, const int maxiter)
|
||||
{
|
||||
OPM_MESSAGE("Maximum number of iterations exceeded: " << maxiter
|
||||
<< ", current interval is [" << std::min(x0, x1) << ", "
|
||||
<< std::max(x0, x1) << "]");
|
||||
OPM_REPORT;
|
||||
std::cerr << "Maximum number of iterations exceeded: " << maxiter
|
||||
<< ", current interval is [" << std::min(x0, x1) << ", "
|
||||
<< std::max(x0, x1) << "]";
|
||||
return 0.5*(x0 + x1);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user