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> 25 #include <opm/simulators/utils/ParallelCommunication.hpp> 35 template<
class Scalar>
64 using Evaluator = std::function<void(int, SourceDataSpan<Scalar>)>;
79 const std::vector<std::size_t>& sourceLocations,
101 void reconstruct(
const std::vector<std::size_t>& sourceLocations,
126 std::reference_wrapper<const Parallel::Communication> comm_;
129 std::vector<LocalLocation> locations_{};
132 std::vector<Scalar> localSrc_{};
136 std::vector<typename std::vector<Scalar>::size_type> storageIndex_{};
139 std::vector<int> allSizes_{};
142 std::vector<int> startPointers_{};
151 [[nodiscard]]
typename std::vector<Scalar>::size_type
152 storageIndex(
typename std::vector<Scalar>::size_type elemIndex)
const override;
166 void finaliseConstruction(
const std::vector<std::size_t>& sourceLocations,
174 [[nodiscard]] SourceDataSpan<Scalar>
175 localSourceTerm(
const std::size_t localIx);
180 void defineCommunication();
185 #endif // PARALLEL_PAVG_DYNAMIC_SOURCE_DATA_HPP Dynamic source data for block-average pressure calculations.
Definition: ParallelPAvgDynamicSourceData.hpp:36
ParallelPAvgDynamicSourceData(const Parallel::Communication &comm, const std::vector< std::size_t > &sourceLocations, GlobalToLocal localCellIdx)
Constructor.
Definition: ParallelPAvgDynamicSourceData.cpp:38
typename PAvgDynamicSourceData< Scalar >::template SourceDataSpan< T > SourceDataSpan
Fixed-width span/view of a underlying range of contiguous elements.
Definition: ParallelPAvgDynamicSourceData.hpp:53
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
std::function< void(int, SourceDataSpan< Scalar >)> Evaluator
Collect source term contributions from local, on-rank, cell.
Definition: ParallelPAvgDynamicSourceData.hpp:64
void synchroniseSources()
Exchange local contributions to build full, global view of all source terms.
Definition: ParallelPAvgDynamicSourceData.cpp:73
void collectLocalSources(Evaluator eval)
Compute local, on-rank, contributions to the collection of source terms.
Definition: ParallelPAvgDynamicSourceData.cpp:63
std::function< int(const std::size_t)> GlobalToLocal
Translate globally unique, linearised Cartesian cell indices to local, on-rank, cell indices...
Definition: ParallelPAvgDynamicSourceData.hpp:42
void setToZero()
Clear contents of local source term contributions.
Definition: ParallelPAvgDynamicSourceData.cpp:48
void reconstruct(const std::vector< std::size_t > &sourceLocations, GlobalToLocal localCellIdx)
Reconstruct Source Data backing storage and internal mapping tables.
Definition: ParallelPAvgDynamicSourceData.cpp:55