mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3105 from joakim-hove/output-interval
Pass ouput interval overeride to Schedule constructor
This commit is contained in:
commit
46ae5fa577
@ -444,21 +444,20 @@ public:
|
|||||||
parseContext_ = createParseContext();
|
parseContext_ = createParseContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<int> outputInterval;
|
||||||
|
int output_param = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval);
|
||||||
|
if (output_param >= 0)
|
||||||
|
outputInterval = output_param;
|
||||||
|
|
||||||
readDeck(myRank, fileName, deck_, eclState_, eclSchedule_,
|
readDeck(myRank, fileName, deck_, eclState_, eclSchedule_,
|
||||||
eclSummaryConfig_, std::move(errorGuard), python,
|
eclSummaryConfig_, std::move(errorGuard), python,
|
||||||
std::move(parseContext_), /* initFromRestart = */ false,
|
std::move(parseContext_), /* initFromRestart = */ false,
|
||||||
/* checkDeck = */ enableExperiments);
|
/* checkDeck = */ enableExperiments, outputInterval);
|
||||||
|
|
||||||
this->summaryState_ = std::make_unique<Opm::SummaryState>( Opm::TimeService::from_time_t(this->eclSchedule_->getStartTime() ));
|
this->summaryState_ = std::make_unique<Opm::SummaryState>( Opm::TimeService::from_time_t(this->eclSchedule_->getStartTime() ));
|
||||||
this->udqState_ = std::make_unique<Opm::UDQState>( this->eclSchedule_->getUDQConfig(0).params().undefinedValue() );
|
this->udqState_ = std::make_unique<Opm::UDQState>( this->eclSchedule_->getUDQConfig(0).params().undefinedValue() );
|
||||||
this->actionState_ = std::make_unique<Opm::Action::State>() ;
|
this->actionState_ = std::make_unique<Opm::Action::State>() ;
|
||||||
|
|
||||||
// Possibly override IOConfig setting for how often RESTART files should get
|
|
||||||
// written to disk (every N report step)
|
|
||||||
int outputInterval = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval);
|
|
||||||
if (outputInterval >= 0)
|
|
||||||
schedule().rst_override_interval(outputInterval);
|
|
||||||
|
|
||||||
// Initialize parallelWells with all local wells
|
// Initialize parallelWells with all local wells
|
||||||
const auto& schedule_wells = schedule().getWellsatEnd();
|
const auto& schedule_wells = schedule().getWellsatEnd();
|
||||||
parallelWells_.reserve(schedule_wells.size());
|
parallelWells_.reserve(schedule_wells.size());
|
||||||
|
@ -455,9 +455,14 @@ namespace Opm
|
|||||||
OpmLog::info("Reading deck file '" + deckFilename + "'");
|
OpmLog::info("Reading deck file '" + deckFilename + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<int> outputInterval;
|
||||||
|
int output_param = EWOMS_GET_PARAM(PreTypeTag, int, EclOutputInterval);
|
||||||
|
if (output_param >= 0)
|
||||||
|
outputInterval = output_param;
|
||||||
|
|
||||||
readDeck(mpiRank, deckFilename, deck_, eclipseState_, schedule_,
|
readDeck(mpiRank, deckFilename, deck_, eclipseState_, schedule_,
|
||||||
summaryConfig_, nullptr, python, std::move(parseContext),
|
summaryConfig_, nullptr, python, std::move(parseContext),
|
||||||
init_from_restart_file, outputCout_);
|
init_from_restart_file, outputCout_, outputInterval);
|
||||||
|
|
||||||
setupTime_ = externalSetupTimer.elapsed();
|
setupTime_ = externalSetupTimer.elapsed();
|
||||||
outputFiles_ = (outputMode != FileOutputMode::OUTPUT_NONE);
|
outputFiles_ = (outputMode != FileOutputMode::OUTPUT_NONE);
|
||||||
|
@ -170,7 +170,7 @@ void setupMessageLimiter(const Opm::MessageLimits msgLimits, const std::string&
|
|||||||
void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& deck, std::unique_ptr<Opm::EclipseState>& eclipseState,
|
void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& deck, std::unique_ptr<Opm::EclipseState>& eclipseState,
|
||||||
std::unique_ptr<Opm::Schedule>& schedule, std::unique_ptr<Opm::SummaryConfig>& summaryConfig,
|
std::unique_ptr<Opm::Schedule>& schedule, std::unique_ptr<Opm::SummaryConfig>& summaryConfig,
|
||||||
std::unique_ptr<ErrorGuard> errorGuard, std::shared_ptr<Opm::Python>& python, std::unique_ptr<ParseContext> parseContext,
|
std::unique_ptr<ErrorGuard> errorGuard, std::shared_ptr<Opm::Python>& python, std::unique_ptr<ParseContext> parseContext,
|
||||||
bool initFromRestart, bool checkDeck)
|
bool initFromRestart, bool checkDeck, const std::optional<int>& outputInterval)
|
||||||
{
|
{
|
||||||
if (!errorGuard)
|
if (!errorGuard)
|
||||||
{
|
{
|
||||||
@ -216,7 +216,7 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& d
|
|||||||
Opm::EclIO::ERst rst_file(rst_filename);
|
Opm::EclIO::ERst rst_file(rst_filename);
|
||||||
const auto& rst_state = Opm::RestartIO::RstState::load(rst_file, report_step);
|
const auto& rst_state = Opm::RestartIO::RstState::load(rst_file, report_step);
|
||||||
if (!schedule)
|
if (!schedule)
|
||||||
schedule = std::make_unique<Opm::Schedule>(*deck, *eclipseState, *parseContext, *errorGuard, python, &rst_state);
|
schedule = std::make_unique<Opm::Schedule>(*deck, *eclipseState, *parseContext, *errorGuard, python, outputInterval, &rst_state);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!schedule)
|
if (!schedule)
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include <opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp>
|
#include <opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
@ -56,7 +57,7 @@ FileOutputMode setupLogging(int mpi_rank_, const std::string& deck_filename, con
|
|||||||
void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& deck, std::unique_ptr<Opm::EclipseState>& eclipseState,
|
void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& deck, std::unique_ptr<Opm::EclipseState>& eclipseState,
|
||||||
std::unique_ptr<Opm::Schedule>& schedule, std::unique_ptr<Opm::SummaryConfig>& summaryConfig,
|
std::unique_ptr<Opm::Schedule>& schedule, std::unique_ptr<Opm::SummaryConfig>& summaryConfig,
|
||||||
std::unique_ptr<ErrorGuard> errorGuard, std::shared_ptr<Opm::Python>& python, std::unique_ptr<ParseContext> parseContext,
|
std::unique_ptr<ErrorGuard> errorGuard, std::shared_ptr<Opm::Python>& python, std::unique_ptr<ParseContext> parseContext,
|
||||||
bool initFromRestart, bool checkDeck);
|
bool initFromRestart, bool checkDeck, const std::optional<int>& outputInterval);
|
||||||
} // end namespace Opm
|
} // end namespace Opm
|
||||||
|
|
||||||
#endif // OPM_READDECK_HEADER_INCLUDED
|
#endif // OPM_READDECK_HEADER_INCLUDED
|
||||||
|
Loading…
Reference in New Issue
Block a user