WellState: remove template parameters for comm

use Parallel::Communication directly instead
This commit is contained in:
Arne Morten Kvarving 2024-04-17 09:36:15 +02:00
parent d3b22323f1
commit a6cb9134ff
2 changed files with 18 additions and 25 deletions

View File

@ -438,10 +438,10 @@ WellState::currentWellRates(const std::string& wellName) const
return it->second.second;
}
template<class Communication>
void WellState::gatherVectorsOnRoot(const std::vector<data::Connection>& from_connections,
std::vector<data::Connection>& to_connections,
const Communication& comm) const
void WellState::
gatherVectorsOnRoot(const std::vector<data::Connection>& from_connections,
std::vector<data::Connection>& to_connections,
const Parallel::Communication& comm) const
{
auto send = std::set<int>{};
auto recv = std::set<int>{};
@ -836,8 +836,7 @@ void WellState::updateStatus(int well_index, WellStatus status)
ws.updateStatus(status);
}
template<class Comm>
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<class Comm>
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<Parallel::Communication>(const Parallel::Communication& comm);
template void WellState::communicateGroupRates<Parallel::Communication>(const Parallel::Communication& comm);
} // namespace Opm

View File

@ -21,10 +21,18 @@
#ifndef OPM_WELLSTATEFULLYIMPLICITBLACKOIL_HEADER_INCLUDED
#define OPM_WELLSTATEFULLYIMPLICITBLACKOIL_HEADER_INCLUDED
#include <opm/common/ErrorMacros.hpp>
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/input/eclipse/Schedule/Events.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/simulators/utils/ParallelCommunication.hpp>
#include <opm/simulators/wells/ALQState.hpp>
#include <opm/simulators/wells/GlobalWellInfo.hpp>
#include <opm/simulators/wells/PerfData.hpp>
@ -33,13 +41,6 @@
#include <opm/simulators/wells/SingleWellState.hpp>
#include <opm/simulators/wells/WellContainer.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/input/eclipse/Schedule/Events.hpp>
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <functional>
#include <map>
#include <optional>
@ -129,10 +130,9 @@ public:
this->well_rates.clear();
}
template<class Communication>
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<double>& perforation_rates, const int np, const int segment, std::vector<double>& segment_rates);
template<class Comm>
void communicateGroupRates(const Comm& comm);
void communicateGroupRates(const Parallel::Communication& comm);
template<class Comm>
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);