Merge pull request #5329 from vkip/input_skip_mode

Add parameter InputSkipMode to parameterise SKIP100 and SKIP300
This commit is contained in:
Bård Skaflestad 2024-05-06 10:56:38 +02:00 committed by GitHub
commit 26c59ce5cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 26 additions and 1 deletions

View File

@ -73,6 +73,10 @@ struct ParsingStrictness {
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag>
struct InputSkipMode {
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag>
struct SchedRestart {
using type = UndefinedProperty;
};
@ -148,6 +152,10 @@ struct ParsingStrictness<TypeTag, TTag::FlowBaseVanguard> {
static constexpr auto value = "normal";
};
template<class TypeTag>
struct InputSkipMode<TypeTag, TTag::FlowBaseVanguard> {
static constexpr auto value = "100";
};
template<class TypeTag>
struct SchedRestart<TypeTag, TTag::FlowBaseVanguard> {
static constexpr bool value = false;
};
@ -253,6 +261,11 @@ public:
"high (stop for all errors) and "
"low (as normal, except do not stop due to unsupported "
"keywords even if marked critical");
Parameters::registerParam<TypeTag, Properties::InputSkipMode>
("Set compatibility mode for the SKIP100/SKIP300 keywords. Options are "
"100 (skip SKIP100..ENDSKIP, keep SKIP300..ENDSKIP) [default], "
"300 (skip SKIP300..ENDSKIP, keep SKIP100..ENDSKIP) and "
"all (skip both SKIP100..ENDSKIP and SKIP300..ENDSKIP) ");
Parameters::registerParam<TypeTag, Properties::SchedRestart>
("When restarting: should we try to initialize wells and "
"groups from historical SCHEDULE section.");

View File

@ -136,7 +136,7 @@ void FlowGenericVanguard::readDeck(const std::string& filename)
modelParams_.actionState_,
modelParams_.wtestState_,
modelParams_.eclSummaryConfig_,
nullptr, "normal", false, false, {});
nullptr, "normal", "100", false, false, {});
modelParams_.setupTime_ = setupTimer.stop();
}

View File

@ -200,6 +200,7 @@ void Main::readDeck(const std::string& deckFilename,
const bool init_from_restart_file,
const bool allRanksDbgPrtLog,
const std::string& parsingStrictness,
const std::string& inputSkipMode,
const std::size_t numThreads,
const int output_param,
const std::string& parameters,
@ -232,6 +233,7 @@ void Main::readDeck(const std::string& deckFilename,
summaryConfig_,
std::make_shared<Python>(),
parsingStrictness,
inputSkipMode,
init_from_restart_file,
outputCout_,
outputInterval);

View File

@ -419,6 +419,7 @@ private:
!Parameters::get<PreTypeTag, Properties::SchedRestart>(),
Parameters::get<PreTypeTag, Properties::EnableLoggingFalloutWarning>(),
Parameters::get<PreTypeTag, Properties::ParsingStrictness>(),
Parameters::get<PreTypeTag, Properties::InputSkipMode>(),
getNumThreads<PreTypeTag>(),
Parameters::get<PreTypeTag, Properties::EclOutputInterval>(),
cmdline_params,
@ -693,6 +694,7 @@ private:
const bool init_from_restart_file,
const bool allRanksDbgPrtLog,
const std::string& parsingStrictness,
const std::string& inputSkipMode,
const std::size_t numThreads,
const int output_param,
const std::string& parameters,

View File

@ -536,6 +536,7 @@ void Opm::readDeck(Opm::Parallel::Communication comm,
std::shared_ptr<SummaryConfig>& summaryConfig,
std::shared_ptr<Python> python,
const std::string& parsingStrictness,
const std::string& inputSkipMode,
const bool initFromRestart,
const bool checkDeck,
const std::optional<int>& outputInterval)
@ -550,6 +551,11 @@ void Opm::readDeck(Opm::Parallel::Communication comm,
fmt::format("Incorrect value {} for parameter ParsingStrictness, must be 'high', 'normal', or 'low'", parsingStrictness));
}
if (inputSkipMode != "100" && inputSkipMode != "300" && inputSkipMode != "all") {
OPM_THROW(std::runtime_error,
fmt::format("Incorrect value {} for parameter InputSkipMode, must be '100', '300', or 'all'", inputSkipMode));
}
if (comm.rank() == 0) { // Always true when !HAVE_MPI
const bool exitOnAllErrors = (parsingStrictness == "high");
const bool treatCriticalAsNonCritical = (parsingStrictness == "low");
@ -558,6 +564,7 @@ void Opm::readDeck(Opm::Parallel::Communication comm,
if (treatCriticalAsNonCritical) { // Continue with invalid names if parsing strictness is set to low
parseContext->update(ParseContext::SCHEDULE_INVALID_NAME, InputErrorAction::WARN);
}
parseContext->setInputSkipMode(inputSkipMode);
readOnIORank(comm, deckFilename, parseContext.get(),
eclipseState, schedule, udqState, actionState, wtestState,
summaryConfig, std::move(python), initFromRestart,

View File

@ -91,6 +91,7 @@ void readDeck(Parallel::Communication comm,
std::shared_ptr<SummaryConfig>& summaryConfig,
std::shared_ptr<Python> python,
const std::string& parsingStrictness,
const std::string& inputSkipMode,
bool initFromRestart,
bool checkDeck,
const std::optional<int>& outputInterval);