From a6cb9134ffb863899b86b1b21b8b4c0d2f32848a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 17 Apr 2024 09:36:15 +0200 Subject: [PATCH] WellState: remove template parameters for comm use Parallel::Communication directly instead --- opm/simulators/wells/WellState.cpp | 17 ++++++----------- opm/simulators/wells/WellState.hpp | 26 ++++++++++++-------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/opm/simulators/wells/WellState.cpp b/opm/simulators/wells/WellState.cpp index 0af76e726..06b6c4132 100644 --- a/opm/simulators/wells/WellState.cpp +++ b/opm/simulators/wells/WellState.cpp @@ -438,10 +438,10 @@ WellState::currentWellRates(const std::string& wellName) const return it->second.second; } -template -void WellState::gatherVectorsOnRoot(const std::vector& from_connections, - std::vector& to_connections, - const Communication& comm) const +void WellState:: +gatherVectorsOnRoot(const std::vector& from_connections, + std::vector& to_connections, + const Parallel::Communication& comm) const { auto send = std::set{}; auto recv = std::set{}; @@ -836,8 +836,7 @@ void WellState::updateStatus(int well_index, WellStatus status) ws.updateStatus(status); } -template -void WellState::communicateGroupRates(const Comm& comm) +void WellState::communicateGroupRates(const Parallel::Communication& comm) { // Compute the size of the data. std::size_t sz = 0; @@ -885,8 +884,7 @@ void WellState::communicateGroupRates(const Comm& comm) assert(pos == sz); } -template -void WellState::updateGlobalIsGrup(const Comm& comm) +void WellState::updateGlobalIsGrup(const Parallel::Communication& comm) { this->global_well_info.value().clear(); for (std::size_t well_index = 0; well_index < this->size(); well_index++) { @@ -1025,7 +1023,4 @@ WellState::parallelWellInfo(std::size_t well_index) const return ws.parallel_info; } -template void WellState::updateGlobalIsGrup(const Parallel::Communication& comm); -template void WellState::communicateGroupRates(const Parallel::Communication& comm); - } // namespace Opm diff --git a/opm/simulators/wells/WellState.hpp b/opm/simulators/wells/WellState.hpp index cb79c86ee..88c88a1c9 100644 --- a/opm/simulators/wells/WellState.hpp +++ b/opm/simulators/wells/WellState.hpp @@ -21,10 +21,18 @@ #ifndef OPM_WELLSTATEFULLYIMPLICITBLACKOIL_HEADER_INCLUDED #define OPM_WELLSTATEFULLYIMPLICITBLACKOIL_HEADER_INCLUDED -#include +#include +#include #include +#include + +#include + +#include + +#include #include #include #include @@ -33,13 +41,6 @@ #include #include -#include - -#include - -#include -#include - #include #include #include @@ -129,10 +130,9 @@ public: this->well_rates.clear(); } - template void gatherVectorsOnRoot(const std::vector< data::Connection >& from_connections, std::vector< data::Connection >& to_connections, - const Communication& comm) const; + const Parallel::Communication& comm) const; data::Wells report(const int* globalCellIdxMap, @@ -150,11 +150,9 @@ public: const std::vector& perforation_rates, const int np, const int segment, std::vector& segment_rates); - template - void communicateGroupRates(const Comm& comm); + void communicateGroupRates(const Parallel::Communication& comm); - template - void updateGlobalIsGrup(const Comm& comm); + void updateGlobalIsGrup(const Parallel::Communication& comm); bool isInjectionGrup(const std::string& name) const { return this->global_well_info.value().in_injecting_group(name);