diff --git a/ebos/eclwriter.hh b/ebos/eclwriter.hh index 3b566854d..0e5cc9c7e 100644 --- a/ebos/eclwriter.hh +++ b/ebos/eclwriter.hh @@ -478,7 +478,10 @@ public: void endRestart() {} - EclOutputBlackOilModule& eclOutputModule() const + const EclOutputBlackOilModule& eclOutputModule() const + { return *eclOutputModule_; } + + EclOutputBlackOilModule& mutableEclOutputModule() const { return *eclOutputModule_; } Scalar restartTimeStepSize() const @@ -515,8 +518,11 @@ private: void prepareLocalCellData(const bool isSubStep, const int reportStepNum) { - if( !(eclOutputModule_->localDataValid()) ){ OPM_TIMEBLOCK(prepareLocalCellData); + if (eclOutputModule_->localDataValid()) { + return; + } + const auto& gridView = simulator_.vanguard().gridView(); const int numElements = gridView.size(/*codim=*/0); const bool log = this->collectToIORank_.isIORank(); @@ -546,7 +552,6 @@ private: } eclOutputModule_->validateLocalData(); OPM_END_PARALLEL_TRY_CATCH("EclWriter::prepareLocalCellData() failed: ", simulator_.vanguard().grid().comm()); - } } void captureLocalFluxData() diff --git a/opm/simulators/flow/BlackoilModelEbos.hpp b/opm/simulators/flow/BlackoilModelEbos.hpp index 2b9179fdc..451c189fa 100644 --- a/opm/simulators/flow/BlackoilModelEbos.hpp +++ b/opm/simulators/flow/BlackoilModelEbos.hpp @@ -647,7 +647,7 @@ namespace Opm { { OPM_TIMEBLOCK(invalidateAndUpdateIntensiveQuantities); ebosSimulator_.model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0); - ebosSimulator_.problem().eclWriter()->eclOutputModule().invalidateLocalData(); + ebosSimulator_.problem().eclWriter()->mutableEclOutputModule().invalidateLocalData(); } }