From 049f02e1df8c0b0fe85e022923c92f5906a0860b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Mon, 19 Mar 2012 13:55:21 +0100 Subject: [PATCH] solve(rock_comp): Replace manual index search with csrmatrix_elm_index(). --- opm/core/pressure/IncompTpfa.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/opm/core/pressure/IncompTpfa.cpp b/opm/core/pressure/IncompTpfa.cpp index c1fa94750..d202eea04 100644 --- a/opm/core/pressure/IncompTpfa.cpp +++ b/opm/core/pressure/IncompTpfa.cpp @@ -186,12 +186,7 @@ namespace Opm // The p part goes on the diagonal, the p0 on the rhs. for (int c = 0; c < gg->number_of_cells; ++c) { // Find diagonal - int j = h_->A->ia[c]; - for (; j < h_->A->ia[c+1]; ++j) { - if (h_->A->ja[j] == c) { - break; - } - } + size_t j = csrmatrix_elm_index(c, c, h_->A); h_->A->sa[j] += porevol[c]*rock_comp[c]/dt; h_->b[c] += porevol[c]*rock_comp[c]*pressure[c]/dt; }