mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-11-02 20:30:55 -06:00
move ParseContext configuration to readDeck
this way we do not need to include InputErrorAction in Main.hpp
This commit is contained in:
1 parent
fd94ca7031
commit
60b23e8bb1
3 files changed
+20
-9
No files matched your search
@@ -50,7 +50,6 @@
|
|||||||
#include <flow/flow_ebos_micp.hpp>
|
#include <flow/flow_ebos_micp.hpp>
|
||||||
|
|
||||||
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
|
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
|
||||||
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
|
|
||||||
#include <opm/input/eclipse/Parser/Parser.hpp>
|
#include <opm/input/eclipse/Parser/Parser.hpp>
|
||||||
#include <opm/input/eclipse/Parser/ParseContext.hpp>
|
#include <opm/input/eclipse/Parser/ParseContext.hpp>
|
||||||
#include <opm/input/eclipse/Python/Python.hpp>
|
#include <opm/input/eclipse/Python/Python.hpp>
|
||||||
@@ -504,14 +503,8 @@ private:
|
|||||||
outputDir,
|
outputDir,
|
||||||
EWOMS_GET_PARAM(PreTypeTag, std::string, OutputMode),
|
EWOMS_GET_PARAM(PreTypeTag, std::string, OutputMode),
|
||||||
outputCout_, "STDOUT_LOGGER", allRanksDbgPrtLog);
|
outputCout_, "STDOUT_LOGGER", allRanksDbgPrtLog);
|
||||||
auto parseContext =
|
const bool strictParsing = EWOMS_GET_PARAM(PreTypeTag, bool, EclStrictParsing);
|
||||||
std::make_unique<ParseContext>(std::vector<std::pair<std::string , InputErrorAction>>
|
auto parseContext = setupParseContext(strictParsing);
|
||||||
{{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 (EWOMS_GET_PARAM(PreTypeTag, bool, EclStrictParsing))
|
|
||||||
parseContext->update(InputErrorAction::DELAYED_EXIT1);
|
|
||||||
|
|
||||||
FlowMainEbos<PreTypeTag>::printPRTHeader(outputCout_);
|
FlowMainEbos<PreTypeTag>::printPRTHeader(outputCout_);
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,8 @@
|
|||||||
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
||||||
|
|
||||||
#include <opm/input/eclipse/Parser/ErrorGuard.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/Parser/Parser.hpp>
|
||||||
|
|
||||||
#include <opm/input/eclipse/Schedule/Action/State.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)"
|
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;
|
||||||
|
}
|
||||||
@@ -60,6 +60,8 @@ enum class FileOutputMode {
|
|||||||
void
|
void
|
||||||
ensureOutputDirExists(const std::string& cmdline_output_dir);
|
ensureOutputDirExists(const std::string& cmdline_output_dir);
|
||||||
|
|
||||||
|
std::unique_ptr<ParseContext> setupParseContext(const bool strictParsing);
|
||||||
|
|
||||||
// Setup the OpmLog backends
|
// Setup the OpmLog backends
|
||||||
FileOutputMode
|
FileOutputMode
|
||||||
setupLogging(int mpi_rank_,
|
setupLogging(int mpi_rank_,
|
||||||
|
|||||||
Reference in new issue
Block a user