197 :
public GridDefaultImplementation<3, 3, double, CpGridFamily>
222 explicit CpGrid(MPIHelper::MPICommunicator
comm);
243 std::vector<std::size_t>
245 Opm::EclipseState* ecl_state,
246 bool periodic_extension,
bool turn_normals,
bool clip_z,
268 std::vector<std::size_t>
270 Opm::EclipseState* ecl_state,
271 bool periodic_extension,
bool turn_normals =
false,
bool clip_z =
false);
296 const std::array<double, 3>& cellsize,
297 const std::array<int, 3>& shift = {0,0,0});
314 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>&
currentData()
const;
317 std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>&
currentData();
326 void getIJK(
const int c, std::array<int,3>& ijk)
const;
347 std::string
name()
const;
354 typename Traits::template Codim<codim>::LevelIterator
lbegin (
int level)
const;
357 typename Traits::template Codim<codim>::LevelIterator
lend (
int level)
const;
360 template<
int codim, PartitionIteratorType PiType>
361 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator
lbegin (
int level)
const;
363 template<
int codim, PartitionIteratorType PiType>
364 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator
lend (
int level)
const;
368 typename Traits::template Codim<codim>::LeafIterator
leafbegin()
const;
371 typename Traits::template Codim<codim>::LeafIterator
leafend()
const;
374 template<
int codim, PartitionIteratorType PiType>
375 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator
leafbegin()
const;
377 template<
int codim, PartitionIteratorType PiType>
378 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator
leafend()
const;
381 int size (
int level,
int codim)
const;
384 int size (
int codim)
const;
387 int size (
int level, GeometryType type)
const;
390 int size (GeometryType type)
const;
409 const std::vector<Dune::GeometryType>& geomTypes(
const int)
const;
432 const std::vector<std::array<int,3>>& startIJK_vec,
433 const std::vector<std::array<int,3>>& endIJK_vec,
434 const std::vector<std::string>& lgr_name_vec);
437 const std::map<std::string,int>& getLgrNameToLevel()
const;
445 std::array<double,3> getEclCentroid(
const int& idx)
const;
504 bool adapt(
const std::vector<std::array<int,3>>& cells_per_dim_vec,
505 const std::vector<int>& assignRefinedLevel,
506 const std::vector<std::string>& lgr_name_vec,
507 const std::vector<std::array<int,3>>& startIJK_vec = std::vector<std::array<int,3>>{},
508 const std::vector<std::array<int,3>>& endIJK_vec = std::vector<std::array<int,3>>{});
576 void refineAndProvideMarkedRefinedRelations(
577 std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
578 int& markedElem_count,
579 std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
580 std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
581 std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
583 std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCell_to_refinedLevelAdRefinedCell,
584 std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
585 std::vector<int>& refined_cell_count_vec,
586 const std::vector<int>& assignRefinedLevel,
587 std::vector<std::vector<std::tuple<
int,std::vector<int>>>>& preAdapt_parent_to_children_cells_vec,
589 std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCell_to_adaptedCell,
590 std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
592 std::vector<std::vector<int>>& preAdapt_level_to_leaf_cells_vec,
594 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
617 std::tuple< std::vector<std::vector<std::array<int,2>>>,
618 std::vector<std::vector<int>>,
619 std::vector<std::array<int,2>>,
620 std::vector<int>> defineChildToParentAndIdxInParentCell(
const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
621 const std::vector<int>& refined_cell_count_vec,
622 const std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
623 const int& cell_count)
const;
651 std::pair<std::vector<std::vector<int>>, std::vector<std::array<int,2>>>
652 defineLevelToLeafAndLeafToLevelCells(
const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCell_to_refinedLevelAndRefinedCell,
653 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
654 const std::vector<int>& refined_cell_count_vec,
655 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCell_to_adaptedCell,
656 const std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
657 const int& cell_count)
const;
685 void identifyRefinedCornersPerLevel(std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
686 std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCorner_to_elemLgrAndElemLgrCorner,
687 std::vector<int>& refined_corner_count_vec,
688 std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
689 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
690 const std::vector<int>& assignRefinedLevel,
691 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
692 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
693 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
712 void identifyRefinedFacesPerLevel(std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrFace_to_refinedLevelAndRefinedFace,
713 std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedFace_to_elemLgrAndElemLgrFace,
714 std::vector<int>& refined_face_count_vec,
715 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
716 const std::vector<int>& assignRefinedLevel,
717 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
718 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
740 void identifyLeafGridCorners(std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCorner_to_adaptedCorner,
741 std::unordered_map<
int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner,
743 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
744 const std::vector<int>& assignRefinedLevel,
745 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
746 std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
747 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
748 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
767 void identifyLeafGridFaces(std::map<std::array<int,2>,
int>& elemLgrAndElemLgrFace_to_adaptedFace,
768 std::unordered_map<
int,std::array<int,2>>& adaptedFace_to_elemLgrAndElemLgrFace,
770 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
771 const std::vector<int>& assignRefinedLevel,
772 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
773 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
777 const std::vector<int>& refined_corner_count_vec,
778 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
779 const int& preAdaptMaxLevel,
780 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCorner_to_elemLgrAndElemLgrCorner)
const;
787 const std::vector<int>& refined_face_count_vec,
788 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedFace_to_elemLgrAndElemLgrFace,
789 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
790 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
791 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
792 const int& preAdaptMaxLevel,
793 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
794 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner)
const;
798 std::vector<std::vector<std::array<int,8>>>& refined_cell_to_point_vec,
799 std::vector<std::vector<int>>& refined_global_cell_vec,
800 const std::vector<int>& refined_cell_count_vec,
801 std::vector<cpgrid::OrientedEntityTable<0,1>>& refined_cell_to_face_vec,
802 std::vector<cpgrid::OrientedEntityTable<1,0>>& refined_face_to_cell_vec,
803 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
804 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrFace_to_refinedLevelAndRefinedFace,
805 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
806 const std::vector<Dune::cpgrid::DefaultGeometryPolicy>& refined_geometries_vec,
807 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
808 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
809 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
810 const std::vector<int>& assignRefinedLevel,
811 const int& preAdaptMaxLevel,
812 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
813 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
814 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
817 void setRefinedLevelGridsGeometries(
819 const std::vector<int>& refined_corner_count_vec,
825 const std::vector<int>& refined_face_count_vec,
828 std::vector<std::vector<std::array<int,8>>>& refined_cell_to_point_vec,
829 std::vector<std::vector<int>>& refined_global_cell_vec,
830 const std::vector<int>& refined_cell_count_vec,
831 std::vector<cpgrid::OrientedEntityTable<0,1>>& refined_cell_to_face_vec,
832 std::vector<cpgrid::OrientedEntityTable<1,0>>& refined_face_to_cell_vec,
834 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCell_to_elemLgrAndElemLgrCell,
835 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedFace_to_elemLgrAndElemLgrFace,
836 const std::map<std::array<int,2>,std::array<int,2>>& refinedLevelAndRefinedCorner_to_elemLgrAndElemLgrCorner,
837 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
838 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrFace_to_refinedLevelAndRefinedFace,
839 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
840 const std::vector<Dune::cpgrid::DefaultGeometryPolicy>& refined_geometries_vec,
841 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
842 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
843 const std::vector<int>& assignRefinedLevel,
844 const int& preAdaptMaxLevel,
845 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
846 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
847 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
851 const int& corners_count,
852 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
853 const std::unordered_map<
int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner)
const;
860 const int& face_count,
861 const std::unordered_map<
int,std::array<int,2>>& adaptedFace_to_elemLgrAndElemLgrFace,
862 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCorner_to_adaptedCorner,
863 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
864 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
865 const std::vector<int>& assignRefinedLevel,
866 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
867 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
868 const std::vector<std::array<int,3>>& cells_per_dim_vec,
869 const int& preAdaptMaxLevel)
const;
873 std::vector<std::array<int,8>>& adapted_cell_to_point,
874 const int& cell_count,
875 cpgrid::OrientedEntityTable<0,1>& adapted_cell_to_face,
876 cpgrid::OrientedEntityTable<1,0>& adapted_face_to_cell,
877 const std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
878 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrFace_to_adaptedFace,
879 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
881 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCorner_to_adaptedCorner,
882 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
883 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
884 const std::vector<int>& assignRefinedLevel,
885 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
886 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
887 const std::vector<std::array<int,3>>& cells_per_dim_vec,
888 const int& preAdaptMaxLevel)
const;
891 void updateLeafGridViewGeometries(
893 const int& corner_count,
899 const int& face_count,
902 std::vector<std::array<int,8>>& adapted_cell_to_point,
903 const int& cell_count,
904 cpgrid::OrientedEntityTable<0,1>& adapted_cell_to_face,
905 cpgrid::OrientedEntityTable<1,0>& adapted_face_to_cell,
907 const std::unordered_map<
int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner,
908 const std::unordered_map<
int,std::array<int,2>>& adaptedFace_to_elemLgrAndElemLgrFace,
909 const std::unordered_map<
int,std::array<int,2>>& adaptedCell_to_elemLgrAndElemLgrCell,
910 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrFace_to_adaptedFace,
911 const std::vector<std::vector<std::pair<
int, std::vector<int>>>>& faceInMarkedElemAndRefinedFaces,
913 const std::map<std::array<int,2>,
int>& elemLgrAndElemLgrCorner_to_adaptedCorner,
914 const std::map<std::array<int,2>, std::array<int,2>>& vanishedRefinedCorner_to_itsLastAppearance,
915 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& markedElem_to_itsLgr,
916 const std::vector<int>& assignRefinedLevel,
917 const std::map<std::array<int,2>,
int>& markedElemAndEquivRefinedCorn_to_corner,
918 const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
919 const std::vector<std::array<int,3>>& cells_per_dim_vec,
920 const int& preAdaptMaxLevel)
const;
922 void updateCornerHistoryLevels(
const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
923 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
924 const std::unordered_map<
int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner,
925 const int& corner_count,
926 const std::vector<std::array<int,2>>& preAdaptGrid_corner_history,
927 const int& preAdaptMaxLevel,
928 const int& newLevels);
930 void globalIdsPartitionTypesLgrAndLeafGrids(
const std::vector<int>& assignRefinedLevel,
931 const std::vector<std::array<int,3>>& cells_per_dim_vec,
932 const std::vector<int>& lgr_with_at_least_one_active_cell);
940 void getFirstChildGlobalIds([[maybe_unused]] std::vector<int>& parentToFirstChildGlobalIds);
962 void computeGlobalCellLgr(
const int& level,
const std::array<int,3>& startIJK, std::vector<int>& global_cell_lgr);
967 void computeGlobalCellLeafGridViewWithLgrs(std::vector<int>& global_cell_leaf);
978 std::array<int,3> getRefinedCornerIJK(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr)
const;
994 std::array<int,3> getRefinedFaceIJK(
const std::array<int,3>& cells_per_dim,
int faceIdxInLgr,
995 const std::shared_ptr<cpgrid::CpGridData>& elemLgr_ptr)
const;
1001 bool isRefinedCornerInInteriorLgr(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr)
const;
1008 bool isRefinedFaceInInteriorLgr(
const std::array<int,3>& cells_per_dim,
int faceIdxInLgr,
1009 const std::shared_ptr<cpgrid::CpGridData>& elemLgr_ptr)
const;
1016 bool isRefinedNewBornCornerOnLgrBoundary(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr)
const;
1023 bool newRefinedCornerLiesOnEdge(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr)
const;
1030 bool isRefinedFaceOnLgrBoundary(
const std::array<int,3>& cells_per_dim,
int faceIdxInLgr,
1031 const std::shared_ptr<cpgrid::CpGridData>& elemLgr_ptr)
const;
1038 int getParentFaceWhereNewRefinedCornerLiesOn(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr,
int elemLgr)
const;
1045 std::array<int,2> getParentFacesAssocWithNewRefinedCornLyingOnEdge(
const std::array<int,3>& cells_per_dim,
int cornerIdxInLgr,
int elemLgr)
const;
1064 const std::array<int,3>& cells_per_dim_lgr2)
const;
1074 const std::shared_ptr<cpgrid::CpGridData>& elemLgr1_ptr,
1075 const std::array<int,3>& cells_per_dim_lgr2)
const;
1084 int getParentFaceWhereNewRefinedFaceLiesOn(
const std::array<int,3>& cells_per_dim,
int faceIdxInLgr,
1085 const std::shared_ptr<cpgrid::CpGridData>& elemLgr_ptr,
1097 bool nonNNCsSelectedCellsLGR(
const std::vector<std::array<int,3>>& startIJK_vec,
1098 const std::vector<std::array<int,3>>& endIJK_vec)
const;
1110 void detectActiveLgrs(
const std::vector<std::array<int,3>>& startIJK_vec,
1111 const std::vector<std::array<int,3>>& endIJK_vec,
1112 std::vector<int>& lgr_with_at_least_one_active_cell);
1127 void markElemAssignLevelDetectActiveLgrs(
const std::vector<std::array<int,3>>& startIJK_vec,
1128 const std::vector<std::array<int,3>>& endIJK_vec,
1129 std::vector<int>& assignRefinedLevel,
1130 std::vector<int>& lgr_with_at_least_one_active_cell);
1138 void computeOnLgrParents(
const std::vector<std::array<int,3>>& startIJK_vec,
1139 const std::vector<std::array<int,3>>& endIJK_vec,
1155 void predictMinCellAndPointGlobalIdPerProcess(
const std::vector<int>& assignRefinedLevel,
1156 const std::vector<std::array<int,3>>& cells_per_dim_vec,
1157 const std::vector<int>& lgr_with_at_least_one_active_cell,
1158 int& min_globalId_cell_in_proc,
1159 int& min_globalId_point_in_proc)
const;
1169 void assignCellIdsAndCandidatePointIds( std::vector<std::vector<int>>& localToGlobal_cells_per_level,
1170 std::vector<std::vector<int>>& localToGlobal_points_per_level,
1171 int min_globalId_cell_in_proc,
1172 int min_globalId_point_in_proc,
1173 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
1188 void selectWinnerPointIds(std::vector<std::vector<int>>& localToGlobal_points_per_level,
1189 const std::vector<std::tuple<
int,std::vector<int>>>& parent_to_children,
1190 const std::vector<std::array<int,3>>& cells_per_dim_vec)
const;
1193 void populateCellIndexSetRefinedGrid(
int level);
1196 void populateCellIndexSetLeafGridView();
1199 void populateLeafGlobalIdSet();
1228 void setPartitioningParams(
const std::map<std::string,std::string>& params);
1238 double imbalanceTol = 1.1,
1267 double imbalanceTol = 1.1)
1270 return get<0>(scatterGrid(
EdgeWeightMethod(edgeWeightMethod),
false,
nullptr, {},
true ,
nullptr,
true, overlapLayers, partitionMethod, imbalanceTol));
1300 std::pair<bool,std::vector<std::pair<std::string,bool>>>
1302 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1303 const double* transmissibilities =
nullptr,
1306 return scatterGrid(
defaultTransEdgeWgt,
false, wells, possibleFutureConnections,
false, transmissibilities,
false, overlapLayers, partitionMethod);
1340 std::pair<bool,std::vector<std::pair<std::string,bool>>>
1342 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1343 const double* transmissibilities =
nullptr,
bool ownersFirst=
false,
1344 bool addCornerCells=
false,
int overlapLayers=1,
1346 double imbalanceTol = 1.1)
1348 return scatterGrid(method, ownersFirst, wells, possibleFutureConnections,
false, transmissibilities, addCornerCells, overlapLayers, partitionMethod, imbalanceTol);
1376 template<
class DataHandle>
1377 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1379 const std::vector<cpgrid::OpmWellType> * wells,
1380 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1381 const double* transmissibilities =
nullptr,
1382 int overlapLayers=1,
int partitionMethod = 1)
1384 auto ret =
loadBalance(wells, possibleFutureConnections, transmissibilities, overlapLayers, partitionMethod);
1427 template<
class DataHandle>
1428 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1430 const std::vector<cpgrid::OpmWellType> * wells,
1431 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1432 bool serialPartitioning,
1433 const double* transmissibilities =
nullptr,
bool ownersFirst=
false,
1435 double imbalanceTol = 1.1,
1436 bool allowDistributedWells =
false)
1438 auto ret = scatterGrid(method, ownersFirst, wells, possibleFutureConnections, serialPartitioning, transmissibilities,
1439 addCornerCells, overlapLayers, partitionMethod, imbalanceTol, allowDistributedWells);
1464 template<
class DataHandle>
1465 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1467 const std::vector<cpgrid::OpmWellType> * wells,
1468 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1469 bool ownersFirst=
false,
1470 bool addCornerCells=
false,
int overlapLayers=1)
1474 possibleFutureConnections,
1495 template<
class DataHandle>
1501 bool ret =
loadBalance(overlapLayers, partitionMethod);
1520 bool loadBalance(
const std::vector<int>& parts,
bool ownersFirst=
false,
1521 bool addCornerCells=
false,
int overlapLayers=1)
1545 template<
class DataHandle>
1546 bool loadBalance(DataHandle& data,
const std::vector<int>& parts,
bool ownersFirst=
false,
1547 bool addCornerCells=
false,
int overlapLayers=1)
1549 bool ret =
loadBalance(parts, ownersFirst, addCornerCells, overlapLayers);
1571 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1572 const double* transmissibilities,
1574 const double imbalanceTol)
const;
1583 template<
class DataHandle>
1584 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir,
int )
const
1596 template<
class DataHandle>
1597 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir)
const;
1613 typedef Dune::FieldVector<double, 3> Vector;
1616 const std::vector<double>& zcornData()
const;
1624 int numCells(
int level = -1)
const;
1630 int numFaces(
int level = -1)
const;
1652 int cellFace(
int cell,
int local_index,
int level = -1)
const;
1670 int faceCell(
int face,
int local_index,
int level = -1)
const;
1680 int numFaceVertices(
int face)
const;
1686 int faceVertex(
int face,
int local_index)
const;
1695 const Vector faceAreaNormalEcl(
int face)
const;
1729 :
public RandomAccessIteratorFacade<CentroidIterator<codim>,
1730 FieldVector<double, 3>,
1731 const FieldVector<double, 3>&, int>
1735 typedef typename std::vector<
cpgrid::Geometry<3-codim, 3> >::const_iterator
1743 const FieldVector<double,3>& dereference()
const
1745 return iter_->center();
1751 const FieldVector<double,3>& elementAt(
int n)
1753 return iter_[n]->center();
1755 void advance(
int n){
1762 int distanceTo(
const CentroidIterator& o)
1766 bool equals(
const CentroidIterator& o)
const{
1781 int boundaryId(
int face)
const;
1789 template<
class Cell2FacesRowIterator>
1791 faceTag(
const Cell2FacesRowIterator& cell_face)
const;
1813 template<
class DataHandle>
1822 template<
class DataHandle>
1871 using ParallelIndexSet = cpgrid::CpGridDataTraits::ParallelIndexSet;
1873 using RemoteIndices = cpgrid::CpGridDataTraits::RemoteIndices;
1876 using CommunicationType = cpgrid::CpGridDataTraits::CommunicationType;
1881 const CommunicationType& cellCommunication()
const;
1883 ParallelIndexSet& getCellIndexSet();
1885 RemoteIndices& getCellRemoteIndices();
1887 const ParallelIndexSet& getCellIndexSet()
const;
1889 const RemoteIndices& getCellRemoteIndices()
const;
1927 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1930 const std::vector<cpgrid::OpmWellType> * wells,
1931 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1932 bool serialPartitioning,
1933 const double* transmissibilities,
1934 bool addCornerCells,
1937 double imbalanceTol = 1.1,
1938 bool allowDistributedWells =
true,
1939 const std::vector<int>& input_cell_part = {},
1946 std::vector<std::shared_ptr<cpgrid::CpGridData>> data_;
1950 std::vector<std::shared_ptr<cpgrid::CpGridData>> distributed_data_;
1952 std::vector<std::shared_ptr<cpgrid::CpGridData>>* current_data_;
1954 std::map<std::string,int> lgr_names_ = {{
"GLOBAL", 0}};
1960 std::shared_ptr<InterfaceMap> cell_scatter_gather_interfaces_;
1966 std::shared_ptr<InterfaceMap> point_scatter_gather_interfaces_;
1970 std::shared_ptr<cpgrid::GlobalIdSet> global_id_set_ptr_;
1976 std::map<std::string,std::string> partitioningParams;