24#ifndef OPM_COLLECT_DATA_ON_IO_RANK_IMPL_HPP
25#define OPM_COLLECT_DATA_ON_IO_RANK_IMPL_HPP
29#include <dune/common/version.hh>
30#include <dune/grid/common/gridenums.hh>
31#include <dune/grid/common/mcmgmapper.hh>
32#include <dune/grid/common/partitionset.hh>
34#include <opm/grid/common/CartesianIndexMapper.hpp>
64 { isInterior_ =
false; }
67 { globalId_ = globalId; }
72 {
return localIndex_; }
76 {
return isInterior_; }
95 const std::vector<int>& distributedGlobalIndex,
98 std::vector<int>& ranks,
108 std::size_t size = globalIndex.size();
111 for (std::size_t index = 0; index < size; ++index)
121 indexMap.resize(localSize);
122 for (std::size_t i = 0; i < localSize; ++i)
142 if (rankIt !=
recv_.end())
145 for (
auto&& entry: indexMap)
149 entry = candidate->second;
157 for (
const auto& rank:
ranks_)
167 throw std::logic_error(
"link in method pack is not 0 as execpted");
173 for (
int index = 0; index < size; ++index) {
175 buffer.write(globalIdx);
187 buffer.read(numCells);
188 indexMap.resize(numCells);
189 for (
int index = 0; index < numCells; ++index) {
190 buffer.read(indexMap[index]);
197template<
class EquilMapper,
class Mapper>
202 : sendMapper_(sendMapper), recvMapper_(recvMapper), elementIndices_(elementIndices)
215 template<
class B,
class T>
218 buffer.write(sendMapper_.index(t));
220 template<
class B,
class T>
221 void scatter(B& buffer,
const T& t, std::size_t)
223 buffer.read(elementIndices_[recvMapper_.index(t)]);
228 return dim==3 && codim==0;
231 const EquilMapper& sendMapper_;
232 const Mapper& recvMapper_;
233 std::vector<int>& elementIndices_;
237template<
class Mapper>
242 : mapper_(mapper), elementIndices_(elementIndices)
255 template<
class B,
class T>
258 buffer.write(elementIndices_[mapper_.index(t)]);
260 template<
class B,
class T>
261 void scatter(B& buffer,
const T& t, std::size_t)
263 buffer.read(elementIndices_[mapper_.index(t)]);
268 return dim==3 && codim==0;
271 const Mapper& mapper_;
272 std::vector<int>& elementIndices_;
277 const data::Solution& localCellData_;
278 data::Solution& globalCellData_;
285 data::Solution& globalCellData,
288 std::size_t globalSize,
290 : localCellData_(localCellData)
291 , globalCellData_(globalCellData)
292 , localIndexMap_(localIndexMap)
293 , indexMaps_(indexMaps)
297 for (
const auto& pair : localCellData_) {
298 const std::string& key = pair.first;
299 std::size_t containerSize = globalSize;
300 [[maybe_unused]]
auto ret = globalCellData_.insert(key, pair.second.dim,
301 std::vector<double>(containerSize),
319 throw std::logic_error(
"link in method pack is not 0 as expected");
322 for (
const auto& pair : localCellData_) {
323 const auto& data = pair.second.data<
double>();
326 write(buffer, localIndexMap_, data);
334 for (
auto& pair : localCellData_) {
335 const std::string& key = pair.first;
336 auto& data = globalCellData_.data<
double>(key);
339 read(buffer, indexMap, data);
345 {
doUnpack(indexMaps_[link], buffer); }
348 template <
class Vector>
351 const Vector& vector,
352 unsigned int offset = 0,
353 unsigned int stride = 1)
const
355 unsigned int size = localIndexMap.size();
357 assert(vector.size() >= stride * size);
358 for (
unsigned int i=0; i<size; ++i)
360 unsigned int index = localIndexMap[i] * stride + offset;
361 assert(index < vector.size());
362 buffer.write(vector[index]);
366 template <
class Vector>
370 unsigned int offset = 0,
371 unsigned int stride = 1)
const
373 unsigned int size = 0;
375 assert(size == indexMap.size());
376 for (
unsigned int i=0; i<size; ++i) {
377 unsigned int index = indexMap[i] * stride + offset;
378 assert(index < vector.size());
379 buffer.read(vector[index]);
386 const data::Wells& localWellData_;
387 data::Wells& globalWellData_;
391 data::Wells& globalWellData,
393 : localWellData_(localWellData)
394 , globalWellData_(globalWellData)
402 unpack(dummyLink, buffer);
411 throw std::logic_error(
"link in method pack is not 0 as expected");
413 localWellData_.write(buffer);
418 { globalWellData_.read(buffer); }
424 const data::GroupAndNetworkValues& localGroupAndNetworkData_;
425 data::GroupAndNetworkValues& globalGroupAndNetworkData_;
429 data::GroupAndNetworkValues& globalGroupAndNetworkData,
431 : localGroupAndNetworkData_ (localGroupAndNetworkData)
432 , globalGroupAndNetworkData_(globalGroupAndNetworkData)
434 if (! isIORank) {
return; }
437 this->
pack(0, buffer);
440 const int dummyLink = -1;
441 this->
unpack(dummyLink, buffer);
449 throw std::logic_error {
450 "link in method pack is not 0 as expected"
455 this->localGroupAndNetworkData_.write(buffer);
460 { this->globalGroupAndNetworkData_.read(buffer); }
473 std::ranges::input_range<C> &&
475 typename C::key_type;
476 typename C::mapped_type;
478 requires (C& container,
479 const typename C::key_type& key,
480 typename C::mapped_type value)
482 { container.insert_or_assign(key, std::move(value)) };
487template <MapLikeContainer C>
488using KeyTypeOf = std::remove_const_t<typename std::ranges::range_value_t<C>::first_type>;
490template <MapLikeContainer C>
491using MappedTypeOf =
typename std::ranges::range_value_t<C>::second_type;
493template <MapLikeContainer KeyedMap,
class MessageBufferType>
496 const unsigned int size = localData.size();
498 for (
const auto& [key, value] : localData) {
499 std::apply([&buffer](
const auto&... field) { (buffer.write(field), ...); }, key);
504template <MapLikeContainer KeyedMap,
class MessageBufferType>
507 unsigned int size = 0;
512 if constexpr (
requires (KeyedMap& m, std::size_t n) { m.reserve(n); }) {
513 globalData.reserve(globalData.size() + size);
516 for (
unsigned int i = 0; i < size; ++i) {
518 std::apply([&buffer](
auto&... field) { (buffer.read(field), ...); }, key);
526 globalData.insert_or_assign(std::move(key), std::move(value));
532 const std::map<std::pair<std::string, int>,
double>& localBlockData_;
533 std::map<std::pair<std::string, int>,
double>& globalBlockValues_;
537 std::map<std::pair<std::string, int>,
double>& globalBlockValues,
539 : localBlockData_(localBlockData)
540 , globalBlockValues_(globalBlockValues)
548 unpack(dummyLink, buffer);
557 throw std::logic_error(
"link in method pack is not 0 as expected");
571 const std::map<std::tuple<std::string, int, int>,
double>& localLgrBlockData_;
572 std::map<std::tuple<std::string, int, int>,
double>& globalLgrBlockValues_;
576 std::map<std::tuple<std::string, int, int>,
double>& globalLgrBlockValues,
578 : localLgrBlockData_(localLgrBlockData)
579 , globalLgrBlockValues_(globalLgrBlockValues)
587 unpack(dummyLink, buffer);
596 throw std::logic_error(
"link in method pack is not 0 as expected");
611 const data::WellBlockAveragePressures& localWBPData_;
612 data::WellBlockAveragePressures& globalWBPValues_;
616 data::WellBlockAveragePressures& globalWBPValues,
618 : localWBPData_ (localWBPData)
619 , globalWBPValues_(globalWBPValues)
629 const int dummyLink = -1;
630 unpack(dummyLink, buffer);
638 throw std::logic_error {
640 ") in method pack() is not 0 as expected"
645 this->localWBPData_.write(buffer);
649 void unpack([[maybe_unused]]
const int link,
652 this->globalWBPValues_.read(buffer);
660 WellTestState& globalWTestState,
662 : local_(localWTestState)
663 , global_(globalWTestState)
671 unpack(dummyLink, buffer);
677 throw std::logic_error(
"link in method pack is not 0 as expected");
678 this->local_.pack(buffer);
682 this->global_.unpack(buffer);
686 const WellTestState& local_;
687 WellTestState& global_;
692 const data::Aquifers& localAquiferData_;
693 data::Aquifers& globalAquiferData_;
697 data::Aquifers& globalAquiferData,
699 : localAquiferData_(localAquiferData)
700 , globalAquiferData_(globalAquiferData)
708 unpack(dummyLink, buffer);
717 throw std::logic_error(
"link in method pack is not 0 as expected");
719 int size = localAquiferData_.size();
721 for (
const auto& [key, data] : localAquiferData_) {
732 for (
int i = 0; i < size; ++i) {
735 data::AquiferData data;
738 auto& aq = this->globalAquiferData_[key];
740 this->unpackCommon(data, aq);
742 if (
auto const* aquFet = data.typeData.get<data::AquiferType::Fetkovich>();
745 this->unpackAquFet(*aquFet, aq);
747 else if (
auto const* aquCT = data.typeData.get<data::AquiferType::CarterTracy>();
750 this->unpackCarterTracy(*aquCT, aq);
752 else if (
auto const* aquNum = data.typeData.get<data::AquiferType::Numerical>();
755 this->unpackNumericAquifer(*aquNum, aq);
761 void unpackCommon(
const data::AquiferData& data, data::AquiferData& aq)
763 aq.aquiferID = std::max(aq.aquiferID, data.aquiferID);
764 aq.pressure = std::max(aq.pressure, data.pressure);
765 aq.initPressure = std::max(aq.initPressure, data.initPressure);
766 aq.datumDepth = std::max(aq.datumDepth, data.datumDepth);
767 aq.fluxRate += data.fluxRate;
768 aq.volume += data.volume;
771 void unpackAquFet(
const data::FetkovichData& aquFet, data::AquiferData& aq)
773 if (! aq.typeData.is<data::AquiferType::Fetkovich>()) {
774 auto* tData = aq.typeData.create<data::AquiferType::Fetkovich>();
778 const auto& src = aquFet;
779 auto& dst = *aq.typeData.getMutable<data::AquiferType::Fetkovich>();
781 dst.initVolume = std::max(dst.initVolume , src.initVolume);
782 dst.prodIndex = std::max(dst.prodIndex , src.prodIndex);
783 dst.timeConstant = std::max(dst.timeConstant, src.timeConstant);
787 void unpackCarterTracy(
const data::CarterTracyData& aquCT, data::AquiferData& aq)
789 if (! aq.typeData.is<data::AquiferType::CarterTracy>()) {
790 auto* tData = aq.typeData.create<data::AquiferType::CarterTracy>();
794 const auto& src = aquCT;
795 auto& dst = *aq.typeData.getMutable<data::AquiferType::CarterTracy>();
797 dst.timeConstant = std::max(dst.timeConstant , src.timeConstant);
798 dst.influxConstant = std::max(dst.influxConstant, src.influxConstant);
799 dst.waterDensity = std::max(dst.waterDensity , src.waterDensity);
800 dst.waterViscosity = std::max(dst.waterViscosity, src.waterViscosity);
802 dst.dimensionless_time = std::max(dst.dimensionless_time , src.dimensionless_time);
803 dst.dimensionless_pressure = std::max(dst.dimensionless_pressure, src.dimensionless_pressure);
807 void unpackNumericAquifer(
const data::NumericAquiferData& aquNum, data::AquiferData& aq)
809 if (! aq.typeData.is<data::AquiferType::Numerical>()) {
810 auto* tData = aq.typeData.create<data::AquiferType::Numerical>();
814 const auto& src = aquNum;
815 auto& dst = *aq.typeData.getMutable<data::AquiferType::Numerical>();
817 std::ranges::transform(src.initPressure, dst.initPressure, dst.initPressure.begin(),
818 [](
const double p0_1,
const double p0_2)
819 { return std::max(p0_1, p0_2); });
833 : localInterRegFlows_(localInterRegFlows)
834 , globalInterRegFlows_(globalInterRegFlows)
836 if (! isIORank) {
return; }
839 this->
pack(0, buffer);
842 const int dummyLink = -1;
843 this->
unpack(dummyLink, buffer);
851 throw std::logic_error {
852 "link in method pack is not 0 as expected"
857 this->localInterRegFlows_.
write(buffer);
862 { this->globalInterRegFlows_.
read(buffer); }
867 const std::array<FlowsData<double>, 3>& localFlows_;
868 std::array<FlowsData<double>, 3>& globalFlows_;
874 : localFlows_(localFlows)
875 , globalFlows_(globalFlows)
877 if (! isIORank) {
return; }
880 this->
pack(0, buffer);
883 const int dummyLink = -1;
884 this->
unpack(dummyLink, buffer);
890 throw std::logic_error(
"link in method pack is not 0 as expected");
891 for (
int i = 0; i < 3; ++i) {
892 const auto& name = localFlows_[i].name;
894 const std::size_t size = localFlows_[i].indices.size();
896 for (std::size_t j = 0; j < size; ++j) {
897 const auto& nncIdx = localFlows_[i].indices[j];
898 buffer.write(nncIdx);
899 const auto& flows = localFlows_[i].values[j];
907 for (
int i = 0; i < 3; ++i) {
910 globalFlows_[i].name = name;
911 std::size_t size = 0;
913 for (
unsigned int j = 0; j < size; ++j) {
921 globalFlows_[i].values[nncIdx] = data;
927template <
class Gr
id,
class EquilGr
id,
class Gr
idView>
930 const GridView& localGridView,
933 const std::set<std::string>& fipRegionsInterregFlow)
934 : toIORankComm_(grid.comm())
936 fipRegionsInterregFlow.begin(),
937 fipRegionsInterregFlow.end()
941 if ((!needsReordering && !isParallel()) || (isParallel() && (grid.maxLevel()>0)))
944 const CollectiveCommunication& comm = grid.comm();
947 std::set<int> send, recv;
948 using EquilGridView =
typename EquilGrid::LeafGridView;
949 typename std::is_same<Grid, EquilGrid>::type isSameGrid;
951 typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView> ElementMapper;
952 ElementMapper elemMapper(localGridView, Dune::mcmgElementLayout());
953 sortedCartesianIdx_.reserve(localGridView.size(0));
955 for (
const auto& elem : elements(localGridView, Dune::Partitions::interior))
957 auto idx = elemMapper.index(elem);
958 sortedCartesianIdx_.push_back(cartMapper.cartesianIndex(idx));
961 std::ranges::sort(sortedCartesianIdx_);
962 localIdxToGlobalIdx_.resize(localGridView.size(0), -1);
969 const std::size_t globalSize = equilGrid->leafGridView().size(0);
970 globalCartesianIndex_.resize(globalSize, -1);
971 const EquilGridView equilGridView = equilGrid->leafGridView();
973 using EquilElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<EquilGridView>;
974 EquilElementMapper equilElemMapper(equilGridView, Dune::mcmgElementLayout());
977 if constexpr (isSameGrid) {
978 ElementIndexScatterHandle<EquilElementMapper,ElementMapper> handle(equilElemMapper, elemMapper, localIdxToGlobalIdx_);
979 grid.scatterData(handle);
983 for (
const auto& elem : elements(equilGrid->leafGridView())) {
984 int elemIdx = equilElemMapper.index(elem);
985 int cartElemIdx = equilCartMapper->cartesianIndex(elemIdx);
986 globalCartesianIndex_[elemIdx] = cartElemIdx;
989 for (
int i = 0; i < comm.size(); ++i) {
1002 if constexpr (isSameGrid) {
1003 ElementIndexScatterHandle<ElementMapper, ElementMapper> handle(elemMapper, elemMapper, localIdxToGlobalIdx_);
1004 grid.scatterData(handle);
1009 if constexpr (isSameGrid) {
1010 ElementIndexHandle<ElementMapper> handle(elemMapper, localIdxToGlobalIdx_);
1011 grid.communicate(handle, Dune::InteriorBorder_All_Interface,
1012 Dune::ForwardCommunication);
1015 localIndexMap_.clear();
1016 const std::size_t gridSize = grid.size(0);
1017 localIndexMap_.reserve(gridSize);
1021 distributedCartesianIndex.resize(gridSize, -1);
1024 for (
const auto& elem : elements(localGridView, Dune::Partitions::interior)) {
1025 int elemIdx = elemMapper.index(elem);
1026 distributedCartesianIndex[elemIdx] = cartMapper.cartesianIndex(elemIdx);
1029 assert(elem.partitionType() == Dune::InteriorEntity);
1031 localIndexMap_.push_back(elemIdx);
1035 toIORankComm_.insertRequest(send, recv);
1039 indexMaps_.resize(comm.size());
1042 DistributeIndexMapping distIndexMapping(globalCartesianIndex_,
1043 distributedCartesianIndex,
1049 toIORankComm_.exchange(distIndexMapping);
1053template <
class Gr
id,
class EquilGr
id,
class Gr
idView>
1055collect(
const data::Solution& localCellData,
1056 const std::map<std::pair<std::string, int>,
double>& localBlockData,
1057 std::map<std::pair<std::string, int>,
double>& extraBlockData,
1058 const data::Wells& localWellData,
1059 const data::WellBlockAveragePressures& localWBPData,
1060 const data::GroupAndNetworkValues& localGroupAndNetworkData,
1061 const data::Aquifers& localAquiferData,
1062 const WellTestState& localWellTestState,
1066 const std::map<std::tuple<std::string, int, int>,
double>& localLgrBlockData)
1068 globalCellData_ = {};
1069 globalBlockData_.clear();
1070 globalLgrBlockData_.clear();
1071 std::map<std::pair<std::string,int>,
double> globalExtraBlockData;
1072 globalWellData_.clear();
1073 globalWBPData_.values.clear();
1074 globalGroupAndNetworkData_.clear();
1075 globalAquiferData_.clear();
1076 globalWellTestState_.clear();
1077 this->globalInterRegFlows_.clear();
1079 globalFloresn_ = {};
1082 if(!needsReordering && !isParallel())
1088 this->globalCellData_,
1089 this->localIndexMap_,
1095 if (! isParallel()) {
1101 for (
int i = 0; i < 3; ++i) {
1102 const std::size_t sizeFlr = localFloresn[i].indices.size();
1103 globalFloresn_[i].resize(sizeFlr);
1104 const std::size_t sizeFlo = localFlowsn[i].indices.size();
1105 globalFlowsn_[i].resize(sizeFlo);
1110 this->globalWellData_,
1115 localGroupAndNetworkData,
1116 this->globalGroupAndNetworkData_,
1122 this->globalBlockData_,
1128 globalExtraBlockData,
1134 this->globalLgrBlockData_,
1140 this->globalWBPData_,
1146 this->globalAquiferData_,
1152 this->globalWellTestState_,
1158 this->globalInterRegFlows_,
1164 this->globalFlowsn_,
1170 this->globalFloresn_,
1174 toIORankComm_.exchange(packUnpackCellData);
1175 toIORankComm_.exchange(packUnpackWellData);
1176 toIORankComm_.exchange(packUnpackGroupAndNetworkData);
1177 toIORankComm_.exchange(packUnpackBlockData);
1178 toIORankComm_.exchange(packUnpackExtraBlockData);
1179 toIORankComm_.exchange(packUnpackLgrBlockData);
1180 toIORankComm_.exchange(packUnpackWBPData);
1181 toIORankComm_.exchange(packUnpackAquiferData);
1182 toIORankComm_.exchange(packUnpackWellTestState);
1183 toIORankComm_.exchange(packUnpackInterRegFlows);
1184 toIORankComm_.exchange(packUnpackFlowsn);
1185 toIORankComm_.exchange(packUnpackFloresn);
1189 toIORankComm_.barrier();
1192 extraBlockData = globalExtraBlockData;
1195template <
class Gr
id,
class EquilGr
id,
class Gr
idView>
1199 if (!isParallel()) {
1203 if (this->localIdxToGlobalIdx_.empty()) {
1204 throw std::logic_error(
"index map is not created on this rank");
1207 if (localIdx >= this->localIdxToGlobalIdx_.size()) {
1208 throw std::logic_error(
"local index is outside map range");
1211 return this->localIdxToGlobalIdx_[localIdx];
1214template <
class Gr
id,
class EquilGr
id,
class Gr
idView>
1218 if (! this->isParallel()) {
1222 assert (! needsReordering);
1224 auto candidate = std::lower_bound(this->sortedCartesianIdx_.begin(),
1225 this->sortedCartesianIdx_.end(),
1228 return (candidate != sortedCartesianIdx_.end())
1229 && (*candidate == cartIdx);
Definition: CollectDataOnIORank.hpp:50
int localIdxToGlobalIdx(unsigned localIdx) const
Definition: CollectDataOnIORank_impl.hpp:1197
bool isCartIdxOnThisRank(int cartIdx) const
Definition: CollectDataOnIORank_impl.hpp:1216
CollectDataOnIORank(const Grid &grid, const EquilGrid *equilGrid, const GridView &gridView, const Dune::CartesianIndexMapper< Grid > &cartMapper, const Dune::CartesianIndexMapper< EquilGrid > *equilCartMapper, const std::set< std::string > &fipRegionsInterregFlow={})
Definition: CollectDataOnIORank_impl.hpp:929
std::vector< int > IndexMapType
Definition: CollectDataOnIORank.hpp:61
void collect(const data::Solution &localCellData, const std::map< std::pair< std::string, int >, double > &localBlockData, std::map< std::pair< std::string, int >, double > &localExtraBlockData, const data::Wells &localWellData, const data::WellBlockAveragePressures &localWBPData, const data::GroupAndNetworkValues &localGroupAndNetworkData, const data::Aquifers &localAquiferData, const WellTestState &localWellTestState, const InterRegFlowMap &interRegFlows, const std::array< FlowsData< double >, 3 > &localFlowsn, const std::array< FlowsData< double >, 3 > &localFloresn, const std::map< std::tuple< std::string, int, int >, double > &localLgrBlockData)
Definition: CollectDataOnIORank_impl.hpp:1055
Definition: CollectDataOnIORank_impl.hpp:84
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:163
std::map< int, int > globalPosition_
Definition: CollectDataOnIORank_impl.hpp:89
std::vector< int > & ranks_
Definition: CollectDataOnIORank_impl.hpp:91
IndexMapStorageType & indexMaps_
Definition: CollectDataOnIORank_impl.hpp:88
DistributeIndexMapping(const std::vector< int > &globalIndex, const std::vector< int > &distributedGlobalIndex, IndexMapType &localIndexMap, IndexMapStorageType &indexMaps, std::vector< int > &ranks, std::set< int > &recv, bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:94
IndexMapType & localIndexMap_
Definition: CollectDataOnIORank_impl.hpp:87
const std::vector< int > & distributedGlobalIndex_
Definition: CollectDataOnIORank_impl.hpp:86
void unpack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:179
~DistributeIndexMapping()
Definition: CollectDataOnIORank_impl.hpp:130
std::set< int > & recv_
Definition: CollectDataOnIORank_impl.hpp:90
Communication handle to scatter the global index.
Definition: CollectDataOnIORank_impl.hpp:239
std::size_t size(const T &)
Definition: CollectDataOnIORank_impl.hpp:251
bool fixedSize(int, int)
Definition: CollectDataOnIORank_impl.hpp:245
void scatter(B &buffer, const T &t, std::size_t)
Definition: CollectDataOnIORank_impl.hpp:261
void gather(B &buffer, const T &t)
Definition: CollectDataOnIORank_impl.hpp:256
int DataType
Definition: CollectDataOnIORank_impl.hpp:244
bool contains(int dim, int codim)
Definition: CollectDataOnIORank_impl.hpp:266
ElementIndexHandle(const Mapper &mapper, std::vector< int > &elementIndices)
Definition: CollectDataOnIORank_impl.hpp:241
Communication handle to scatter the global index.
Definition: CollectDataOnIORank_impl.hpp:199
std::size_t size(const T &)
Definition: CollectDataOnIORank_impl.hpp:211
bool contains(int dim, int codim)
Definition: CollectDataOnIORank_impl.hpp:226
void gather(B &buffer, const T &t)
Definition: CollectDataOnIORank_impl.hpp:216
ElementIndexScatterHandle(const EquilMapper &sendMapper, const Mapper &recvMapper, std::vector< int > &elementIndices)
Definition: CollectDataOnIORank_impl.hpp:201
void scatter(B &buffer, const T &t, std::size_t)
Definition: CollectDataOnIORank_impl.hpp:221
bool fixedSize(int, int)
Definition: CollectDataOnIORank_impl.hpp:205
int DataType
Definition: CollectDataOnIORank_impl.hpp:204
Definition: CollectDataOnIORank_impl.hpp:52
int localIndex() const
Definition: CollectDataOnIORank_impl.hpp:71
void setIndex(int localIndex)
Definition: CollectDataOnIORank_impl.hpp:68
int id() const
Definition: CollectDataOnIORank_impl.hpp:73
GlobalCellIndex()
Definition: CollectDataOnIORank_impl.hpp:58
void setGhost()
Definition: CollectDataOnIORank_impl.hpp:63
bool isInterior() const
Definition: CollectDataOnIORank_impl.hpp:75
void setId(int globalId)
Definition: CollectDataOnIORank_impl.hpp:66
Inter-region flow accumulation maps for all region definition arrays.
Definition: InterRegFlows.hpp:179
void read(MessageBufferType &buffer)
Definition: InterRegFlows.hpp:323
void write(MessageBufferType &buffer) const
Definition: InterRegFlows.hpp:296
Definition: CollectDataOnIORank_impl.hpp:691
void unpack(int, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:728
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:713
PackUnPackAquiferData(const data::Aquifers &localAquiferData, data::Aquifers &globalAquiferData, bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:696
Definition: CollectDataOnIORank_impl.hpp:531
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:553
PackUnPackBlockData(const std::map< std::pair< std::string, int >, double > &localBlockData, std::map< std::pair< std::string, int >, double > &globalBlockValues, bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:536
void unpack(int, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:563
Definition: CollectDataOnIORank_impl.hpp:276
void unpack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:344
PackUnPackCellData(const data::Solution &localCellData, data::Solution &globalCellData, const IndexMapType &localIndexMap, const IndexMapStorageType &indexMaps, std::size_t globalSize, bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:284
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:315
void read(MessageBufferType &buffer, const IndexMapType &indexMap, Vector &vector, unsigned int offset=0, unsigned int stride=1) const
Definition: CollectDataOnIORank_impl.hpp:367
void write(MessageBufferType &buffer, const IndexMapType &localIndexMap, const Vector &vector, unsigned int offset=0, unsigned int stride=1) const
Definition: CollectDataOnIORank_impl.hpp:349
void doUnpack(const IndexMapType &indexMap, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:330
Definition: CollectDataOnIORank_impl.hpp:423
void unpack(int, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:459
PackUnPackGroupAndNetworkValues(const data::GroupAndNetworkValues &localGroupAndNetworkData, data::GroupAndNetworkValues &globalGroupAndNetworkData, const bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:428
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:445
Definition: CollectDataOnIORank_impl.hpp:570
void unpack(int, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:603
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:592
PackUnPackLgrBlockData(const std::map< std::tuple< std::string, int, int >, double > &localLgrBlockData, std::map< std::tuple< std::string, int, int >, double > &globalLgrBlockValues, bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:575
Definition: CollectDataOnIORank_impl.hpp:610
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:634
PackUnPackWBPData(const data::WellBlockAveragePressures &localWBPData, data::WellBlockAveragePressures &globalWBPValues, const bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:615
void unpack(const int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:649
Definition: CollectDataOnIORank_impl.hpp:385
PackUnPackWellData(const data::Wells &localWellData, data::Wells &globalWellData, bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:390
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:407
void unpack(int, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:417
Definition: CollectDataOnIORank_impl.hpp:657
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:675
PackUnPackWellTestState(const WellTestState &localWTestState, WellTestState &globalWTestState, bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:659
void unpack(int, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:681
Definition: CollectDataOnIORank_impl.hpp:866
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:887
void unpack(int, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:905
PackUnpackFlows(const std::array< FlowsData< double >, 3 > &localFlows, std::array< FlowsData< double >, 3 > &globalFlows, const bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:871
Definition: CollectDataOnIORank_impl.hpp:825
void pack(int link, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:847
void unpack(int, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:861
PackUnpackInterRegFlows(const InterRegFlowMap &localInterRegFlows, InterRegFlowMap &globalInterRegFlows, const bool isIORank)
Definition: CollectDataOnIORank_impl.hpp:830
Definition: CollectDataOnIORank_impl.hpp:472
static constexpr int dim
Definition: structuredgridvanguard.hh:68
Definition: blackoilbioeffectsmodules.hh:45
std::vector< int > IndexMapType
Definition: CollectDataOnIORank_impl.hpp:79
void packKeyedBlockMap(const KeyedMap &localData, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:494
std::remove_const_t< typename std::ranges::range_value_t< C >::first_type > KeyTypeOf
Definition: CollectDataOnIORank_impl.hpp:488
typename std::ranges::range_value_t< C >::second_type MappedTypeOf
Definition: CollectDataOnIORank_impl.hpp:491
Dune::Point2PointCommunicator< Dune::SimpleMessageBuffer > P2PCommunicatorType
Definition: CollectDataOnIORank_impl.hpp:81
std::vector< IndexMapType > IndexMapStorageType
Definition: CollectDataOnIORank_impl.hpp:80
std::string to_string(const ConvergenceReport::ReservoirFailure::Type t)
typename P2PCommunicatorType::MessageBufferType MessageBufferType
Definition: CollectDataOnIORank_impl.hpp:82
void unpackKeyedBlockMap(KeyedMap &globalData, MessageBufferType &buffer)
Definition: CollectDataOnIORank_impl.hpp:505