From 58a7589d7de8b9e673479213a3d5d2417516f88d Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Thu, 27 Mar 2014 11:49:41 +0100 Subject: [PATCH] Throw an error when using a sequential solver in parallel --- opm/core/linalg/LinearSolverIstl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opm/core/linalg/LinearSolverIstl.cpp b/opm/core/linalg/LinearSolverIstl.cpp index 5355d05b..fdb6c58a 100644 --- a/opm/core/linalg/LinearSolverIstl.cpp +++ b/opm/core/linalg/LinearSolverIstl.cpp @@ -24,6 +24,7 @@ #include #include +#include // Silence compatibility warning from DUNE headers since we don't use // the deprecated member anyway (in this compilation unit) @@ -50,7 +51,7 @@ #include #include - +#include namespace Opm { @@ -224,6 +225,10 @@ namespace Opm break; case FastAMG: #if defined(HAS_DUNE_FAST_AMG) || DUNE_VERSION_NEWER(DUNE_ISTL, 2, 3) + if(std::is_same >::value) + { + OPM_THROW(std::runtime_error, "Trying to use sequential FastAMG solver for a parallel problem!"); + } res = solveFastAMG(opA, x, b, sp, comm, linsolver_residual_tolerance_, maxit, linsolver_verbosity_, linsolver_prolongate_factor_); #else