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> 45 #include <type_traits> 55 template <
class Gr
id,
class EquilGr
id,
class Gr
idView>
59 using CollectiveCommunication =
typename Grid::Communication;
60 using P2PCommunicatorType = Dune::Point2PointCommunicator<Dune::SimpleMessageBuffer>;
61 using IndexMapType = std::vector<int>;
62 using IndexMapStorageType = std::vector<IndexMapType>;
64 static constexpr
int dimension = Grid::dimension;
68 static const bool needsReordering =
69 !std::is_same<Grid, EquilGrid>::value;
72 const EquilGrid* equilGrid,
73 const GridView& gridView,
76 const std::set<std::string>& fipRegionsInterregFlow = {});
79 void collect(
const data::Solution& localCellData,
80 const std::map<std::pair<std::string, int>,
double>& localBlockData,
81 std::map<std::pair<std::string, int>,
double>& localExtraBlockData,
82 const data::Wells& localWellData,
83 const data::WellBlockAveragePressures& localWBPData,
84 const data::GroupAndNetworkValues& localGroupAndNetworkData,
85 const data::Aquifers& localAquiferData,
86 const WellTestState& localWellTestState,
90 const std::map<std::tuple<std::string, int, int>,
double>& localLgrBlockData);
92 const std::map<std::pair<std::string, int>,
double>& globalBlockData()
const 93 {
return globalBlockData_; }
95 const std::map<std::tuple<std::string, int, int>,
double>& globalLgrBlockData()
const 96 {
return globalLgrBlockData_; }
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 std::map<std::tuple<std::string, int, int>,
double> globalLgrBlockData_;
165 data::Wells globalWellData_;
166 data::WellBlockAveragePressures globalWBPData_;
167 data::GroupAndNetworkValues globalGroupAndNetworkData_;
168 data::Aquifers globalAquiferData_;
169 WellTestState globalWellTestState_;
170 std::vector<int> localIdxToGlobalIdx_;
171 std::array<FlowsData<double>, 3> globalFlowsn_;
172 std::array<FlowsData<double>, 3> globalFloresn_;
181 #endif // OPM_COLLECT_DATA_ON_IO_RANK_HPP Definition: CollectDataOnIORank.hpp:56
Definition: fvbaseprimaryvariables.hh:161
std::vector< int > sortedCartesianIdx_
sorted list of cartesian indices present-
Definition: CollectDataOnIORank.hpp:176
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
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:50