Added error handling to pressure solver.

This commit is contained in:
Kjetil Olsen Lye 2012-05-10 09:55:34 +02:00
parent 0cd6a0a0c6
commit f24d286f18

View File

@ -277,13 +277,18 @@ namespace Opm
F.totmob = &totmob[0]; F.totmob = &totmob[0];
F.wdp = &wdp[0]; F.wdp = &wdp[0];
bool ok = true;
if (rock_comp.empty()) { 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 { } else {
ifs_tpfa_assemble_comprock_increment(gg, &F, &trans_[0], &gpress_omegaweighted_[0], ok = ifs_tpfa_assemble_comprock_increment(gg, &F, &trans_[0], &gpress_omegaweighted_[0],
&porevol[0], &rock_comp[0], dt, &prev_pressure[0], &porevol[0], &rock_comp[0], dt, &prev_pressure[0],
&initial_porevol[0], h_); &initial_porevol[0], h_);
} }
if (!ok) {
THROW("Failed assembling pressure system.");
}
linsolver_.solve(h_->A, h_->b, &pressure_increment[0]); linsolver_.solve(h_->A, h_->b, &pressure_increment[0]);