20 #ifndef OPM_PARSER_HPP
21 #define OPM_PARSER_HPP
34 #include <opm/input/eclipse/EclipseState/EclipseState.hpp>
35 #include <opm/input/eclipse/Parser/ParserKeyword.hpp>
46 GRID, PROPS, REGIONS, SOLUTION, SUMMARY, SCHEDULE
61 explicit Parser(
bool addDefault =
true);
63 static std::string stripComments(
const std::string& inputString);
69 const std::vector<Opm::Ecl::SectionType>& sections = {})
const;
76 const std::vector<Opm::Ecl::SectionType>& sections
81 Deck parseString(
const std::string &data,
85 Deck parseString(
const std::string &data)
const;
97 const ParserKeyword& getKeyword(
const std::string& name)
const;
99 bool isRecognizedKeyword(
const std::string_view& deckKeywordName)
const;
100 const ParserKeyword& getParserKeywordFromDeckName(
const std::string_view& deckKeywordName)
const;
101 std::vector<std::string> getAllDeckNames ()
const;
104 bool loadKeywordFromFile(
const std::filesystem::path& configFile);
106 void loadKeywordsFromDirectory(
const std::filesystem::path& directory ,
bool recursive =
true);
107 void applyUnitsToDeck(
Deck& deck)
const;
145 const std::vector<std::pair<std::string,std::string>> codeKeywords()
const;
148 bool hasWildCardKeyword(
const std::string& keyword)
const;
149 const ParserKeyword* matchingKeyword(
const std::string_view& keyword)
const;
150 void addDefaultKeywords();
153 std::list<ParserKeyword> keyword_storage;
156 std::map< std::string_view, const ParserKeyword* > m_deckParserKeywords;
160 std::map< std::string_view, const ParserKeyword* > m_wildCardKeywords;
162 std::vector<std::pair<std::string,std::string>> code_keywords;
Definition: JsonObject.hpp:32
About cell information and dimension: The actual grid information is held in a pointer to an ERT ecl_...
Definition: EclipseGrid.hpp:54
Definition: EclipseState.hpp:55
Definition: ErrorGuard.hpp:29
Definition: ParseContext.hpp:88
Definition: ParserKeyword.hpp:85
The hub of the parsing process.
Definition: Parser.hpp:59
void addParserKeyword(const Json::JsonObject &jsonKeyword)
Method to add ParserKeyword instances, these holding type and size information about the keywords and...
static EclipseGrid parseGrid(const Deck &deck, const ParseContext &context)
Parses the provided deck.
static EclipseGrid parseGridData(const std::string &data, const ParseContext &context, ErrorGuard &errors)
Parses the provided deck string.
bool hasKeyword(const std::string &) const
Returns whether the parser knows about a keyword.
Deck parseFile(const std::string &dataFile, const ParseContext &, ErrorGuard &errors, const std::vector< Opm::Ecl::SectionType > §ions={}) const
The starting point of the parsing process. The supplied file is parsed, and the resulting Deck is ret...
size_t size() const
Returns the approximate number of recognized keywords in decks.
static EclipseGrid parseGrid(const std::string &filename, const ParseContext &context, ErrorGuard &errors)
Parses the deck specified in filename.
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29