20#ifndef OPM_PARSE_CONTEXT_HPP
21#define OPM_PARSE_CONTEXT_HPP
32enum class InputErrorAction;
144 explicit ParseContext(
const std::vector<std::pair<std::string, InputErrorAction>>& initial);
167 const std::string& msg,
168 const std::optional<KeywordLocation>& location,
185 const std::optional<KeywordLocation>& location,
194 bool hasKey(
const std::string& key)
const;
204 void updateKey(
const std::string& key, InputErrorAction action);
209 void update(InputErrorAction action);
236 void update(
const std::string& keyString, InputErrorAction action);
257 InputErrorAction
get(
const std::string& key)
const;
268 void addKey(
const std::string& key, InputErrorAction default_action);
604 std::map<std::string, InputErrorAction> m_errorContexts{};
608 std::set<std::string> ignore_keywords{};
622 std::string m_input_skip_mode{
"100"};
645 void envUpdate(
const std::string& envVariable, InputErrorAction action);
654 void patternUpdate(
const std::string& pattern, InputErrorAction action);
Definition ErrorGuard.hpp:30
Definition KeywordLocation.hpp:27
static const std::string RUNSPEC_NUMMSW_TOO_LARGE
Dynamic number of multi-segmented wells exceeds maximum declared in RUNSPEC keyword WSEGDIMS (item 1)...
Definition ParseContext.hpp:394
static const std::string PARSE_RANDOM_TEXT
Random text is an input deck string not correctly formatted as a keyword heading.
Definition ParseContext.hpp:338
static const std::string UDQ_DEFINE_CANNOT_EVAL
Cannot evaluate the defining expression of a UDQ at the point of definition due to missing objects,...
Definition ParseContext.hpp:433
bool isActiveSkipKeyword(const std::string &deck_name) const
Whether or not a particular keyword activates keyword suppression.
Definition ParseContext.cpp:318
static const std::string RUNSPEC_NUMWELLS_TOO_LARGE
Dynamic number of wells exceeds maximum declared in RUNSPEC keyword WELLDIMS (item 1).
Definition ParseContext.hpp:378
static const std::string SIMULATOR_KEYWORD_NOT_SUPPORTED
Keyword that is not supported in the simulator.
Definition ParseContext.hpp:589
static const std::string PARSE_RANDOM_SLASH
It turns out that random '/'–i.e.
Definition ParseContext.hpp:343
static const std::string PARSE_MISSING_SECTIONS
If the deck does not have all sections, whence complete EclipseState and Schedule objects cannot be c...
Definition ParseContext.hpp:444
static const std::string SUMMARY_UNKNOWN_AQUIFER
Aquifer level summary vector references an unknown aquifer (analytic or numeric).
Definition ParseContext.hpp:464
void update(InputErrorAction action)
Reset action for all context categories.
Definition ParseContext.cpp:276
static const std::string SCHEDULE_GROUP_ERROR
Operation applied to incorrect/unknown group.
Definition ParseContext.hpp:544
static const std::string SUMMARY_UDQ_MISSING_UNIT
User-defined quantity does not have an associated unit of measure and will thus be reported without a...
Definition ParseContext.hpp:474
static const std::string PARSE_MISSING_INCLUDE
If an include file is not found we can configure the parser to continue reading.
Definition ParseContext.hpp:368
static const std::string RUNSPEC_CONNS_PER_WELL_TOO_LARGE
Dynamic number of connections per well exceeds maximum declared in RUNSPEC keyword WELLDIMS (item 2).
Definition ParseContext.hpp:382
void updateKey(const std::string &key, InputErrorAction action)
Reset action for particular context category.
Definition ParseContext.cpp:252
static const std::string SIMULATOR_KEYWORD_NOT_SUPPORTED_CRITICAL
Keyword that is not supported in the simulator, and which should be treated as a critical failure if ...
Definition ParseContext.hpp:593
static const std::string PARSE_UNKNOWN_KEYWORD
The unknown keyword category controls the parser's behaviour on encountering an unknown keyword.
Definition ParseContext.hpp:334
static const std::string UNIT_SYSTEM_MISMATCH
The unit system specified via the FILEUNIT keyword is different from the unit system used by the deck...
Definition ParseContext.hpp:411
bool hasKey(const std::string &key) const
Existence predicate for particular context category.
Definition ParseContext.cpp:212
static const std::string PARSE_MISSING_DIMS_KEYWORD
For some keywords the number of records (i.e., size) is given as an item in another keyword.
Definition ParseContext.hpp:355
ParseContext()
Default constructor.
Definition ParseContext.cpp:37
static const std::string PARSE_EXTRA_RECORDS
The PARSE_EXTRA_RECORDS field controls the parser's response to keywords whose size has been defined ...
Definition ParseContext.hpp:316
static const std::string SUMMARY_EMPTY_REGION
Summary vector references an empty region.
Definition ParseContext.hpp:480
static const std::string RUNSPEC_NUMBRANCH_TOO_LARGE
Dynamic number of branches exceeds maximum number declared in RUNSPEC keyword WSEGDIMS (item 3).
Definition ParseContext.hpp:402
static const std::string UNSUPPORTED_TERMINATE_IF_BHP
If the second item in the WHISTCTL keyword is set to YES.
Definition ParseContext.hpp:422
static const std::string RUNSPEC_GROUPSIZE_TOO_LARGE
Dynamic group size exceeds maximum number declared in RUNSPEC keyword WELLDIMS (item 4).
Definition ParseContext.hpp:390
static const std::string UDQ_TYPE_ERROR
Parser unable to establish a coherent UDQ set type for a user-defined quantity.
Definition ParseContext.hpp:429
static const std::string RPT_UNKNOWN_MNEMONIC
An unknown mnemonic in one of the RPT* keywords.
Definition ParseContext.hpp:541
void handleUnknownKeyword(const std::string &keyword, const std::optional< KeywordLocation > &location, ErrorGuard &errors) const
Handle an unknown keyword in the input stream.
Definition ParseContext.cpp:202
static const std::string SIMULATOR_KEYWORD_ITEM_NOT_SUPPORTED
Keyword item setting that is not supported in the simulator.
Definition ParseContext.hpp:596
static const std::string SCHEDULE_WELL_IN_FIELD_GROUP
Well parented directly to the FIELD group.
Definition ParseContext.hpp:552
void addKey(const std::string &key, InputErrorAction default_action)
Define action for user-specified category.
Definition ParseContext.cpp:217
InputErrorAction get(const std::string &key) const
Retrieve category action for particular context category.
Definition ParseContext.cpp:229
static const std::string SUMMARY_REGION_TOO_LARGE
Summary vector references an out-of-bounds region ID.
Definition ParseContext.hpp:483
static const std::string SUMMARY_INVALID_FIPNUM
Summary vector references an unknown FIP region.
Definition ParseContext.hpp:477
static const std::string UDQ_PARSE_ERROR
Parser fails to analyse the defining expression of a UDQ.
Definition ParseContext.hpp:425
static const std::string SCHEDULE_ICD_INCOMPATIBLE_PDROP_MODEL
ICD keyword (WSEGAICD, WSEGSICD, WSEGVALV) is not compatible with the pressure drop model chosen for ...
Definition ParseContext.hpp:581
void handleError(const std::string &errorKey, const std::string &msg, const std::optional< KeywordLocation > &location, ErrorGuard &errors) const
Handle an input error.
Definition ParseContext.cpp:154
static const std::string SIMULATOR_KEYWORD_ITEM_NOT_SUPPORTED_CRITICAL
Keyword item setting that is not supported in the simulator and which should be treated as a critical...
Definition ParseContext.hpp:600
static const std::string ACTIONX_ILLEGAL_KEYWORD
ACTIONX block uses an unsupported schedule keyword.
Definition ParseContext.hpp:494
static const std::string SCHEDULE_COMPDAT_INVALID
Connection data (COMPDAT keyword) invalid in some way.
Definition ParseContext.hpp:566
static const std::string ACTIONX_NO_CONDITION
Error flag marking that an ACTIONX has no condition.
Definition ParseContext.hpp:503
static const std::string ACTIONX_CONDITION_ERROR
Error flag marking parser errors ic ACTIONX conditions.
Definition ParseContext.hpp:500
static const std::string SCHEDULE_INVALID_NAME
A well or group name used before it has been fully defined through WELSPECS/COMPDAT/GRUPTREE.
Definition ParseContext.hpp:487
static const std::string SUMMARY_UNKNOWN_NODE
Summary vector references an unknown network node.
Definition ParseContext.hpp:460
void setInputSkipMode(const std::string &skip_mode)
Define how to handle simulator specific keyword suppression.
Definition ParseContext.cpp:313
static const std::string PYACTION_ILLEGAL_KEYWORD
PYACTION block uses an unsupported schedule keyword.
Definition ParseContext.hpp:497
static const std::string SUMMARY_UNKNOWN_GROUP
Group level summary vector references an unknown group.
Definition ParseContext.hpp:457
static const std::string UNSUPPORTED_INITIAL_THPRES
If the third item in the THPRES keyword is defaulted, the threshold pressure is inferred from the ini...
Definition ParseContext.hpp:416
static const std::string RPT_MIXED_STYLE
The RPTRST, RPTSOL and RPTSCHED keywords have two alternative forms.
Definition ParseContext.hpp:538
static const std::string PARSE_WGNAME_SPACE
When defining wells and groups with the WELSPECS and GRUPTREE keywords we do not allow leading or tra...
Definition ParseContext.hpp:451
static const std::string SCHEDULE_COMPSEGS_NOT_SUPPORTED
COMPSEGS definition not supported.
Definition ParseContext.hpp:563
static const std::string PARSE_LONG_KEYWORD
Should we allow keywords of length more than eight characters?
Definition ParseContext.hpp:407
static const std::string SUMMARY_UNHANDLED_KEYWORD
Summary vector name is unknown.
Definition ParseContext.hpp:467
static const std::string RUNSPEC_NUMGROUPS_TOO_LARGE
Dynamic number of groups exceeds maximum number declared in RUNSPEC keyword WELLDIMS (item 3).
Definition ParseContext.hpp:386
static const std::string INTERNAL_ERROR_UNINITIALIZED_THPRES
If the third item in the THPRES keyword is defaulted the threshold pressure is inferred from the init...
Definition ParseContext.hpp:439
static const std::string RUNSPEC_NUMSEG_PER_WELL_TOO_LARGE
Dynamic number of segments per MS well exceeds maximum declared in RUNSPEC keyword WSEGDIMS (item 2).
Definition ParseContext.hpp:398
static const std::string SCHEDULE_IGNORED_GUIDE_RATE
Explicitly supplied guide rate will be ignored.
Definition ParseContext.hpp:547
static const std::string PARSE_EXTRA_DATA
If the number of elements in the input record exceeds the number of items in the keyword configuratio...
Definition ParseContext.hpp:363
static const std::string SCHEDULE_ICD_MISSING_SEGMENT
ICD keyword (WSEGAICD, WSEGSICD, WSEGVALV) references a missing well segment.
Definition ParseContext.hpp:577
static const std::string SCHEDULE_COMPSEGS_INVALID
COMPSEGS data invalid in some way.
Definition ParseContext.hpp:558
static const std::string SCHEDULE_COMPDAT_ZERO_PERM
Connection in zero-permeability cell (COMPDAT keyword).
Definition ParseContext.hpp:569
static const std::string SUMMARY_UNDEFINED_UDQ
Summary vector references an undefined UDQ.
Definition ParseContext.hpp:470
static const std::string SUMMARY_UNKNOWN_WELL
Well level summary vector references an unknown well.
Definition ParseContext.hpp:454
static const std::string PARSE_INVALID_KEYWORD_COMBINATION
Certain keywords require, or prohibit, other specific keywords.
Definition ParseContext.hpp:374
void ignoreKeyword(const std::string &keyword)
Ignore particular unknown input keyword if encountered during parsing.
Definition ParseContext.cpp:149
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30