From 20cf0eda368929ebb980b74c446ce7409923bcb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Tue, 15 May 2012 14:34:56 +0200 Subject: [PATCH] compute_cell_contrib(): Advance derivative pointer for each connection. Failing to do this operation resulted in incorrect matrices in cases with anisotropic tensors and/or non-cube cells. The error has been present since the inception of this implementation. --- opm/core/pressure/tpfa/cfs_tpfa_residual.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opm/core/pressure/tpfa/cfs_tpfa_residual.c b/opm/core/pressure/tpfa/cfs_tpfa_residual.c index 6bf0c7a5..e1e42c66 100644 --- a/opm/core/pressure/tpfa/cfs_tpfa_residual.c +++ b/opm/core/pressure/tpfa/cfs_tpfa_residual.c @@ -606,6 +606,8 @@ compute_cell_contrib(struct UnstructuredGrid *G , pimpl->ratio->mat_row[ 0 ] += s * dt * dF1; pimpl->ratio->mat_row[ off ] += s * dt * dF2; + + dv += 2 * np; /* '2' == number of one-sided derivatives. */ } } }