200 :
public GridDefaultImplementation<3, 3, double, CpGridFamily>
246 std::vector<std::size_t>
248 Opm::EclipseState* ecl_state,
249 bool periodic_extension,
bool turn_normals,
bool clip_z,
271 std::vector<std::size_t>
273 Opm::EclipseState* ecl_state,
274 bool periodic_extension,
bool turn_normals =
false,
bool clip_z =
false);
299 const std::array<double, 3>& cellsize,
300 const std::array<int, 3>& shift = {0,0,0});
317 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>&
currentData()
const;
320 std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>&
currentData();
329 void getIJK(
const int c, std::array<int,3>& ijk)
const;
350 std::string
name()
const;
357 typename Traits::template Codim<codim>::LevelIterator
lbegin (
int level)
const;
360 typename Traits::template Codim<codim>::LevelIterator
lend (
int level)
const;
363 template<
int codim, PartitionIteratorType PiType>
364 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator
lbegin (
int level)
const;
366 template<
int codim, PartitionIteratorType PiType>
367 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator
lend (
int level)
const;
371 typename Traits::template Codim<codim>::LeafIterator
leafbegin()
const;
374 typename Traits::template Codim<codim>::LeafIterator
leafend()
const;
377 template<
int codim, PartitionIteratorType PiType>
378 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator
leafbegin()
const;
380 template<
int codim, PartitionIteratorType PiType>
381 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator
leafend()
const;
384 int size (
int level,
int codim)
const;
387 int size (
int codim)
const;
390 int size (
int level, GeometryType type)
const;
393 int size (GeometryType type)
const;
412 const std::vector<Dune::GeometryType>& geomTypes(
const int)
const;
431 void addLgrUpdateLeafView(
const std::array<int,3>& cells_per_dim,
const std::array<int,3>& startIJK,
432 const std::array<int,3>& endIJK,
const std::string& lgr_name);
451 const std::vector<std::array<int,3>>& startIJK_vec,
452 const std::vector<std::array<int,3>>& endIJK_vec,
453 const std::vector<std::string>& lgr_name_vec);
456 const std::map<std::string,int>& getLgrNameToLevel()
const;
464 std::array<double,3> getEclCentroid(
const int& idx)
const;
527 bool adapt(
const std::vector<std::array<int,3>>& cells_per_dim_vec,
528 const std::vector<int>& assignRefinedLevel,
529 const std::vector<std::string>& lgr_name_vec,
530 bool isCARFIN =
false,
531 const std::vector<std::array<int,3>>& startIJK_vec = std::vector<std::array<int,3>>{},
532 const std::vector<std::array<int,3>>& endIJK_vec = std::vector<std::array<int,3>>{});
600 void refineAndProvideMarkedRefinedRelations(
601 std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
602 int& markedElem_count,
603 std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
604 std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
605 std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
607 std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCell_to_refinedLevelAdRefinedCell,
608 std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
609 std::vector<int>& refined_cell_count_vec,
610 const std::vector<int>& assignRefinedLevel,
611 std::vector<std::vector<std::tuple<
int,std::vector<int>>>>& preAdapt_parent_to_children_cells_vec,
613 std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCell_to_adaptedCell,
614 std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
616 std::vector<std::vector<int>>& preAdapt_level_to_leaf_cells_vec,
618 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
641 std::tuple< std::vector<std::vector<std::array<int,2>>>,
642 std::vector<std::vector<int>>,
643 std::vector<std::array<int,2>>,
644 std::vector<int>> defineChildToParentAndIdxInParentCell(
const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
645 const std::vector<int>& refined_cell_count_vec,
646 const std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
647 const int& cell_count)
const;
675 std::pair<std::vector<std::vector<int>>, std::vector<std::array<int,2>>>
676 defineLevelToLeafAndLeafToLevelCells(
const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCell_to_refinedLevelAndRefinedCell,
677 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
678 const std::vector<int>& refined_cell_count_vec,
679 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCell_to_adaptedCell,
680 const std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
681 const int& cell_count)
const;
709 void identifyRefinedCornersPerLevel(std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
710 std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCorner_to_elemLgrAndElemLgrCorner,
711 std::vector<int>& refined_corner_count_vec,
712 std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
713 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
714 const std::vector<int>& assignRefinedLevel,
715 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
716 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
717 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
736 void identifyRefinedFacesPerLevel(std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrFace_to_refinedLevelAndRefinedFace,
737 std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedFace_to_elemLgrAndElemLgrFace,
738 std::vector<int>& refined_face_count_vec,
739 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
740 const std::vector<int>& assignRefinedLevel,
741 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
742 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
764 void identifyLeafGridCorners(std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCorner_to_adaptedCorner,
765 std::unordered_map<
int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner,
767 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
768 const std::vector<int>& assignRefinedLevel,
769 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
770 std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
771 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
772 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
791 void identifyLeafGridFaces(std::map<std::array<int,2>,
int>& elemLgrAndElemLgrFace_to_adaptedFace,
792 std::unordered_map<
int,std::array<int,2>>& adaptedFace_to_elemLgrAndElemLgrFace,
794 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
795 const std::vector<int>& assignRefinedLevel,
796 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
797 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
801 const std::vector<int>& refined_corner_count_vec,
802 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
803 const int& preAdaptMaxLevel,
804 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCorner_to_elemLgrAndElemLgrCorner)
const;
811 const std::vector<int>& refined_face_count_vec,
812 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedFace_to_elemLgrAndElemLgrFace,
813 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
814 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
815 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
816 const int& preAdaptMaxLevel,
817 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
818 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner)
const;
822 std::vector<std::vector<std::array<int,8>>>& refined_cell_to_point_vec,
823 std::vector<std::vector<int>>& refined_global_cell_vec,
824 const std::vector<int>& refined_cell_count_vec,
825 std::vector<cpgrid::OrientedEntityTable<0,1>>& refined_cell_to_face_vec,
826 std::vector<cpgrid::OrientedEntityTable<1,0>>& refined_face_to_cell_vec,
827 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
828 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrFace_to_refinedLevelAndRefinedFace,
829 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
830 const std::vector<Dune::cpgrid::DefaultGeometryPolicy>& refined_geometries_vec,
831 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
832 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
833 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
834 const std::vector<int>& assignRefinedLevel,
835 const int& preAdaptMaxLevel,
836 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
837 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
838 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
841 void setRefinedLevelGridsGeometries(
843 const std::vector<int>& refined_corner_count_vec,
849 const std::vector<int>& refined_face_count_vec,
852 std::vector<std::vector<std::array<int,8>>>& refined_cell_to_point_vec,
853 std::vector<std::vector<int>>& refined_global_cell_vec,
854 std::vector<int>& refined_cell_count_vec,
855 std::vector<cpgrid::OrientedEntityTable<0,1>>& refined_cell_to_face_vec,
856 std::vector<cpgrid::OrientedEntityTable<1,0>>& refined_face_to_cell_vec,
858 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
859 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedFace_to_elemLgrAndElemLgrFace,
860 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCorner_to_elemLgrAndElemLgrCorner,
861 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
862 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrFace_to_refinedLevelAndRefinedFace,
863 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
864 const std::vector<Dune::cpgrid::DefaultGeometryPolicy>& refined_geometries_vec,
865 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
866 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
867 const std::vector<int>& assignRefinedLevel,
868 const int& preAdaptMaxLevel,
869 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
870 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
871 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
875 const int& corners_count,
876 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
877 const std::unordered_map<
int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner)
const;
884 const int& face_count,
885 const std::unordered_map<
int,std::array<int,2>>& adaptedFace_to_elemLgrAndElemLgrFace,
886 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCorner_to_adaptedCorner,
887 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
888 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
889 const std::vector<int>& assignRefinedLevel,
890 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
891 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
892 const std::vector<std::array<int,3>>& cells_per_dim_vec,
893 const int& preAdaptMaxLevel)
const;
897 std::vector<std::array<int,8>>& adapted_cell_to_point,
898 const int& cell_count,
899 cpgrid::OrientedEntityTable<0,1>& adapted_cell_to_face,
900 cpgrid::OrientedEntityTable<1,0>& adapted_face_to_cell,
901 const std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
902 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrFace_to_adaptedFace,
903 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
905 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCorner_to_adaptedCorner,
906 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
907 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
908 const std::vector<int>& assignRefinedLevel,
909 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
910 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
911 const std::vector<std::array<int,3>>& cells_per_dim_vec,
912 const int& preAdaptMaxLevel)
const;
915 void updateLeafGridViewGeometries(
917 const int& corner_count,
923 const int& face_count,
926 std::vector<std::array<int,8>>& adapted_cell_to_point,
927 const int& cell_count,
928 cpgrid::OrientedEntityTable<0,1>& adapted_cell_to_face,
929 cpgrid::OrientedEntityTable<1,0>& adapted_face_to_cell,
931 const std::unordered_map<
int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner,
932 const std::unordered_map<
int,std::array<int,2>>& adaptedFace_to_elemLgrAndElemLgrFace,
933 const std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
934 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrFace_to_adaptedFace,
935 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
937 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCorner_to_adaptedCorner,
938 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
939 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
940 const std::vector<int>& assignRefinedLevel,
941 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
942 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
943 const std::vector<std::array<int,3>>& cells_per_dim_vec,
944 const int& preAdaptMaxLevel)
const;
946 void updateCornerHistoryLevels(
const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
947 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
948 const std::unordered_map<
int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner,
949 const int& corner_count,
950 const std::vector<std::array<int,2>>& preAdaptGrid_corner_history,
951 const int& preAdaptMaxLevel,
952 const int& newLevels);
967 void computeGlobalCellLgr(
const int& level,
const std::array<int,3>& startIJK, std::vector<int>& global_cell_lgr);
972 void computeGlobalCellLeafGridViewWithLgrs(std::vector<int>& global_cell_leaf);
983 std::array<int,3> getRefinedCornerIJK(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr)
const;
999 std::array<int,3> getRefinedFaceIJK(
const std::array<int,3>& cells_per_dim,
int faceIdxInLgr,
1000 const std::shared_ptr<cpgrid::CpGridData>& elemLgr_ptr)
const;
1006 bool isRefinedCornerInInteriorLgr(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr)
const;
1013 bool isRefinedFaceInInteriorLgr(
const std::array<int,3>& cells_per_dim,
int faceIdxInLgr,
1014 const std::shared_ptr<cpgrid::CpGridData>& elemLgr_ptr)
const;
1021 bool isRefinedNewBornCornerOnLgrBoundary(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr)
const;
1028 bool newRefinedCornerLiesOnEdge(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr)
const;
1035 bool isRefinedFaceOnLgrBoundary(
const std::array<int,3>& cells_per_dim,
int faceIdxInLgr,
1036 const std::shared_ptr<cpgrid::CpGridData>& elemLgr_ptr)
const;
1043 int getParentFaceWhereNewRefinedCornerLiesOn(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr,
int elemLgr)
const;
1050 std::array<int,2> getParentFacesAssocWithNewRefinedCornLyingOnEdge(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr,
int elemLgr)
const;
1058 int replaceLgr1CornerIdxByLgr2CornerIdx(
const std::array<int,3>& cells_per_dim_lgr1,
int cornerIdxLgr1,
const std::array<int,3>& cells_per_dim_lgr2)
const;
1067 int replaceLgr1CornerIdxByLgr2CornerIdx(
const std::array<int,3>& cells_per_dim_lgr1,
int cornerIdxLgr1,
int elemLgr1,
int parentFaceLastAppearanceIdx,
1068 const std::array<int,3>& cells_per_dim_lgr2)
const;
1077 int replaceLgr1FaceIdxByLgr2FaceIdx(
const std::array<int,3>& cells_per_dim_lgr1,
int faceIdxInLgr1,
1078 const std::shared_ptr<cpgrid::CpGridData>& elemLgr1_ptr,
1079 const std::array<int,3>& cells_per_dim_lgr2)
const;
1087 int getParentFaceWhereNewRefinedFaceLiesOn(
const std::array<int,3>& cells_per_dim,
int faceIdxInLgr,
1088 const std::shared_ptr<cpgrid::CpGridData>& elemLgr_ptr,
1112 void setPartitioningParams(
const std::map<std::string,std::string>& params);
1123 return get<0>(scatterGrid(
defaultTransEdgeWgt,
false,
nullptr, {},
false,
nullptr,
true, overlapLayers, partitionMethod, imbalanceTol));
1136 return get<0>(scatterGrid(
EdgeWeightMethod(edgeWeightMethod),
false,
nullptr, {},
true ,
nullptr,
true, overlapLayers, partitionMethod, imbalanceTol));
1166 std::pair<bool,std::vector<std::pair<std::string,bool>>>
1168 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1169 const double* transmissibilities =
nullptr,
1172 return scatterGrid(
defaultTransEdgeWgt,
false, wells, possibleFutureConnections,
false, transmissibilities,
false, overlapLayers, partitionMethod);
1206 std::pair<bool,std::vector<std::pair<std::string,bool>>>
1208 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1209 const double* transmissibilities =
nullptr,
bool ownersFirst=
false,
1210 bool addCornerCells=
false,
int overlapLayers=1,
1212 double imbalanceTol = 1.1)
1214 return scatterGrid(method, ownersFirst, wells, possibleFutureConnections,
false, transmissibilities, addCornerCells, overlapLayers, partitionMethod, imbalanceTol);
1242 template<
class DataHandle>
1243 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1245 const std::vector<cpgrid::OpmWellType> * wells,
1246 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1247 const double* transmissibilities =
nullptr,
1248 int overlapLayers=1,
int partitionMethod = 1)
1250 auto ret =
loadBalance(wells, possibleFutureConnections, transmissibilities, overlapLayers, partitionMethod);
1293 template<
class DataHandle>
1294 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1296 const std::vector<cpgrid::OpmWellType> * wells,
1297 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1298 bool serialPartitioning,
1299 const double* transmissibilities =
nullptr,
bool ownersFirst=
false,
1301 double imbalanceTol = 1.1,
1302 bool allowDistributedWells =
false)
1304 auto ret = scatterGrid(method, ownersFirst, wells, possibleFutureConnections, serialPartitioning, transmissibilities,
1305 addCornerCells, overlapLayers, partitionMethod, imbalanceTol, allowDistributedWells);
1330 template<
class DataHandle>
1331 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1333 const std::vector<cpgrid::OpmWellType> * wells,
1334 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1335 bool ownersFirst=
false,
1336 bool addCornerCells=
false,
int overlapLayers=1)
1340 possibleFutureConnections,
1361 template<
class DataHandle>
1367 bool ret =
loadBalance(overlapLayers, partitionMethod);
1386 bool loadBalance(
const std::vector<int>& parts,
bool ownersFirst=
false,
1387 bool addCornerCells=
false,
int overlapLayers=1)
1411 template<
class DataHandle>
1412 bool loadBalance(DataHandle& data,
const std::vector<int>& parts,
bool ownersFirst=
false,
1413 bool addCornerCells=
false,
int overlapLayers=1)
1415 bool ret =
loadBalance(parts, ownersFirst, addCornerCells, overlapLayers);
1437 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1438 const double* transmissibilities,
1440 const double imbalanceTol)
const;
1449 template<
class DataHandle>
1450 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir,
int )
const
1462 template<
class DataHandle>
1463 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir)
const;
1479 typedef Dune::FieldVector<double, 3> Vector;
1482 const std::vector<double>& zcornData()
const;
1508 int cellFace(
int cell,
int local_index)
const;
1524 int faceCell(
int face,
int local_index)
const;
1534 int numFaceVertices(
int face)
const;
1540 int faceVertex(
int face,
int local_index)
const;
1549 const Vector faceAreaNormalEcl(
int face)
const;
1583 :
public RandomAccessIteratorFacade<CentroidIterator<codim>,
1584 FieldVector<double, 3>,
1585 const FieldVector<double, 3>&, int>
1589 typedef typename std::vector<
cpgrid::Geometry<3-codim, 3> >::const_iterator
1597 const FieldVector<double,3>& dereference()
const
1599 return iter_->center();
1605 const FieldVector<double,3>& elementAt(
int n)
1607 return iter_[n]->center();
1609 void advance(
int n){
1635 int boundaryId(
int face)
const;
1643 template<
class Cell2FacesRowIterator>
1645 faceTag(
const Cell2FacesRowIterator& cell_face)
const;
1667 template<
class DataHandle>
1676 template<
class DataHandle>
1725 using ParallelIndexSet = cpgrid::CpGridDataTraits::ParallelIndexSet;
1727 using RemoteIndices = cpgrid::CpGridDataTraits::RemoteIndices;
1730 using CommunicationType = cpgrid::CpGridDataTraits::CommunicationType;
1735 const CommunicationType& cellCommunication()
const;
1737 ParallelIndexSet& getCellIndexSet();
1739 RemoteIndices& getCellRemoteIndices();
1741 const ParallelIndexSet& getCellIndexSet()
const;
1743 const RemoteIndices& getCellRemoteIndices()
const;
1781 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1784 const std::vector<cpgrid::OpmWellType> * wells,
1785 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1786 bool serialPartitioning,
1787 const double* transmissibilities,
1788 bool addCornerCells,
1791 double imbalanceTol = 1.1,
1792 bool allowDistributedWells =
true,
1793 const std::vector<int>& input_cell_part = {});
1799 std::vector<std::shared_ptr<cpgrid::CpGridData>> data_;
1803 std::vector<std::shared_ptr<cpgrid::CpGridData>> distributed_data_;
1805 std::vector<std::shared_ptr<cpgrid::CpGridData>>* current_data_;
1807 std::map<std::string,int> lgr_names_ = {{
"GLOBAL", 0}};
1813 std::shared_ptr<InterfaceMap> cell_scatter_gather_interfaces_;
1819 std::shared_ptr<InterfaceMap> point_scatter_gather_interfaces_;
1823 std::shared_ptr<cpgrid::GlobalIdSet> global_id_set_ptr_;
1829 std::map<std::string,std::string> partitioningParams;