From 84a2c3c209635c471412e53f79e365550eef12bd Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Thu, 5 Nov 2020 09:43:26 +0100 Subject: [PATCH] Add method Group::is_field() --- opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp | 1 + src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp | 4 ++++ tests/parser/GroupTests.cpp | 3 +++ 3 files changed, 8 insertions(+) diff --git a/opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp b/opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp index 20b7de0b5..62995765d 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp @@ -231,6 +231,7 @@ struct ProductionControls { bool defined(std::size_t timeStep) const; std::size_t insert_index() const; const std::string& name() const; + bool is_field() const; int getGroupNetVFPTable() const; bool updateNetVFPTable(int vfp_arg); diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp index 459da5caa..f32f002ed 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp @@ -134,6 +134,10 @@ const std::string& Group::name() const { return this->m_name; } +bool Group::is_field() const { + return (this->m_name == "FIELD"); +} + const Group::GroupProductionProperties& Group::productionProperties() const { return this->production_properties; } diff --git a/tests/parser/GroupTests.cpp b/tests/parser/GroupTests.cpp index e4a02aaf1..a2b7ff20e 100644 --- a/tests/parser/GroupTests.cpp +++ b/tests/parser/GroupTests.cpp @@ -523,6 +523,9 @@ BOOST_AUTO_TEST_CASE(GCONINJE_GCONPROD) { BOOST_CHECK(!g2.injectionGroupControlAvailable(Phase::WATER)); BOOST_CHECK( g1.injectionGroupControlAvailable(Phase::GAS)); BOOST_CHECK( g2.injectionGroupControlAvailable(Phase::GAS)); + + BOOST_CHECK(f.is_field()); + BOOST_CHECK(!g1.is_field()); } { const auto& g1 = schedule.getGroup("G1", 1);