Removed boolean parameter indicating initial write to writeTimeStep.

Instead we use the timer to determine whether this is the initial write.
This commit is contained in:
Markus Blatt 2017-07-20 12:12:41 +02:00
parent b89aa1fa4a
commit c06e5b7cf8
3 changed files with 14 additions and 20 deletions

View File

@ -290,8 +290,7 @@ public:
// No per cell data is written for initial step, but will be
// for subsequent steps, when we have started simulating
output_writer_.writeTimeStep( timer, state, well_state, solver->model(),
false, -1.0, SimulatorReport(), true);
output_writer_.writeTimeStep( timer, state, well_state, solver->model() );
report.output_write_time += perfTimer.stop();
}

View File

@ -188,7 +188,6 @@ namespace Opm
std::map<std::string, double> miscSummaryData_;
std::map<std::string, std::vector<double>> extraRestartData_;
const bool substep_;
const bool writeInitial_;
explicit WriterCall( BlackoilOutputWriter& writer,
const SimulatorTimerInterface& timer,
@ -197,7 +196,7 @@ namespace Opm
const data::Solution& simProps,
const std::map<std::string, double>& miscSummaryData,
const std::map<std::string, std::vector<double>>& extraRestartData,
bool substep, bool writeInitial)
bool substep)
: writer_( writer ),
timer_( timer.clone() ),
state_( state ),
@ -205,8 +204,7 @@ namespace Opm
simProps_( simProps ),
miscSummaryData_( miscSummaryData ),
extraRestartData_( extraRestartData ),
substep_( substep ),
writeInitial_( writeInitial )
substep_( substep )
{
}
@ -214,7 +212,7 @@ namespace Opm
void run ()
{
// write data
writer_.writeTimeStepSerial( *timer_, state_, wellState_, simProps_, miscSummaryData_, extraRestartData_, substep_, writeInitial_ );
writer_.writeTimeStepSerial( *timer_, state_, wellState_, simProps_, miscSummaryData_, extraRestartData_, substep_ );
}
};
}
@ -254,7 +252,7 @@ namespace Opm
const WellStateFullyImplicitBlackoil& localWellState,
const std::map<std::string, double>& miscSummaryData,
const std::map<std::string, std::vector<double>>& extraRestartData,
bool substep, bool writeInitial)
bool substep)
{
// VTK output (is parallel if grid is parallel)
if( vtkWriter_ ) {
@ -289,12 +287,12 @@ namespace Opm
{
if( asyncOutput_ ) {
// dispatch the write call to the extra thread
asyncOutput_->dispatch( detail::WriterCall( *this, timer, state, wellState, cellData, miscSummaryData, extraRestartData, substep, writeInitial ) );
asyncOutput_->dispatch( detail::WriterCall( *this, timer, state, wellState, cellData, miscSummaryData, extraRestartData, substep ) );
}
else {
// just write the data to disk
try {
writeTimeStepSerial( timer, state, wellState, cellData, miscSummaryData, extraRestartData, substep, writeInitial );
writeTimeStepSerial( timer, state, wellState, cellData, miscSummaryData, extraRestartData, substep );
} catch (std::runtime_error& msg) {
err = 1;
emsg = msg.what();
@ -326,7 +324,7 @@ namespace Opm
const data::Solution& simProps,
const std::map<std::string, double>& miscSummaryData,
const std::map<std::string, std::vector<double>>& extraRestartData,
bool substep, bool initialWrite)
bool substep)
{
// Matlab output
if( matlabWriter_ ) {
@ -340,7 +338,7 @@ namespace Opm
if (initConfig.restartRequested() && ((initConfig.getRestartStep()) == (timer.currentStepNum()))) {
std::cout << "Skipping restart write in start of step " << timer.currentStepNum() << std::endl;
} else {
if ( initialWrite )
if ( timer.initialStep() )
{
// Set the initial OIP
eclIO_->overwriteInitialOIP(simProps);

View File

@ -232,8 +232,7 @@ namespace Opm
const Model& physicalModel,
const bool substep = false,
const double nextstep = -1.0,
const SimulatorReport& simulatorReport = SimulatorReport(),
bool initialWrite = false);
const SimulatorReport& simulatorReport = SimulatorReport());
/*!
@ -248,7 +247,7 @@ namespace Opm
const Opm::WellStateFullyImplicitBlackoil& wellState,
const std::map<std::string, double>& miscSummaryData,
const std::map<std::string, std::vector<double>>& extraRestartData,
bool substep = false, bool initialWrite = false);
bool substep = false );
/*!
* \brief Write a blackoil reservoir state to disk for later inspection with
@ -274,8 +273,7 @@ namespace Opm
const data::Solution& simProps,
const std::map<std::string, double>& miscSummaryData,
const std::map<std::string, std::vector<double>>& extraRestartData,
bool substep,
bool initialWrite);
bool substep );
/** \brief return output directory */
const std::string& outputDirectory() const { return outputDir_; }
@ -1001,8 +999,7 @@ namespace Opm
const Model& physicalModel,
const bool substep,
const double nextstep,
const SimulatorReport& simulatorReport,
bool initialWrite)
const SimulatorReport& simulatorReport)
{
data::Solution localCellData{};
const RestartConfig& restartConfig = eclipseState_.getRestartConfig();
@ -1041,7 +1038,7 @@ namespace Opm
}
}
writeTimeStepWithCellProperties(timer, localState, localCellData, localWellState, miscSummaryData, extraRestartData, substep, initialWrite);
writeTimeStepWithCellProperties(timer, localState, localCellData, localWellState, miscSummaryData, extraRestartData, substep);
}
}
#endif