Merge pull request #5675 from jakobtorben/fix_memory_bug_in_setPrimaryVars_for_msw

Fix memory bug in setPrimaryVars for MSW
This commit is contained in:
Bård Skaflestad 2024-10-16 09:26:06 +02:00 committed by GitHub
commit 98513d92f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2237,7 +2237,7 @@ namespace Opm
constexpr int num_eq = MSWEval::numWellEq;
std::array<Scalar, num_eq> tmp;
for (int ii = 0; ii < num_seg; ++ii) {
const auto start = it + num_seg * num_eq;
const auto start = it + ii * num_eq;
std::copy(start, start + num_eq, tmp.begin());
this->primary_variables_.setValue(ii, tmp);
}