Access tuning class from ScheduleState

This commit is contained in:
Joakim Hove 2021-01-06 16:14:15 +01:00
parent 42a6a3b573
commit fe788cdb05
2 changed files with 4 additions and 5 deletions

View File

@ -876,7 +876,7 @@ public:
if (enableTuning_) {
// if support for the TUNING keyword is enabled, we get the initial time
// steping parameters from it instead of from command line parameters
const auto& tuning = schedule.getTuning(0);
const auto& tuning = schedule[0].tuning();
initialTimeStepSize_ = tuning.TSINIT;
maxTimeStepAfterWellEvent_ = tuning.TMAXWC;
maxTimeStepSize_ = tuning.TSMAXZ;
@ -1060,7 +1060,7 @@ public:
bool tuningEvent = false;
if (episodeIdx > 0 && enableTuning_ && events.hasEvent(Opm::ScheduleEvents::TUNING_CHANGE, episodeIdx))
{
const auto& tuning = schedule.getTuning(episodeIdx);
const auto& tuning = schedule[episodeIdx].tuning();
initialTimeStepSize_ = tuning.TSINIT;
maxTimeStepAfterWellEvent_ = tuning.TMAXWC;
maxTimeStepSize_ = tuning.TSMAXZ;

View File

@ -166,8 +166,7 @@ public:
bool enableTUNING = EWOMS_GET_PARAM(TypeTag, bool, EnableTuning);
if (enableAdaptive) {
if (enableTUNING) {
adaptiveTimeStepping_ = std::make_unique<TimeStepper>(
schedule().getTuning(timer.currentStepNum()), terminalOutput_);
adaptiveTimeStepping_ = std::make_unique<TimeStepper>(schedule()[timer.currentStepNum()].tuning(), terminalOutput_);
}
else {
adaptiveTimeStepping_ = std::make_unique<TimeStepper>(terminalOutput_);
@ -247,7 +246,7 @@ public:
if (adaptiveTimeStepping_) {
if (enableTUNING) {
if (events.hasEvent(ScheduleEvents::TUNING_CHANGE,timer.currentStepNum())) {
adaptiveTimeStepping_->updateTUNING(schedule().getTuning(timer.currentStepNum()));
adaptiveTimeStepping_->updateTUNING(schedule()[timer.currentStepNum()].tuning());
}
}