diff --git a/opm/autodiff/ISTLSolver.hpp b/opm/autodiff/ISTLSolver.hpp index 2948c7054..7f6b98944 100644 --- a/opm/autodiff/ISTLSolver.hpp +++ b/opm/autodiff/ISTLSolver.hpp @@ -155,20 +155,14 @@ namespace Opm const MILU_VARIANT ilu_milu = parameters_.ilu_milu_; if ( parameters_.use_cpr_ ) { - using Matrix = typename MatrixOperator::matrix_type; - using CouplingMetric = Dune::Amg::Diagonal; - using CritBase = Dune::Amg::SymmetricCriterion; - using Criterion = Dune::Amg::CoarsenCriterion; - using AMG = typename ISTLUtility - ::BlackoilAmgSelector< Matrix, Vector, Vector,POrComm, Criterion, pressureIndex >::AMG; - - std::unique_ptr< AMG > amg; - // Construct preconditioner. - Criterion crit(15, 2000); - constructAMGPrecond( linearOperator, parallelInformation_arg, amg, opA, relax, ilu_milu ); - - // Solve. - solve(linearOperator, x, istlb, *sp, *amg, result); + // We should never end up here as this code is + // only part of flow_legacy and if use_cpr_ is + // true for flow_legacy then solver_approach=cpr + // was specified and NewtonIterationBlackoilCPR + // is used as a solve and not ISTLSolver. + OPM_THROW(std::logic_error, + "This code path should bever be exectuded for parameters_.use_cpr_=" + <