diff --git a/opm/simulators/wells/WellState.cpp b/opm/simulators/wells/WellState.cpp index a4090a126..5fe341029 100644 --- a/opm/simulators/wells/WellState.cpp +++ b/opm/simulators/wells/WellState.cpp @@ -114,24 +114,6 @@ WellState::parallelWellInfo(std::size_t well_index) const return *parallel_well_info_[well_index]; } -bool WellState::wellIsOwned(std::size_t well_index, - [[maybe_unused]] const std::string& wellName) const -{ - const auto& well_info = parallelWellInfo(well_index); - assert(well_info.name() == wellName); - - return well_info.isOwner(); -} - -bool WellState::wellIsOwned(const std::string& wellName) const -{ - const auto& it = this->wellMap_.find( wellName ); - if (it == this->wellMap_.end()) { - OPM_THROW(std::logic_error, "Could not find well " << wellName << " in well map"); - } - const int well_index = it->second[0]; - return wellIsOwned(well_index, wellName); -} void WellState::shutWell(int well_index) { diff --git a/opm/simulators/wells/WellState.hpp b/opm/simulators/wells/WellState.hpp index 4c3ae74eb..315b75e60 100644 --- a/opm/simulators/wells/WellState.hpp +++ b/opm/simulators/wells/WellState.hpp @@ -111,10 +111,6 @@ public: const ParallelWellInfo& parallelWellInfo(std::size_t well_index) const; - bool wellIsOwned(std::size_t well_index, - const std::string& wellName) const; - - bool wellIsOwned(const std::string& wellName) const; /// The number of phases present. diff --git a/opm/simulators/wells/WellStateFullyImplicitBlackoil.cpp b/opm/simulators/wells/WellStateFullyImplicitBlackoil.cpp index cd5318508..3ecdc467d 100644 --- a/opm/simulators/wells/WellStateFullyImplicitBlackoil.cpp +++ b/opm/simulators/wells/WellStateFullyImplicitBlackoil.cpp @@ -975,6 +975,25 @@ WellStateFullyImplicitBlackoil::reportSegmentResults(const PhaseUsage& pu, return seg_res; } +bool WellStateFullyImplicitBlackoil::wellIsOwned(std::size_t well_index, + [[maybe_unused]] const std::string& wellName) const +{ + const auto& well_info = parallelWellInfo(well_index); + assert(well_info.name() == wellName); + + return well_info.isOwner(); +} + +bool WellStateFullyImplicitBlackoil::wellIsOwned(const std::string& wellName) const +{ + const auto& it = this->wellMap_.find( wellName ); + if (it == this->wellMap_.end()) { + OPM_THROW(std::logic_error, "Could not find well " << wellName << " in well map"); + } + const int well_index = it->second[0]; + return wellIsOwned(well_index, wellName); +} + int WellStateFullyImplicitBlackoil::numSegments(const int well_id) const { const auto topseg = this->topSegmentIndex(well_id); diff --git a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp index 05efe8f93..cdc1ec6ec 100644 --- a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp +++ b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp @@ -377,6 +377,11 @@ public: return this->global_well_info.value().well_name(index); } + bool wellIsOwned(std::size_t well_index, + const std::string& wellName) const; + + bool wellIsOwned(const std::string& wellName) const; + private: std::vector perfphaserates_; WellContainer is_producer_; // Size equal to number of local wells. @@ -492,6 +497,7 @@ private: // overhead) this is simpler than writing code to delete it. // void updateWellsDefaultALQ(const std::vector& wells_ecl); + }; } // namespace Opm