Fix memory bug in setPrimaryVars for MSW

This commit is contained in:
jakobtorben 2024-10-15 16:31:38 +02:00
parent af93859a29
commit e2ac43b76f

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);
}