From c52175a200ec0204eef381a3d170a78478ee2251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 27 Aug 2014 21:10:38 +0200 Subject: [PATCH] assignPermeability: Remark on storage order Clients expect column-major (Fortran) ordering of the contiguous "permeability_" array so that's what we create despite "tensor" being row-major. Suggested by: [at] atgeirr --- opm/core/props/rock/RockFromDeck.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/opm/core/props/rock/RockFromDeck.cpp b/opm/core/props/rock/RockFromDeck.cpp index 50e6982a2..2466be804 100644 --- a/opm/core/props/rock/RockFromDeck.cpp +++ b/opm/core/props/rock/RockFromDeck.cpp @@ -118,7 +118,13 @@ namespace Opm for (int i = 0; i < dim; ++i) { for (int j = 0; j < dim; ++j, ++kix) { - // K(i,j) = (*tensor[kmap[kix]])[glob]; + // Clients expect column-major (Fortran) order + // in "permeability_" so honour that + // requirement despite "tensor" being created + // row-major. Note: The actual numerical + // values in the resulting array are the same + // in either order when viewed contiguously + // because fillTensor() enforces symmetry. permeability_[off + (i + dim*j)] = (*tensor[kmap[kix]])[glob]; }