Fix compilation issue of flow_legacy without UMFPack.

The problem was only present if UMFPack was not found and therefore
FLOW_SUPPORT_AMG was defined to true. In that case we experienced compile
errors in a source branch that would never be executed. Therefore we remove
the code there and throw an exception.
This commit is contained in:
Markus Blatt 2018-09-21 15:01:08 +02:00
parent 85802932dd
commit 2dd5a3d15c

View File

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