output writers: remove the state parameters from writeInit()

because as discussed with Atgeirr, this function should no longer
write the initial solution, it also does no longer need to know the
initial simulator state...
This commit is contained in:
Andreas Lauser
2014-04-02 16:38:53 +02:00
parent a02f315ace
commit 3ce9d6b3b1
5 changed files with 22 additions and 28 deletions

View File

@@ -25,11 +25,9 @@ struct MultiWriter : public OutputWriter {
MultiWriter (ptr_t writers) : writers_ (std::move (writers)) { } MultiWriter (ptr_t writers) : writers_ (std::move (writers)) { }
/// Forward the call to all writers /// Forward the call to all writers
virtual void writeInit(const SimulatorTimer &timer, virtual void writeInit(const SimulatorTimer &timer) {
const SimulatorState& reservoirState,
const WellState& wellState) {
for (it_t it = writers_->begin (); it != writers_->end (); ++it) { for (it_t it = writers_->begin (); it != writers_->end (); ++it) {
(*it)->writeInit (timer, reservoirState, wellState); (*it)->writeInit (timer);
} }
} }

View File

@@ -67,15 +67,12 @@ public:
virtual ~OutputWriter () { } virtual ~OutputWriter () { }
/** /**
* Write the static eclipse data (grid, PVT curves, etc) as well as the * Write the static data (grid, PVT curves, etc) to disk.
* initial state to disk.
* *
* This routine should be called before the first timestep (i.e. when * This routine should be called before the first timestep (i.e. when
* timer.currentStepNum () == 0) * timer.currentStepNum () == 0)
*/ */
virtual void writeInit(const SimulatorTimer &timer, virtual void writeInit(const SimulatorTimer &timer) = 0;
const SimulatorState& reservoirState,
const WellState& wellState) = 0;
/*! /*!
* \brief Write a blackoil reservoir state to disk for later inspection with * \brief Write a blackoil reservoir state to disk for later inspection with
@@ -88,8 +85,8 @@ public:
* i.e. timer.currentStepNum () > 0. * i.e. timer.currentStepNum () > 0.
*/ */
virtual void writeTimeStep(const SimulatorTimer& timer, virtual void writeTimeStep(const SimulatorTimer& timer,
const SimulatorState& reservoirState, const SimulatorState& reservoirState,
const WellState& wellState) = 0; const WellState& wellState) = 0;
/*! /*!
* Create a suitable set of output formats based on configuration. * Create a suitable set of output formats based on configuration.

View File

@@ -1035,9 +1035,7 @@ EclipseSummary::addWells (Opm::DeckConstPtr newParserDeck,
namespace Opm { namespace Opm {
void EclipseWriter::writeInit(const SimulatorTimer &timer, void EclipseWriter::writeInit(const SimulatorTimer &timer)
const SimulatorState& reservoirState,
const WellState& wellState)
{ {
// if we don't want to write anything, this method becomes a // if we don't want to write anything, this method becomes a
// no-op... // no-op...
@@ -1076,9 +1074,6 @@ void EclipseWriter::writeInit(const SimulatorTimer &timer,
fortio.writeKeyword ("PERMZ", data); fortio.writeKeyword ("PERMZ", data);
} }
/* Initial solution (pressure and saturation) */
writeSolution_(timer, reservoirState);
/* Create summary object (could not do it at construction time, /* Create summary object (could not do it at construction time,
since it requires knowledge of the start time). */ since it requires knowledge of the start time). */
summary_.reset(new EclipseSummary(outputDir_, baseName_, timer, newParserDeck_)); summary_.reset(new EclipseSummary(outputDir_, baseName_, timer, newParserDeck_));
@@ -1169,14 +1164,14 @@ void EclipseWriter::writeTimeStep(const SimulatorTimer& timer,
// will contain data from the whole simulation, instead of just // will contain data from the whole simulation, instead of just
// the last step. // the last step.
summary_->writeTimeStep(timer, wellState); summary_->writeTimeStep(timer, wellState);
++outputTimeStepIdx_;
} }
#else #else
namespace Opm { namespace Opm {
void EclipseWriter::writeInit(const SimulatorTimer&, void EclipseWriter::writeInit(const SimulatorTimer&)
const SimulatorState&,
const WellState&)
{ {
// if we don't want to write anything, this method becomes a // if we don't want to write anything, this method becomes a
// no-op... // no-op...

View File

@@ -69,16 +69,20 @@ public:
virtual ~EclipseWriter (); virtual ~EclipseWriter ();
/** /**
* Write the static eclipse data (grid, PVT curves, etc) as well as the * Write the static eclipse data (grid, PVT curves, etc) to disk.
* initial state to disk.
*/ */
virtual void writeInit(const SimulatorTimer &timer, virtual void writeInit(const SimulatorTimer &timer);
const SimulatorState& reservoirState,
const WellState& wellState);
/*! /*!
* \brief Write a blackoil reservoir state to disk for later inspection with * \brief Write a reservoir state and summary information to disk.
* visualization tools like ResInsight *
*
* The reservoir state can be inspected with visualization tools like
* ResInsight.
*
* The summary information can then be visualized using tools from
* ERT or ECLIPSE. Note that calling this method is only
* meaningful after the first time step has been completed.
* *
* \param[in] reservoirState The thermodynamic state of the reservoir * \param[in] reservoirState The thermodynamic state of the reservoir
* \param[in] wellState The production/injection data for all wells * \param[in] wellState The production/injection data for all wells

View File

@@ -53,7 +53,7 @@ SimulatorOutputBase::SimulatorOutputBase (
, next_ (0) { , next_ (0) {
// write the static initialization files, even before simulation starts // write the static initialization files, even before simulation starts
writer_->writeInit (*timer, *state, *wellState); writer_->writeInit (*timer);
} }
// default destructor is OK, just need to be defined // default destructor is OK, just need to be defined