60#if DUNE_VERSION_GTE(DUNE_GRID, 2, 9)
61 using CollectiveCommunication =
typename Grid::Communication;
63 using CollectiveCommunication =
typename Grid::CollectiveCommunication;
65 using P2PCommunicatorType = Dune::Point2PointCommunicator<Dune::SimpleMessageBuffer>;
66 using IndexMapType = std::vector<int>;
67 using IndexMapStorageType = std::vector<IndexMapType>;
69 static constexpr int dimension = Grid::dimension;
73 static const bool needsReordering =
74 !std::is_same<Grid, EquilGrid>::value;
77 const EquilGrid* equilGrid,
78 const GridView& gridView,
81 const std::set<std::string>& fipRegionsInterregFlow = {});
84 void collect(
const data::Solution& localCellData,
85 const std::map<std::pair<std::string, int>,
double>& localBlockData,
86 const data::Wells& localWellData,
87 const data::WellBlockAveragePressures& localWBPData,
88 const data::GroupAndNetworkValues& localGroupAndNetworkData,
89 const data::Aquifers& localAquiferData,
90 const WellTestState& localWellTestState,
95 const std::map<std::pair<std::string, int>,
double>& globalBlockData()
const
96 {
return globalBlockData_; }
98 const data::Solution& globalCellData()
const
99 {
return globalCellData_; }
101 data::Solution& globalCellData()
102 {
return globalCellData_; }
104 const data::Wells& globalWellData()
const
105 {
return globalWellData_; }
107 const data::WellBlockAveragePressures& globalWBPData()
const
108 {
return this->globalWBPData_; }
110 const data::GroupAndNetworkValues& globalGroupAndNetworkData()
const
111 {
return globalGroupAndNetworkData_; }
113 const data::Aquifers& globalAquiferData()
const
114 {
return globalAquiferData_; }
116 const WellTestState& globalWellTestState()
const
117 {
return this->globalWellTestState_; }
120 {
return this->globalInterRegFlows_; }
123 {
return this->globalInterRegFlows_; }
125 const std::array<FlowsData<double>, 3>& globalFlowsn()
const
126 {
return globalFlowsn_; }
128 const std::array<FlowsData<double>, 3>& globalFloresn()
const
129 {
return globalFloresn_; }
131 bool isIORank()
const
132 {
return toIORankComm_.rank() == ioRank; }
134 bool isParallel()
const
135 {
return toIORankComm_.size() > 1; }
137 int localIdxToGlobalIdx(
unsigned localIdx)
const;
139 const std::vector<int>& localIdxToGlobalIdxMapping()
const
141 return localIdxToGlobalIdx_;
144 bool doesNeedReordering()
const
145 {
return needsReordering;}
147 std::size_t numCells ()
const
148 {
return globalCartesianIndex_.size(); }
150 const std::vector<int>& globalRanks()
const
151 {
return globalRanks_; }
153 bool isCartIdxOnThisRank(
int cartIdx)
const;
156 P2PCommunicatorType toIORankComm_;
158 IndexMapType globalCartesianIndex_;
159 IndexMapType localIndexMap_;
160 IndexMapStorageType indexMaps_;
161 std::vector<int> globalRanks_;
162 data::Solution globalCellData_;
163 std::map<std::pair<std::string, int>,
double> globalBlockData_;
164 data::Wells globalWellData_;
165 data::WellBlockAveragePressures globalWBPData_;
166 data::GroupAndNetworkValues globalGroupAndNetworkData_;
167 data::Aquifers globalAquiferData_;
168 WellTestState globalWellTestState_;
169 std::vector<int> localIdxToGlobalIdx_;
170 std::array<FlowsData<double>, 3> globalFlowsn_;
171 std::array<FlowsData<double>, 3> globalFloresn_;