std::runtime_error --> LinearSolverProblem when linear solver was not converged.

Since LinearSolverProblem is derived from std::runtime_error everything should work as
before.
This commit is contained in:
Robert Kloefkorn 2015-04-16 11:41:28 +02:00
parent e13ed48e4e
commit 2badc765a6
5 changed files with 12 additions and 7 deletions

View File

@ -44,6 +44,7 @@
#include <opm/core/utility/platform_dependent/reenable_warnings.h>
#include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/Exceptions.hpp>
namespace Opm
{
@ -498,7 +499,7 @@ createEllipticPreconditionerPointer(const M& Ae, double relax,
}
if (!result.converged) {
OPM_THROW(std::runtime_error, "CPRPreconditioner failed to solve elliptic subsystem.");
OPM_THROW(LinearSolverProblem, "CPRPreconditioner failed to solve elliptic subsystem.");
}
}

View File

@ -25,6 +25,7 @@
#include <opm/core/simulator/BlackoilState.hpp>
#include <opm/core/simulator/WellState.hpp>
#include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/Exceptions.hpp>
#include <opm/core/linalg/LinearSolverInterface.hpp>
#include <opm/core/wells.h>
@ -445,7 +446,7 @@ namespace {
matr.outerIndexPtr(), matr.innerIndexPtr(), matr.valuePtr(),
total_residual_.value().data(), dx.data());
if (!rep.converged) {
OPM_THROW(std::runtime_error, "ImpesTPFAAD::solve(): Linear solver convergence failure.");
OPM_THROW(LinearSolverProblem, "ImpesTPFAAD::solve(): Linear solver convergence failure.");
}
const V p0 = Eigen::Map<const V>(&state.pressure()[0], nc, 1);
const V dp = subset(dx, Span(nc));

View File

@ -26,6 +26,7 @@
#include <opm/autodiff/NewtonIterationBlackoilCPR.hpp>
#include <opm/autodiff/AutoDiffHelpers.hpp>
#include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/Exceptions.hpp>
#include <opm/core/utility/Units.hpp>
#include <opm/core/linalg/LinearSolverFactory.hpp>
#include <opm/core/linalg/ParallelIstlInformation.hpp>
@ -208,7 +209,7 @@ namespace Opm
// Check for failure of linear solver.
if (!result.converged) {
OPM_THROW(std::runtime_error, "Convergence failure for linear solver.");
OPM_THROW(LinearSolverProblem, "Convergence failure for linear solver.");
}
// Copy solver output to dx.

View File

@ -22,6 +22,7 @@
#include <opm/autodiff/NewtonIterationBlackoilSimple.hpp>
#include <opm/autodiff/AutoDiffHelpers.hpp>
#include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/Exceptions.hpp>
#include <opm/core/linalg/LinearSolverFactory.hpp>
namespace Opm
@ -67,7 +68,7 @@ namespace Opm
iterations_ = rep.iterations;
if (!rep.converged) {
OPM_THROW(std::runtime_error,
OPM_THROW(LinearSolverProblem,
"FullyImplicitBlackoilSolver::solveJacobianSystem(): "
"Linear solver convergence failure.");
}

View File

@ -25,6 +25,7 @@
#include <opm/core/pressure/tpfa/trans_tpfa.h>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/Exceptions.hpp>
#include <iostream>
@ -236,7 +237,7 @@ namespace Opm
smatr.outerIndexPtr(), smatr.innerIndexPtr(), smatr.valuePtr(),
transport_residual.value().data(), ds.data());
if (!rep.converged) {
OPM_THROW(std::runtime_error, "Linear solver convergence error in TransportSolverTwophaseAd::solve()");
OPM_THROW(LinearSolverProblem, "Linear solver convergence error in TransportSolverTwophaseAd::solve()");
}
// Update (possible clamp) sw1.