mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-02 12:36:54 -06:00
Merge pull request #1350 from totto82/onlyReadTuningParamOnce
Only read use_TUNING param once.
This commit is contained in:
commit
9cffa946f6
@ -168,10 +168,10 @@ public:
|
|||||||
// adaptive time stepping
|
// adaptive time stepping
|
||||||
const auto& events = schedule().getEvents();
|
const auto& events = schedule().getEvents();
|
||||||
std::unique_ptr< AdaptiveTimeStepping > adaptiveTimeStepping;
|
std::unique_ptr< AdaptiveTimeStepping > adaptiveTimeStepping;
|
||||||
|
const bool useTUNING = param_.getDefault("use_TUNING", false);
|
||||||
if( param_.getDefault("timestep.adaptive", true ) )
|
if( param_.getDefault("timestep.adaptive", true ) )
|
||||||
{
|
{
|
||||||
|
if (useTUNING) {
|
||||||
if (param_.getDefault("use_TUNING", false)) {
|
|
||||||
adaptiveTimeStepping.reset( new AdaptiveTimeStepping( schedule().getTuning(), timer.currentStepNum(), param_, terminal_output_ ) );
|
adaptiveTimeStepping.reset( new AdaptiveTimeStepping( schedule().getTuning(), timer.currentStepNum(), param_, terminal_output_ ) );
|
||||||
} else {
|
} else {
|
||||||
adaptiveTimeStepping.reset( new AdaptiveTimeStepping( param_, terminal_output_ ) );
|
adaptiveTimeStepping.reset( new AdaptiveTimeStepping( param_, terminal_output_ ) );
|
||||||
@ -253,7 +253,7 @@ public:
|
|||||||
// \Note: The report steps are met in any case
|
// \Note: The report steps are met in any case
|
||||||
// \Note: The sub stepping will require a copy of the state variables
|
// \Note: The sub stepping will require a copy of the state variables
|
||||||
if( adaptiveTimeStepping ) {
|
if( adaptiveTimeStepping ) {
|
||||||
if (param_.getDefault("use_TUNING", false)) {
|
if (useTUNING) {
|
||||||
if(events.hasEvent(ScheduleEvents::TUNING_CHANGE,timer.currentStepNum())) {
|
if(events.hasEvent(ScheduleEvents::TUNING_CHANGE,timer.currentStepNum())) {
|
||||||
adaptiveTimeStepping->updateTUNING(schedule().getTuning(), timer.currentStepNum());
|
adaptiveTimeStepping->updateTUNING(schedule().getTuning(), timer.currentStepNum());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user