From 860cfd9fb59a9b95e81ca88382ee0cef6ccca604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 17 Jun 2021 10:44:32 +0200 Subject: [PATCH] Fix some sign compare warnings. --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 6 +++--- opm/simulators/wells/GasLiftGroupInfo.hpp | 5 ++++- opm/simulators/wells/WellInterface.hpp | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 7bf0be8a5..eecafd8b0 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -892,7 +892,7 @@ namespace Opm { GasLiftGroupInfo &group_info, GLiftWellStateMap &state_map) { auto comm = ebosSimulator_.vanguard().grid().comm(); - std::size_t num_procs = comm.size(); + int num_procs = comm.size(); // NOTE: Gas lift optimization stage 1 seems to be difficult // to do in parallel since the wells are optimized on different // processes and each process needs to know the current ALQ allocated @@ -918,10 +918,10 @@ namespace Opm { // processes could take ownership of all the wells. Then there // would be no need for synchronization here.. // - for (std::size_t i = 0; i< num_procs; i++) { + for (int i = 0; i< num_procs; i++) { int num_rates_to_sync = 0; // communication variable GLiftSyncGroups groups_to_sync; - if (comm.rank() == i) { + if (comm.rank() == i) { // Run stage1: Optimize single wells while also checking group limits for (const auto& well : well_container_) { // NOTE: Only the wells in "group_info" needs to be optimized diff --git a/opm/simulators/wells/GasLiftGroupInfo.hpp b/opm/simulators/wells/GasLiftGroupInfo.hpp index 5be9adb1d..f478684c2 100644 --- a/opm/simulators/wells/GasLiftGroupInfo.hpp +++ b/opm/simulators/wells/GasLiftGroupInfo.hpp @@ -75,6 +75,9 @@ public: std::vector>& getWellGroups( const std::string& well_name); + // TODO: See comment below for initializeGroupRatesRecursive_() for why + // the implementation of initialize() is kept here in the header file instead + // of in the .cpp file... template void initialize(const Comm& comm) @@ -118,7 +121,7 @@ private: // class since we are also constructing a GasLiftGroupInfo object in the // test file test1_glift.cpp and when the linker tries to find a definition // of the GasLiftGroupInfo(...) constructor in libopmsimulators.a, - // the the template type of the MPI communicator (Dune::Communication<..>) + // the template type of the MPI communicator (Dune::Communication<..>) // is not of the same type as the one needed by the test case. // The test case needs Dune::Communication, whereas // the one in libopmsimulators.a is Dune::Communication. diff --git a/opm/simulators/wells/WellInterface.hpp b/opm/simulators/wells/WellInterface.hpp index 27a89080c..9d7e11b6d 100644 --- a/opm/simulators/wells/WellInterface.hpp +++ b/opm/simulators/wells/WellInterface.hpp @@ -41,7 +41,6 @@ namespace Opm { template class GasLiftSingleWell; template class BlackoilWellModel; - class GasLiftGroupInfo; } #include #include