mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
b89aa1fa4a
commit
c06e5b7cf8
@ -290,8 +290,7 @@ public:
|
|||||||
|
|
||||||
// No per cell data is written for initial step, but will be
|
// No per cell data is written for initial step, but will be
|
||||||
// for subsequent steps, when we have started simulating
|
// for subsequent steps, when we have started simulating
|
||||||
output_writer_.writeTimeStep( timer, state, well_state, solver->model(),
|
output_writer_.writeTimeStep( timer, state, well_state, solver->model() );
|
||||||
false, -1.0, SimulatorReport(), true);
|
|
||||||
|
|
||||||
report.output_write_time += perfTimer.stop();
|
report.output_write_time += perfTimer.stop();
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,6 @@ namespace Opm
|
|||||||
std::map<std::string, double> miscSummaryData_;
|
std::map<std::string, double> miscSummaryData_;
|
||||||
std::map<std::string, std::vector<double>> extraRestartData_;
|
std::map<std::string, std::vector<double>> extraRestartData_;
|
||||||
const bool substep_;
|
const bool substep_;
|
||||||
const bool writeInitial_;
|
|
||||||
|
|
||||||
explicit WriterCall( BlackoilOutputWriter& writer,
|
explicit WriterCall( BlackoilOutputWriter& writer,
|
||||||
const SimulatorTimerInterface& timer,
|
const SimulatorTimerInterface& timer,
|
||||||
@ -197,7 +196,7 @@ namespace Opm
|
|||||||
const data::Solution& simProps,
|
const data::Solution& simProps,
|
||||||
const std::map<std::string, double>& miscSummaryData,
|
const std::map<std::string, double>& miscSummaryData,
|
||||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||||
bool substep, bool writeInitial)
|
bool substep)
|
||||||
: writer_( writer ),
|
: writer_( writer ),
|
||||||
timer_( timer.clone() ),
|
timer_( timer.clone() ),
|
||||||
state_( state ),
|
state_( state ),
|
||||||
@ -205,8 +204,7 @@ namespace Opm
|
|||||||
simProps_( simProps ),
|
simProps_( simProps ),
|
||||||
miscSummaryData_( miscSummaryData ),
|
miscSummaryData_( miscSummaryData ),
|
||||||
extraRestartData_( extraRestartData ),
|
extraRestartData_( extraRestartData ),
|
||||||
substep_( substep ),
|
substep_( substep )
|
||||||
writeInitial_( writeInitial )
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +212,7 @@ namespace Opm
|
|||||||
void run ()
|
void run ()
|
||||||
{
|
{
|
||||||
// write data
|
// 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 WellStateFullyImplicitBlackoil& localWellState,
|
||||||
const std::map<std::string, double>& miscSummaryData,
|
const std::map<std::string, double>& miscSummaryData,
|
||||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||||
bool substep, bool writeInitial)
|
bool substep)
|
||||||
{
|
{
|
||||||
// VTK output (is parallel if grid is parallel)
|
// VTK output (is parallel if grid is parallel)
|
||||||
if( vtkWriter_ ) {
|
if( vtkWriter_ ) {
|
||||||
@ -289,12 +287,12 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
if( asyncOutput_ ) {
|
if( asyncOutput_ ) {
|
||||||
// dispatch the write call to the extra thread
|
// 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 {
|
else {
|
||||||
// just write the data to disk
|
// just write the data to disk
|
||||||
try {
|
try {
|
||||||
writeTimeStepSerial( timer, state, wellState, cellData, miscSummaryData, extraRestartData, substep, writeInitial );
|
writeTimeStepSerial( timer, state, wellState, cellData, miscSummaryData, extraRestartData, substep );
|
||||||
} catch (std::runtime_error& msg) {
|
} catch (std::runtime_error& msg) {
|
||||||
err = 1;
|
err = 1;
|
||||||
emsg = msg.what();
|
emsg = msg.what();
|
||||||
@ -326,7 +324,7 @@ namespace Opm
|
|||||||
const data::Solution& simProps,
|
const data::Solution& simProps,
|
||||||
const std::map<std::string, double>& miscSummaryData,
|
const std::map<std::string, double>& miscSummaryData,
|
||||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||||
bool substep, bool initialWrite)
|
bool substep)
|
||||||
{
|
{
|
||||||
// Matlab output
|
// Matlab output
|
||||||
if( matlabWriter_ ) {
|
if( matlabWriter_ ) {
|
||||||
@ -340,7 +338,7 @@ namespace Opm
|
|||||||
if (initConfig.restartRequested() && ((initConfig.getRestartStep()) == (timer.currentStepNum()))) {
|
if (initConfig.restartRequested() && ((initConfig.getRestartStep()) == (timer.currentStepNum()))) {
|
||||||
std::cout << "Skipping restart write in start of step " << timer.currentStepNum() << std::endl;
|
std::cout << "Skipping restart write in start of step " << timer.currentStepNum() << std::endl;
|
||||||
} else {
|
} else {
|
||||||
if ( initialWrite )
|
if ( timer.initialStep() )
|
||||||
{
|
{
|
||||||
// Set the initial OIP
|
// Set the initial OIP
|
||||||
eclIO_->overwriteInitialOIP(simProps);
|
eclIO_->overwriteInitialOIP(simProps);
|
||||||
|
@ -232,8 +232,7 @@ namespace Opm
|
|||||||
const Model& physicalModel,
|
const Model& physicalModel,
|
||||||
const bool substep = false,
|
const bool substep = false,
|
||||||
const double nextstep = -1.0,
|
const double nextstep = -1.0,
|
||||||
const SimulatorReport& simulatorReport = SimulatorReport(),
|
const SimulatorReport& simulatorReport = SimulatorReport());
|
||||||
bool initialWrite = false);
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -248,7 +247,7 @@ namespace Opm
|
|||||||
const Opm::WellStateFullyImplicitBlackoil& wellState,
|
const Opm::WellStateFullyImplicitBlackoil& wellState,
|
||||||
const std::map<std::string, double>& miscSummaryData,
|
const std::map<std::string, double>& miscSummaryData,
|
||||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
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
|
* \brief Write a blackoil reservoir state to disk for later inspection with
|
||||||
@ -274,8 +273,7 @@ namespace Opm
|
|||||||
const data::Solution& simProps,
|
const data::Solution& simProps,
|
||||||
const std::map<std::string, double>& miscSummaryData,
|
const std::map<std::string, double>& miscSummaryData,
|
||||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||||
bool substep,
|
bool substep );
|
||||||
bool initialWrite);
|
|
||||||
|
|
||||||
/** \brief return output directory */
|
/** \brief return output directory */
|
||||||
const std::string& outputDirectory() const { return outputDir_; }
|
const std::string& outputDirectory() const { return outputDir_; }
|
||||||
@ -1001,8 +999,7 @@ namespace Opm
|
|||||||
const Model& physicalModel,
|
const Model& physicalModel,
|
||||||
const bool substep,
|
const bool substep,
|
||||||
const double nextstep,
|
const double nextstep,
|
||||||
const SimulatorReport& simulatorReport,
|
const SimulatorReport& simulatorReport)
|
||||||
bool initialWrite)
|
|
||||||
{
|
{
|
||||||
data::Solution localCellData{};
|
data::Solution localCellData{};
|
||||||
const RestartConfig& restartConfig = eclipseState_.getRestartConfig();
|
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
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user