From e01910adc233702a914bc84dac81a8581424e8b4 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Mon, 26 Jul 2021 14:09:06 +0200 Subject: [PATCH] Add methods WellState::size() and WellState::producer() --- opm/simulators/wells/WellState.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/WellState.hpp b/opm/simulators/wells/WellState.hpp index 024fda5ab..9aec91607 100644 --- a/opm/simulators/wells/WellState.hpp +++ b/opm/simulators/wells/WellState.hpp @@ -71,9 +71,14 @@ public: const WellMapType& wellMap() const { return wellMap_; } WellMapType& wellMap() { return wellMap_; } + std::size_t size() const { + return this->wellMap_.size(); + } + + int numWells() const { - return wellMap_.size(); + return this->size(); } int wellIndex(const std::string& wellName) const; @@ -343,6 +348,11 @@ public: return this->status_.well_name(well_index); } + bool producer(std::size_t well_index) const { + return this->is_producer_[well_index]; + } + + private: WellMapType wellMap_; // Use of std::optional<> here is a technical crutch, the