fixed: do not take reference to a temporary

getWellsatEnd returns a temporary vector. it goes out of
scope on the line, thus the reference taken is dangling.
This commit is contained in:
Arne Morten Kvarving 2021-05-26 15:49:27 +02:00
parent d83b06c74b
commit 89443dd6a3

View File

@ -105,9 +105,10 @@ public:
const Schedule& deckSchedule = simulator_.vanguard().schedule();
const auto& summaryState = simulator_.vanguard().summaryState();
// create the wells which intersect with the current process' grid
const auto wellsatEnd = deckSchedule.getWellsatEnd();
for (size_t deckWellIdx = 0; deckWellIdx < deckSchedule.numWells(); ++deckWellIdx)
{
const auto& deckWell = deckSchedule.getWellsatEnd()[deckWellIdx];
const auto& deckWell = wellsatEnd[deckWellIdx];
const std::string& wellName = deckWell.name();
Scalar wellTemperature = 273.15 + 15.56; // [K]
if (deckWell.isInjector())