fixed: out-of-bounds reference with no wells

This commit is contained in:
Arne Morten Kvarving 2024-04-01 21:34:42 +02:00
parent 1d758706df
commit c263ae9b66

View File

@ -863,7 +863,9 @@ void WellState::communicateGroupRates(const Comm& comm)
data[pos++] = 0;
}
}
pos += this->alq_state.pack_data(&data[pos]);
if (!data.empty()) {
pos += this->alq_state.pack_data(&data[pos]);
}
assert(pos == sz);
// Communicate it with a single sum() call.
@ -877,7 +879,9 @@ void WellState::communicateGroupRates(const Comm& comm)
for (auto& value : rates)
value = data[pos++];
}
pos += this->alq_state.unpack_data(&data[pos]);
if (!data.empty()) {
pos += this->alq_state.unpack_data(&data[pos]);
}
assert(pos == sz);
}