diff --git a/opm/simulators/flow/EclWriter.hpp b/opm/simulators/flow/EclWriter.hpp index d49127838..9cea8f0b3 100644 --- a/opm/simulators/flow/EclWriter.hpp +++ b/opm/simulators/flow/EclWriter.hpp @@ -637,7 +637,29 @@ public: } void endRestart() - {} + { + // We need these objects to satisfy the interface requirements of + // member function calc_inplace(), but the objects are otherwise + // unused and intentionally so. + auto miscSummaryData = std::map{}; + auto regionData = std::map>{}; + + // Note: calc_inplace() *also* assigns the output module's + // "initialInplace_" data member. This is, semantically speaking, + // very wrong, as the run's intial volumes then correspond to the + // volumes at the restart time instead of the start of the base run. + // Nevertheless, this is how Flow has "always" done it. + // + // See GenericOutputBlackoilModule::accumulateRegionSums() for + // additional comments. + auto inplace = this->outputModule_ + ->calc_inplace(miscSummaryData, regionData, + this->simulator_.gridView().comm()); + + if (this->collectOnIORank_.isIORank()) { + this->inplace_ = std::move(inplace); + } + } const OutputBlackOilModule& outputModule() const { return *outputModule_; }