From cd4026f6c439601d27fb8f43755b571a616ba102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Fri, 11 May 2012 16:31:05 +0200 Subject: [PATCH] matrix(): Reduce likelihood of reintroducing error fixed in cset 91ad967a15a0. Specifically, rename loop variables i1->row and i2->col to better reflect purpose. --- opm/core/fluid/BlackoilPropertiesFromDeck.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opm/core/fluid/BlackoilPropertiesFromDeck.cpp b/opm/core/fluid/BlackoilPropertiesFromDeck.cpp index a63f6a720..f582d4458 100644 --- a/opm/core/fluid/BlackoilPropertiesFromDeck.cpp +++ b/opm/core/fluid/BlackoilPropertiesFromDeck.cpp @@ -165,9 +165,9 @@ namespace Opm // (2): dA/dp <- -dA/dp*(dB/dp) == -A*(dB/dp) const double* dB = & dB_[i * np]; - for (int i2 = 0; i2 < np; ++i2) { - for (int i1 = 0; i1 < np; ++i1) { - m[i2*np + i1] *= - dB[ i2 ]; // Note sign. + for (int col = 0; col < np; ++col) { + for (int row = 0; row < np; ++row) { + m[col*np + row] *= - dB[ col ]; // Note sign. } } @@ -181,9 +181,9 @@ namespace Opm // (3): dA/dp *= inv(B) (== final result) const double* B = & B_[i * np]; - for (int i2 = 0; i2 < np; ++i2) { - for (int i1 = 0; i1 < np; ++i1) { - m[i2*np + i1] /= B[ i2 ]; + for (int col = 0; col < np; ++col) { + for (int row = 0; row < np; ++row) { + m[col*np + row] /= B[ col ]; } } }