From 5e84c8d935428c919f79d3899b41b5faa619e804 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Thu, 28 Oct 2021 10:38:12 +0200 Subject: [PATCH] Add function GLiftOpt::num_wells() --- opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp | 1 + src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp b/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp index bd05397a1..a51571f65 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp @@ -267,6 +267,7 @@ public: bool active() const; bool has_well(const std::string& well) const; bool has_group(const std::string& group) const; + std::size_t num_wells() const; static GasLiftOpt serializeObject(); bool operator==(const GasLiftOpt& other) const; diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp index 4d01e76fa..20d11cf0d 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp @@ -72,6 +72,10 @@ bool GasLiftOpt::has_well(const std::string& wname) const { return (iter != this->m_wells.end()); } +std::size_t GasLiftOpt::num_wells() const { + return this->m_wells.size(); +} + bool GasLiftOpt::has_group(const std::string& gname) const { const auto iter = this->m_groups.find(gname); return (iter != this->m_groups.end());