Add commandline switch --sched-restart to control restart init

This commit is contained in:
Joakim Hove 2020-03-04 15:17:30 +01:00
parent 390c7b21d4
commit 42f96ca039
2 changed files with 7 additions and 1 deletions

View File

@ -73,6 +73,7 @@ NEW_PROP_TAG(EclDeckFileName);
NEW_PROP_TAG(OutputDir);
NEW_PROP_TAG(EnableOpmRstFile);
NEW_PROP_TAG(EclStrictParsing);
NEW_PROP_TAG(SchedRestart);
NEW_PROP_TAG(EclOutputInterval);
NEW_PROP_TAG(IgnoreKeywords);
NEW_PROP_TAG(EnableExperiments);
@ -83,6 +84,7 @@ SET_STRING_PROP(EclBaseVanguard, EclDeckFileName, "");
SET_INT_PROP(EclBaseVanguard, EclOutputInterval, -1); // use the deck-provided value
SET_BOOL_PROP(EclBaseVanguard, EnableOpmRstFile, false);
SET_BOOL_PROP(EclBaseVanguard, EclStrictParsing, false);
SET_BOOL_PROP(EclBaseVanguard, SchedRestart, true);
SET_INT_PROP(EclBaseVanguard, EdgeWeightsMethod, 1);
END_PROPERTIES
@ -127,6 +129,8 @@ public:
"List of Eclipse keywords which should be ignored. As a ':' separated string.");
EWOMS_REGISTER_PARAM(TypeTag, bool, EclStrictParsing,
"Use strict mode for parsing - all errors are collected before the applicaton exists.");
EWOMS_REGISTER_PARAM(TypeTag, bool, SchedRestart,
"When restarting: should we try to initialize wells and groups from historical SCHEDULE section.");
EWOMS_REGISTER_PARAM(TypeTag, int, EdgeWeightsMethod,
"Choose edge-weighing strategy: 0=uniform, 1=trans, 2=log(trans).");
}

View File

@ -370,9 +370,11 @@ int main(int argc, char** argv)
restart file is not possible, but work is underways and it is
included here as a switch.
*/
const bool init_from_restart_file = false;
const bool init_from_restart_file = !EWOMS_GET_PARAM(PreTypeTag, bool, SchedRestart);
const auto& init_config = eclipseState->getInitConfig();
if (init_config.restartRequested() && init_from_restart_file) {
throw std::logic_error("Sorry - the ability to initialize wells and groups from the restart file is currently not ready");
int report_step = init_config.getRestartStep();
const auto& rst_filename = eclipseState->getIOConfig().getRestartFileName( init_config.getRestartRootName(), report_step, false );
Opm::EclIO::ERst rst_file(rst_filename);