20 #ifndef OPM_PARSER_HPP
21 #define OPM_PARSER_HPP
34 #include <opm/input/eclipse/Parser/ParserKeyword.hpp>
45 GRID, PROPS, REGIONS, SOLUTION, SUMMARY, SCHEDULE
62 explicit Parser(
bool addDefault =
true);
64 static std::string stripComments(
const std::string& inputString);
70 const std::vector<Opm::Ecl::SectionType>& sections = {})
const;
77 const std::vector<Opm::Ecl::SectionType>& sections
82 Deck parseString(
const std::string &data,
86 Deck parseString(
const std::string &data)
const;
98 const ParserKeyword& getKeyword(
const std::string& name)
const;
100 bool isRecognizedKeyword(
const std::string_view& deckKeywordName)
const;
101 const ParserKeyword& getParserKeywordFromDeckName(
const std::string_view& deckKeywordName)
const;
102 std::vector<std::string> getAllDeckNames ()
const;
105 bool loadKeywordFromFile(
const std::filesystem::path& configFile);
107 void loadKeywordsFromDirectory(
const std::filesystem::path& directory ,
bool recursive =
true);
108 void applyUnitsToDeck(
Deck& deck)
const;
146 const std::vector<std::pair<std::string,std::string>> codeKeywords()
const;
149 bool hasWildCardKeyword(
const std::string& keyword)
const;
150 const ParserKeyword* matchingKeyword(
const std::string_view& keyword)
const;
151 void addDefaultKeywords();
154 std::list<ParserKeyword> keyword_storage;
157 std::map< std::string_view, const ParserKeyword* > m_deckParserKeywords;
161 std::map< std::string_view, const ParserKeyword* > m_wildCardKeywords;
163 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:60
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