31 #include <opm/input/eclipse/Deck/DeckView.hpp>
32 #include <opm/input/eclipse/Deck/DeckTree.hpp>
33 #include <opm/input/eclipse/Deck/DeckKeyword.hpp>
34 #include <opm/input/eclipse/Units/UnitSystem.hpp>
36 #ifdef OPM_PARSER_DECK_API_WARNING
37 #ifndef OPM_PARSER_DECK_API
38 #pragma message "\n\n" \
39 " ----------------------------------------------------------------------------------\n" \
40 " The current compilation unit includes the header Deck.hpp. Outside of opm-parser \n" \
41 " you are encouraged to use the EclipseState API instead of the low level Deck API. \n" \
42 " If use of the Deck API is absolutely necessary you can silence this warning with \n" \
43 " #define OPM_PARSER_DECK_API before including the Deck.hpp header. \n" \
44 " ----------------------------------------------------------------------------------\n" \
65 using iterator = std::vector< DeckKeyword >::iterator;
66 using const_iterator = std::vector< DeckKeyword >::const_iterator;
72 static Deck serializationTestObject();
75 bool operator==(
const Deck& data)
const;
80 const UnitSystem& getDefaultUnitSystem()
const;
84 void selectActiveUnitSystem( UnitSystem::UnitType unit_type );
86 const std::string& getInputPath()
const;
87 std::string getDataFile()
const;
88 void setDataFile(
const std::string& dataFile);
89 std::string makeDeckPath(
const std::string& path)
const;
93 std::size_t size()
const;
98 friend std::ostream& operator<<(std::ostream& os,
const Deck& deck);
99 const_iterator begin()
const;
100 const_iterator end()
const;
103 const DeckKeyword& operator[](std::size_t index)
const;
105 template<
class Keyword >
107 return this->operator[](Keyword::keywordName);
110 std::vector< const DeckKeyword* > getKeywordList(
const std::string& keyword )
const;
111 template<
class Keyword >
112 std::vector< const DeckKeyword* > getKeywordList()
const {
113 return getKeywordList( Keyword::keywordName );
116 template<
class Serializer>
119 serializer(keywordList);
120 serializer(defaultUnits);
121 serializer(activeUnits);
122 serializer(m_dataFile);
123 serializer(input_path);
124 serializer(unit_system_access_count);
127 bool hasKeyword(
const std::string& keyword )
const;
129 template<
class Keyword >
130 bool hasKeyword()
const {
131 return this->hasKeyword( Keyword::keywordName );
136 const std::vector<std::size_t> index(
const std::string& keyword)
const {
137 return this->global_view().index(keyword);
140 template<
class Keyword >
141 std::size_t count()
const {
142 return count( Keyword::keywordName );
144 size_t count(
const std::string& keyword)
const;
150 std::vector< DeckKeyword > keywordList;
152 std::optional<UnitSystem> activeUnits;
154 std::optional<std::string> m_dataFile;
155 std::string input_path;
157 mutable std::size_t unit_system_access_count = 0;
159 const DeckView& global_view()
const;
160 mutable std::unique_ptr<DeckView> m_global_view{
nullptr};
Definition: DeckKeyword.hpp:36
Definition: DeckOutput.hpp:29
Definition: DeckTree.hpp:38
Definition: DeckView.hpp:30
Class for (de-)serializing.
Definition: Serializer.hpp:75
Definition: UnitSystem.hpp:33
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29