From eda46d4fbe5dad5cc9aac465dd5fd355cda68bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 9 May 2012 16:09:13 +0200 Subject: [PATCH] Add a query method to answer whether or not the deck defines any wells. --- opm/core/WellsManager.cpp | 6 ++++++ opm/core/WellsManager.hpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/opm/core/WellsManager.cpp b/opm/core/WellsManager.cpp index 6d3b782e3..5c6efb53d 100644 --- a/opm/core/WellsManager.cpp +++ b/opm/core/WellsManager.cpp @@ -672,6 +672,12 @@ namespace Opm } + /// Does the "deck" define any wells? + bool WellsManager::empty() const + { + return (w_ == 0) || (w_->number_of_wells == 0); + } + /// Access the managed Wells. diff --git a/opm/core/WellsManager.hpp b/opm/core/WellsManager.hpp index cdae43c16..32b04e034 100644 --- a/opm/core/WellsManager.hpp +++ b/opm/core/WellsManager.hpp @@ -53,7 +53,9 @@ namespace Opm /// Destructor. ~WellsManager(); - + + /// Does the "deck" define any wells? + bool empty() const; /// Access the managed Wells. /// The method is named similarly to c_str() in std::string,