20#ifndef PARALLEL_PAVG_DYNAMIC_SOURCE_DATA_HPP
21#define PARALLEL_PAVG_DYNAMIC_SOURCE_DATA_HPP
23#include <opm/input/eclipse/Schedule/Well/PAvgDynamicSourceData.hpp>
52 using Evaluator = std::function<void(
int, SourceDataSpan<double>)>;
67 const std::vector<std::size_t>& sourceLocations,
89 void reconstruct(
const std::vector<std::size_t>& sourceLocations,
114 std::reference_wrapper<const Parallel::Communication> comm_;
117 std::vector<LocalLocation> locations_{};
120 std::vector<double> localSrc_{};
124 std::vector<std::vector<double>::size_type> storageIndex_{};
127 std::vector<int> allSizes_{};
130 std::vector<int> startPointers_{};
139 [[nodiscard]] std::vector<double>::size_type
140 storageIndex(std::vector<double>::size_type elemIndex)
const override;
154 void finaliseConstruction(
const std::vector<std::size_t>& sourceLocations,
162 [[nodiscard]] SourceDataSpan<double>
163 localSourceTerm(
const std::size_t localIx);
168 void defineCommunication();
Definition: ParallelPAvgDynamicSourceData.hpp:36
ParallelPAvgDynamicSourceData(const Parallel::Communication &comm, const std::vector< std::size_t > &sourceLocations, GlobalToLocal localCellIdx)
void synchroniseSources()
void collectLocalSources(Evaluator eval)
void reconstruct(const std::vector< std::size_t > &sourceLocations, GlobalToLocal localCellIdx)
std::function< void(int, SourceDataSpan< double >)> Evaluator
Definition: ParallelPAvgDynamicSourceData.hpp:52
std::function< int(const std::size_t)> GlobalToLocal
Definition: ParallelPAvgDynamicSourceData.hpp:41
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
Definition: BlackoilPhases.hpp:27