Fix logic of shouldCreateSolver().

This commit is contained in:
Atgeirr Flø Rasmussen 2020-10-11 22:46:02 +02:00
parent 30a4fe55b0
commit 385880485a

View File

@ -392,15 +392,11 @@ namespace Opm
if (this->parameters_.cpr_reuse_setup_ == 1) {
// Recreate solver on the first iteration of every timestep.
const int newton_iteration = this->simulator_.model().newtonMethod().numIterations();
if (newton_iteration == 0) {
return true;
}
return newton_iteration == 0;
}
if (this->parameters_.cpr_reuse_setup_ == 2) {
// Recreate solver if the last solve used more than 10 iterations.
if (this->iterations() > 10) {
return true;
}
return this->iterations() > 10;
}
// Otherwise, do not recreate solver.