drop useages of std::numeric_limits for counting well iterations.

This commit is contained in:
Liu Ming 2016-07-14 10:25:32 +08:00
parent 6af9aee20f
commit b43cbe0531
5 changed files with 7 additions and 15 deletions

View File

@ -775,7 +775,7 @@ namespace detail {
asImpl().assembleMassBalanceEq(state);
// -------- Well equations ----------
IterationReport iter_report = {false, false, 0, std::numeric_limits<int>::min()};
IterationReport iter_report = {false, false, 0, 0};
if ( ! wellsActive() ) {
return iter_report;
}

View File

@ -182,7 +182,7 @@ namespace Opm {
asImpl().assembleMassBalanceEq(state);
// -------- Well equations ----------
IterationReport iter_report = {false, false, 0, std::numeric_limits<int>::min()};
IterationReport iter_report = {false, false, 0, 0};
if ( ! wellsActive() ) {
return iter_report;
}

View File

@ -124,7 +124,7 @@ namespace Opm {
asImpl().assembleMassBalanceEq(state);
// -------- Well equations ----------
IterationReport iter_report = {false, false, 0, std::numeric_limits<int>::min()};
IterationReport iter_report = {false, false, 0, 0};
if ( ! wellsActive() ) {
return iter_report;
}

View File

@ -137,9 +137,7 @@ namespace Opm
}
converged = report.converged;
linIters += report.linear_iterations;
if (report.well_iterations != std::numeric_limits<int>::min()) {
wellIters += report.well_iterations;
}
wellIters += report.well_iterations;
++iteration;
} while ( (!converged && (iteration <= maxIter())) || (iteration <= minIter()));
@ -152,14 +150,8 @@ namespace Opm
linearIterations_ += linIters;
nonlinearIterations_ += iteration - 1; // Since the last one will always be trivial.
if (wellIters != 0) {
wellIterations_ += wellIters;
wellIterationsLast_ = wellIters;
}
if (wellIters == 0) {
wellIterations_ = std::numeric_limits<int>::min();
wellIterationsLast_ = std::numeric_limits<int>::min();
}
wellIterations_ = wellIters;
wellIterationsLast_ = wellIters;
linearIterationsLast_ = linIters;
nonlinearIterationsLast_ = iteration;

View File

@ -213,7 +213,7 @@ namespace Opm
{
std::ostringstream iter_msg;
iter_msg << "Stepsize " << (double)unit::convert::to(timer.currentStepLength(), unit::day);
if (solver->wellIterations() != std::numeric_limits<int>::min()) {
if (solver->wellIterations() != 0) {
iter_msg << " days well iterations = " << solver->wellIterations() << ", ";
}
iter_msg << "non-linear iterations = " << solver->nonlinearIterations()