Merge pull request #4385 from akva2/inputerroraction_hpp_include

add missing InputErrorAction.hpp includes
This commit is contained in:
Bård Skaflestad 2023-01-16 23:29:59 +01:00 committed by GitHub
commit fa32882bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 14 deletions

View File

@ -29,6 +29,7 @@
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Schedule/Action/State.hpp>
#include <opm/input/eclipse/Schedule/OilVaporizationProperties.hpp>
@ -99,11 +100,11 @@ void EclGenericVanguard::readDeck(const std::string& filename)
std::shared_ptr<Opm::SummaryConfig> summaryConfig;
auto parseContext =
std::make_unique<ParseContext>(std::vector<std::pair<std::string , InputError::Action>>
{{ParseContext::PARSE_RANDOM_SLASH, InputError::IGNORE},
{ParseContext::PARSE_MISSING_DIMS_KEYWORD, InputError::WARN},
{ParseContext::SUMMARY_UNKNOWN_WELL, InputError::WARN},
{ParseContext::SUMMARY_UNKNOWN_GROUP, InputError::WARN}});
std::make_unique<ParseContext>(std::vector<std::pair<std::string , InputErrorAction>>
{{ParseContext::PARSE_RANDOM_SLASH, InputErrorAction::IGNORE},
{ParseContext::PARSE_MISSING_DIMS_KEYWORD, InputErrorAction::WARN},
{ParseContext::SUMMARY_UNKNOWN_WELL, InputErrorAction::WARN},
{ParseContext::SUMMARY_UNKNOWN_GROUP, InputErrorAction::WARN}});
Opm::readDeck(EclGenericVanguard::comm(),
filename, eclipseState, schedule, udqState,

View File

@ -503,14 +503,8 @@ private:
outputDir,
EWOMS_GET_PARAM(PreTypeTag, std::string, OutputMode),
outputCout_, "STDOUT_LOGGER", allRanksDbgPrtLog);
auto parseContext =
std::make_unique<ParseContext>(std::vector<std::pair<std::string , InputError::Action>>
{{ParseContext::PARSE_RANDOM_SLASH, InputError::IGNORE},
{ParseContext::PARSE_MISSING_DIMS_KEYWORD, InputError::WARN},
{ParseContext::SUMMARY_UNKNOWN_WELL, InputError::WARN},
{ParseContext::SUMMARY_UNKNOWN_GROUP, InputError::WARN}});
if (EWOMS_GET_PARAM(PreTypeTag, bool, EclStrictParsing))
parseContext->update(InputError::DELAYED_EXIT1);
const bool strictParsing = EWOMS_GET_PARAM(PreTypeTag, bool, EclStrictParsing);
auto parseContext = setupParseContext(strictParsing);
FlowMainEbos<PreTypeTag>::printPRTHeader(outputCout_);

View File

@ -47,6 +47,8 @@
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Schedule/Action/State.hpp>
@ -574,3 +576,17 @@ void Opm::verifyValidCellGeometry(Parallel::Communication comm,
Please check geometry keywords, especially if grid is imported through GDFILE)"
};
}
std::unique_ptr<Opm::ParseContext> Opm::setupParseContext(const bool strictParsing)
{
auto parseContext =
std::make_unique<ParseContext>(std::vector<std::pair<std::string , InputErrorAction>>
{{ParseContext::PARSE_RANDOM_SLASH, InputErrorAction::IGNORE},
{ParseContext::PARSE_MISSING_DIMS_KEYWORD, InputErrorAction::WARN},
{ParseContext::SUMMARY_UNKNOWN_WELL, InputErrorAction::WARN},
{ParseContext::SUMMARY_UNKNOWN_GROUP, InputErrorAction::WARN}});
if (strictParsing)
parseContext->update(InputErrorAction::DELAYED_EXIT1);
return parseContext;
}

View File

@ -60,6 +60,8 @@ enum class FileOutputMode {
void
ensureOutputDirExists(const std::string& cmdline_output_dir);
std::unique_ptr<ParseContext> setupParseContext(const bool strictParsing);
// Setup the OpmLog backends
FileOutputMode
setupLogging(int mpi_rank_,

View File

@ -36,6 +36,7 @@
#include <opm/input/eclipse/Python/Python.hpp>
#include <opm/input/eclipse/Units/Units.hpp>
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
@ -280,7 +281,7 @@ void verify_norne_oil_pvt_region2(const Opm::EclipseState& eclState, const Opm::
}
BOOST_AUTO_TEST_CASE( Test_Norne_PVT) {
Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }});
Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputErrorAction::IGNORE }});
Opm::ErrorGuard errorGuard;
Opm::Parser parser;
auto python = std::make_shared<Opm::Python>();