diff --git a/opm/core/io/eclipse/EclipseWriter.cpp b/opm/core/io/eclipse/EclipseWriter.cpp index f7f26141..07e03696 100644 --- a/opm/core/io/eclipse/EclipseWriter.cpp +++ b/opm/core/io/eclipse/EclipseWriter.cpp @@ -1096,9 +1096,21 @@ void EclipseWriter::activeToGlobalCellData_(std::vector &globalCellsBuf, } } -void EclipseWriter::writeSolution_(const SimulatorTimer& timer, - const SimulatorState& reservoirState) +void EclipseWriter::writeTimeStep(const SimulatorTimer& timer, + const SimulatorState& reservoirState, + const WellState& wellState) { + // if we don't want to write anything, this method becomes a + // no-op... + if (!enableOutput_) { + return; + } + + // respected the output_interval parameter + if (outputTimeStepIdx_ % outputInterval_ != 0) { + return; + } + // start writing to files EclipseRestart rst(outputDir_, baseName_, timer, outputTimeStepIdx_); rst.writeHeader (timer, outputTimeStepIdx_, uses_, newParserDeck_, reservoirState.pressure().size ()); @@ -1128,27 +1140,6 @@ void EclipseWriter::writeSolution_(const SimulatorTimer& timer, } } - ++outputTimeStepIdx_; -} - -void EclipseWriter::writeTimeStep(const SimulatorTimer& timer, - const SimulatorState& reservoirState, - const WellState& wellState) -{ - // if we don't want to write anything, this method becomes a - // no-op... - if (!enableOutput_) { - return; - } - - // respected the output_interval parameter - if (timer.currentStepNum() % outputInterval_ != 0) { - return; - } - - /* Field variables (pressure, saturation) */ - writeSolution_(timer, reservoirState); - /* Summary variables (well reporting) */ // TODO: instead of writing the header (smspec) every time, it should // only be written when there is a change in the well configuration diff --git a/opm/core/io/eclipse/EclipseWriter.hpp b/opm/core/io/eclipse/EclipseWriter.hpp index 304d4dc4..b5a2742e 100644 --- a/opm/core/io/eclipse/EclipseWriter.hpp +++ b/opm/core/io/eclipse/EclipseWriter.hpp @@ -105,10 +105,6 @@ private: void activeToGlobalCellData_(std::vector &globalCellsBuf, const std::vector &activeCellsBuf, const std::vector &inactiveCellsBuf) const; - - /// Write solution field variables (pressure and saturation) - void writeSolution_(const SimulatorTimer& timer, - const SimulatorState& reservoirState); }; } // namespace Opm