Merge pull request #1104 from atgeirr/allow-restart-without-opmextra

Allow restarting without OPMEXTRA field in restart file.
This commit is contained in:
Bård Skaflestad 2017-03-17 11:18:06 +01:00 committed by GitHub
commit d700f3e946
3 changed files with 8 additions and 3 deletions

View File

@ -118,7 +118,9 @@ namespace Opm
adaptiveTimeStepping.reset( new AdaptiveTimeStepping( param_, terminal_output_ ) );
}
if (output_writer_.isRestart()) {
adaptiveTimeStepping->setSuggestedNextStep(extra.suggested_step);
if (extra.suggested_step > 0.0) {
adaptiveTimeStepping->setSuggestedNextStep(extra.suggested_step);
}
}
}

View File

@ -174,7 +174,9 @@ public:
}
if (output_writer_.isRestart()) {
adaptiveTimeStepping->setSuggestedNextStep(extra.suggested_step);
if (extra.suggested_step > 0.0) {
adaptiveTimeStepping->setSuggestedNextStep(extra.suggested_step);
}
}
}

View File

@ -467,7 +467,8 @@ namespace Opm
assert(opmextra.size() == 1);
extra.suggested_step = opmextra[0];
} else {
OPM_THROW(std::runtime_error, "Cannot restart, restart data is missing OPMEXTRA field.");
OpmLog::warning("Restart data is missing OPMEXTRA field, restart run may deviate from original run.");
extra.suggested_step = -1.0;
}
}