From 076312b28adc3fa3fd3db1ad4883866251fb53f2 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 3 Jul 2018 14:00:26 +0200 Subject: [PATCH] fix the CPR warning this was probably a rebase mistake. thanks to [at]blattms for noticing this. --- opm/autodiff/FlowMainEbos.hpp | 9 +++++++-- opm/autodiff/ISTLSolverEbos.hpp | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/FlowMainEbos.hpp b/opm/autodiff/FlowMainEbos.hpp index 92818230e..5a815bdf4 100755 --- a/opm/autodiff/FlowMainEbos.hpp +++ b/opm/autodiff/FlowMainEbos.hpp @@ -548,12 +548,16 @@ namespace Opm typedef typename BlackoilModelEbos::ISTLSolverType ISTLSolverType; extractParallelGridInformationToISTL(grid(), parallel_information_); - linearSolver_.reset(new ISTLSolverType(parallel_information_)); + auto *tmp = new ISTLSolverType(parallel_information_); + linearSolver_.reset(tmp); // Deactivate selection of CPR via eclipse keyword // as this preconditioner is still considered experimental // and fails miserably for some models. - if (output_cout_) { + if (output_cout_ + && eclState().getSimulationConfig().useCPR() + && !tmp->parameters().use_cpr_) + { std::ostringstream message; message << "Ignoring request for CPRPreconditioner " << "via Eclipse keyword as it is considered " @@ -562,6 +566,7 @@ namespace Opm <<"line parameter."; OpmLog::info(message.str()); } + } /// This is the main function of Flow. diff --git a/opm/autodiff/ISTLSolverEbos.hpp b/opm/autodiff/ISTLSolverEbos.hpp index 37e76e303..22f35b70f 100644 --- a/opm/autodiff/ISTLSolverEbos.hpp +++ b/opm/autodiff/ISTLSolverEbos.hpp @@ -386,6 +386,9 @@ namespace Detail parameters_.template init(); } + const NewtonIterationBlackoilInterleavedParameters& parameters() const + { return parameters_; } + // dummy method that is not implemented for this class SolutionVector computeNewtonIncrement(const LinearisedBlackoilResidual&) const {