diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake
index 5fdb279ae3f..d1aa1f9028a 100644
--- a/CMakeLists_files.cmake
+++ b/CMakeLists_files.cmake
@@ -41,6 +41,7 @@ list (APPEND MAIN_SOURCE_FILES
)
if(ENABLE_ECL_INPUT)
list(APPEND MAIN_SOURCE_FILES
+ src/opm/io/eclipse/SummaryNode.cpp
src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
@@ -239,6 +240,7 @@ if(ENABLE_ECL_OUTPUT)
src/opm/io/eclipse/ERst.cpp
src/opm/io/eclipse/ESmry.cpp
src/opm/io/eclipse/OutputStream.cpp
+ src/opm/io/eclipse/SummaryNode.cpp
src/opm/io/eclipse/rst/connection.cpp
src/opm/io/eclipse/rst/group.cpp
src/opm/io/eclipse/rst/header.cpp
@@ -500,6 +502,7 @@ list( APPEND PUBLIC_HEADER_FILES
)
if(ENABLE_ECL_INPUT)
list(APPEND PUBLIC_HEADER_FILES
+ opm/io/eclipse/SummaryNode.hpp
opm/json/JsonObject.hpp
opm/parser/eclipse/Utility/Stringview.hpp
opm/parser/eclipse/Utility/Functional.hpp
@@ -719,6 +722,7 @@ if(ENABLE_ECL_OUTPUT)
opm/io/eclipse/ESmry.hpp
opm/io/eclipse/PaddedOutputString.hpp
opm/io/eclipse/OutputStream.hpp
+ opm/io/eclipse/SummaryNode.hpp
opm/io/eclipse/rst/connection.hpp
opm/io/eclipse/rst/group.hpp
opm/io/eclipse/rst/header.hpp
@@ -763,3 +767,9 @@ if(ENABLE_ECL_OUTPUT)
opm/output/OutputWriter.hpp
)
endif()
+
+if(ENABLE_ECL_INPUT OR ENABLE_ECL_OUTPUT)
+ list(APPEND TEST_SOURCE_FILES
+ tests/test_SummaryNode.cpp
+)
+endif()
diff --git a/opm/io/eclipse/SummaryNode.hpp b/opm/io/eclipse/SummaryNode.hpp
new file mode 100644
index 00000000000..9339ca13185
--- /dev/null
+++ b/opm/io/eclipse/SummaryNode.hpp
@@ -0,0 +1,58 @@
+/*
+ Copyright 2020 Equinor ASA.
+
+ This file is part of the Open Porous Media project (OPM).
+
+ OPM is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OPM is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OPM. If not, see .
+ */
+
+#include
+
+namespace Opm::EclIO {
+
+struct SummaryNode {
+ enum class Category {
+ Well,
+ Group,
+ Field,
+ Region,
+ Block,
+ Connection,
+ Segment,
+ Miscellaneous,
+ };
+
+ enum class Type {
+ Rate,
+ Total,
+ Ratio,
+ Pressure,
+ Count,
+ Mode,
+ Undefined,
+ };
+
+ std::string keyword;
+ Category category;
+ Type type;
+ std::string wgname;
+ int number;
+
+ constexpr static int default_number { std::numeric_limits::min() };
+
+ std::string unique_key() const;
+ bool is_user_defined() const;
+};
+
+} // namespace Opm::EclIO
diff --git a/opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp b/opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp
index 20e9c4b08f1..3907061f7fc 100644
--- a/opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp
+++ b/opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp
@@ -21,8 +21,9 @@
#define GROUP2_HPP
-#include
#include