From 3670479a93f0ef5c12451411d054256d907d308a Mon Sep 17 00:00:00 2001 From: Razvan Nane Date: Fri, 8 Nov 2024 11:08:45 +0100 Subject: [PATCH] Fix index bug in gpubridge separate wells --- opm/simulators/wells/MultisegmentWellEquations.cpp | 4 ++-- opm/simulators/wells/StandardWellEquations.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opm/simulators/wells/MultisegmentWellEquations.cpp b/opm/simulators/wells/MultisegmentWellEquations.cpp index 61a39d524..6903f2d46 100644 --- a/opm/simulators/wells/MultisegmentWellEquations.cpp +++ b/opm/simulators/wells/MultisegmentWellEquations.cpp @@ -222,7 +222,7 @@ extract(WellContributions& wellContribs) const Cvals.reserve(BnumBlocks * numEq * numWellEq); for (auto rowC = duneC_.begin(); rowC != duneC_.end(); ++rowC) { for (auto colC = rowC->begin(), endC = rowC->end(); colC != endC; ++colC) { - Ccols.emplace_back(colC.index()); + Ccols.emplace_back(cells_[colC.index()]); for (int i = 0; i < numWellEq; ++i) { for (int j = 0; j < numEq; ++j) { Cvals.emplace_back((*colC)[i][j]); @@ -252,7 +252,7 @@ extract(WellContributions& wellContribs) const for (auto rowB = duneB_.begin(); rowB != duneB_.end(); ++rowB) { int sizeRow = 0; for (auto colB = rowB->begin(), endB = rowB->end(); colB != endB; ++colB) { - Bcols.emplace_back(colB.index()); + Bcols.emplace_back(cells_[colB.index()]); for (int i = 0; i < numWellEq; ++i) { for (int j = 0; j < numEq; ++j) { Bvals.emplace_back((*colB)[i][j]); diff --git a/opm/simulators/wells/StandardWellEquations.cpp b/opm/simulators/wells/StandardWellEquations.cpp index 71b282948..01560e5d5 100644 --- a/opm/simulators/wells/StandardWellEquations.cpp +++ b/opm/simulators/wells/StandardWellEquations.cpp @@ -207,7 +207,7 @@ extract(const int numStaticWellEq, for (auto colC = duneC_[0].begin(), endC = duneC_[0].end(); colC != endC; ++colC ) { - colIndices.emplace_back(colC.index()); + colIndices.emplace_back(cells_[colC.index()]); for (int i = 0; i < numStaticWellEq; ++i) { for (int j = 0; j < numEq; ++j) { nnzValues.emplace_back((*colC)[i][j]); @@ -236,7 +236,7 @@ extract(const int numStaticWellEq, for (auto colB = duneB_[0].begin(), endB = duneB_[0].end(); colB != endB; ++colB ) { - colIndices.emplace_back(colB.index()); + colIndices.emplace_back(cells_[colB.index()]); for (int i = 0; i < numStaticWellEq; ++i) { for (int j = 0; j < numEq; ++j) { nnzValues.emplace_back((*colB)[i][j]);