23 #ifndef OPM_COLLECT_DATA_ON_IO_RANK_HPP 24 #define OPM_COLLECT_DATA_ON_IO_RANK_HPP 26 #include <opm/grid/common/p2pcommunicator.hh> 28 #include <opm/input/eclipse/Schedule/Well/WellTestState.hpp> 30 #include <opm/output/data/Aquifer.hpp> 31 #include <opm/output/data/Cells.hpp> 32 #include <opm/output/data/Groups.hpp> 33 #include <opm/output/data/Solution.hpp> 34 #include <opm/output/data/Wells.hpp> 36 #include <opm/simulators/flow/FlowsData.hpp> 44 #include <type_traits> 54 template <
class Gr
id,
class EquilGr
id,
class Gr
idView>
58 using CollectiveCommunication =
typename Grid::Communication;
59 using P2PCommunicatorType = Dune::Point2PointCommunicator<Dune::SimpleMessageBuffer>;
60 using IndexMapType = std::vector<int>;
61 using IndexMapStorageType = std::vector<IndexMapType>;
63 static constexpr
int dimension = Grid::dimension;
67 static const bool needsReordering =
68 !std::is_same<Grid, EquilGrid>::value;
71 const EquilGrid* equilGrid,
72 const GridView& gridView,
75 const std::set<std::string>& fipRegionsInterregFlow = {});
78 void collect(
const data::Solution& localCellData,
79 const std::map<std::pair<std::string, int>,
double>& localBlockData,
80 std::map<std::pair<std::string, int>,
double>& localExtraBlockData,
81 const data::Wells& localWellData,
82 const data::WellBlockAveragePressures& localWBPData,
83 const data::GroupAndNetworkValues& localGroupAndNetworkData,
84 const data::Aquifers& localAquiferData,
85 const WellTestState& localWellTestState,
90 const std::map<std::pair<std::string, int>,
double>& globalBlockData()
const 91 {
return globalBlockData_; }
93 const data::Solution& globalCellData()
const 94 {
return globalCellData_; }
96 data::Solution& globalCellData()
97 {
return globalCellData_; }
99 const data::Wells& globalWellData()
const 100 {
return globalWellData_; }
102 const data::WellBlockAveragePressures& globalWBPData()
const 103 {
return this->globalWBPData_; }
105 const data::GroupAndNetworkValues& globalGroupAndNetworkData()
const 106 {
return globalGroupAndNetworkData_; }
108 const data::Aquifers& globalAquiferData()
const 109 {
return globalAquiferData_; }
111 const WellTestState& globalWellTestState()
const 112 {
return this->globalWellTestState_; }
115 {
return this->globalInterRegFlows_; }
118 {
return this->globalInterRegFlows_; }
120 const std::array<FlowsData<double>, 3>& globalFlowsn()
const 121 {
return globalFlowsn_; }
123 const std::array<FlowsData<double>, 3>& globalFloresn()
const 124 {
return globalFloresn_; }
126 bool isIORank()
const 127 {
return toIORankComm_.rank() == ioRank; }
129 bool isParallel()
const 130 {
return toIORankComm_.size() > 1; }
132 int localIdxToGlobalIdx(
unsigned localIdx)
const;
134 const std::vector<int>& localIdxToGlobalIdxMapping()
const 136 return localIdxToGlobalIdx_;
139 bool doesNeedReordering()
const 140 {
return needsReordering;}
142 std::size_t numCells ()
const 143 {
return globalCartesianIndex_.size(); }
145 const std::vector<int>& globalRanks()
const 146 {
return globalRanks_; }
148 bool isCartIdxOnThisRank(
int cartIdx)
const;
151 P2PCommunicatorType toIORankComm_;
153 IndexMapType globalCartesianIndex_;
154 IndexMapType localIndexMap_;
155 IndexMapStorageType indexMaps_;
156 std::vector<int> globalRanks_;
157 data::Solution globalCellData_;
158 std::map<std::pair<std::string, int>,
double> globalBlockData_;
159 data::Wells globalWellData_;
160 data::WellBlockAveragePressures globalWBPData_;
161 data::GroupAndNetworkValues globalGroupAndNetworkData_;
162 data::Aquifers globalAquiferData_;
163 WellTestState globalWellTestState_;
164 std::vector<int> localIdxToGlobalIdx_;
165 std::array<FlowsData<double>, 3> globalFlowsn_;
166 std::array<FlowsData<double>, 3> globalFloresn_;
175 #endif // OPM_COLLECT_DATA_ON_IO_RANK_HPP Definition: CollectDataOnIORank.hpp:55
Definition: fvbaseprimaryvariables.hh:161
std::vector< int > sortedCartesianIdx_
sorted list of cartesian indices present-
Definition: CollectDataOnIORank.hpp:170
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Inter-region flow accumulation maps for all region definition arrays.
Definition: InterRegFlows.hpp:178
MPI-aware facility for converting collection of tuples of region ID pairs and associate flow rates in...
Simple container for FLOWS data.
Definition: FlowsData.hpp:31
Definition: CollectDataOnIORank.hpp:49