From b5d474becadc7e7256de6061f1ac9eb63d3a36fb Mon Sep 17 00:00:00 2001 From: Kjetil Olsen Lye Date: Wed, 9 May 2012 11:28:56 +0200 Subject: [PATCH] Added failure checking for solve method. --- opm/core/pressure/IncompTpfa.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/opm/core/pressure/IncompTpfa.cpp b/opm/core/pressure/IncompTpfa.cpp index cd0a07b6b..95973d3ee 100644 --- a/opm/core/pressure/IncompTpfa.cpp +++ b/opm/core/pressure/IncompTpfa.cpp @@ -210,13 +210,16 @@ namespace Opm F.bc = bcs; F.totmob = &totmob[0]; F.wdp = &wdp[0]; - + int ok = true; if (rock_comp.empty()) { - ifs_tpfa_assemble(gg, &F, &trans_[0], &gpress_omegaweighted_[0], h_); + ok = ifs_tpfa_assemble(gg, &F, &trans_[0], &gpress_omegaweighted_[0], h_); } else { - ifs_tpfa_assemble_comprock(gg, &F, &trans_[0], &gpress_omegaweighted_[0], + ok = ifs_tpfa_assemble_comprock(gg, &F, &trans_[0], &gpress_omegaweighted_[0], &porevol[0], &rock_comp[0], dt, &pressure[0], h_); } + if (!ok) { + THROW("Failed assembling pressure system."); + } linsolver_.solve(h_->A, h_->b, h_->x);