CpGrid.hpp
Go to the documentation of this file.
1//===========================================================================
2//
3// File: CpGrid.hpp
4//
5// Created: Fri May 29 20:26:36 2009
6//
7// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
8// B�rd Skaflestad <bard.skaflestad@sintef.no>
9// Antonella Ritorto <antonella.ritorto@opm-op.com>
10//
11// $Date$
12//
13// $Revision$
14//
15//===========================================================================
16
17/*
18 Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
19 Copyright 2009, 2010, 2014, 2022-2023 Equinor ASA.
20 Copyright 2014, 2015 Dr. Blatt - HPC-Simulartion-Software & Services
21 Copyright 2015 NTNU
22
23 This file is part of The Open Porous Media project (OPM).
24
25 OPM is free software: you can redistribute it and/or modify
26 it under the terms of the GNU General Public License as published by
27 the Free Software Foundation, either version 3 of the License, or
28 (at your option) any later version.
29
30 OPM is distributed in the hope that it will be useful,
31 but WITHOUT ANY WARRANTY; without even the implied warranty of
32 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 GNU General Public License for more details.
34
35 You should have received a copy of the GNU General Public License
36 along with OPM. If not, see <http://www.gnu.org/licenses/>.
37*/
38
39#ifndef OPM_CPGRID_HEADER
40#define OPM_CPGRID_HEADER
41
42// Warning suppression for Dune includes.
44
45#include <dune/grid/common/grid.hh>
46
48
50
55
57
59
60#include <set>
61
62namespace Opm
63{
64struct NNCdata;
65class EclipseGrid;
66class EclipseState;
67}
68
69namespace Dune
70{
71 class CpGrid;
72
73 namespace cpgrid
74 {
75 class CpGridData;
76 template <int> class Entity;
77 template<int,int> class Geometry;
78 class HierarchicIterator;
79 class IntersectionIterator;
80 template<int, PartitionIteratorType> class Iterator;
81 class LevelGlobalIdSet;
82 class GlobalIdSet;
83 class Intersection;
84 class IntersectionIterator;
85 class IndexSet;
86 class IdSet;
87
88 }
89}
90
91namespace Dune
92{
93
95 //
96 // CpGridTraits
97 //
99
101 {
103 typedef CpGrid Grid;
104
113
116
119 template <int cd>
120 struct Codim
121 {
124 typedef cpgrid::Geometry<3-cd, 3> Geometry;
125 //typedef Dune::Geometry<3-cd, 3, CpGrid, cpgrid::Geometry> Geometry;
128 //typedef Dune::Geometry<3-cd, 3, CpGrid, cpgrid::Geometry> LocalGeometry;
131
134
137
140
143 template <PartitionIteratorType pitype>
145 {
150 };
151 };
152
155 template <PartitionIteratorType pitype>
157 {
159 typedef Dune::GridView<DefaultLevelGridViewTraits<CpGrid> > LevelGridView;
161 typedef Dune::GridView<DefaultLeafGridViewTraits<CpGrid> > LeafGridView;
162
163 };
164
166 typedef Dune::GridView<DefaultLevelGridViewTraits<CpGrid>> LevelGridView;
168 typedef Dune::GridView<DefaultLeafGridViewTraits<CpGrid>> LeafGridView;
169
178
182 };
183
185 //
186 // CpGridFamily
187 //
189
191 {
193 };
194
196 //
197 // CpGrid
198 //
200
202 class CpGrid
203 : public GridDefaultImplementation<3, 3, double, CpGridFamily>
204 {
205 friend class cpgrid::CpGridData;
206 friend class cpgrid::Entity<0>;
207 friend class cpgrid::Entity<1>;
208 friend class cpgrid::Entity<2>;
209 friend class cpgrid::Entity<3>;
210 template<int dim>
211 friend cpgrid::Entity<dim> createEntity(const CpGrid&,int,bool);
212
213 public:
214
215 // --- Typedefs ---
216
217
220
221
222 // --- Methods ---
223
224
227
228 explicit CpGrid(MPIHelper::MPICommunicator comm);
229
266 std::vector<std::size_t>
267 processEclipseFormat(const Opm::EclipseGrid* ecl_grid,
268 Opm::EclipseState* ecl_state,
269 bool periodic_extension,
270 bool turn_normals,
271 bool clip_z,
272 bool pinchActive,
273 bool edge_conformal);
274
312 std::vector<std::size_t>
313 processEclipseFormat(const Opm::EclipseGrid* ecl_grid,
314 Opm::EclipseState* ecl_state,
315 bool periodic_extension,
316 bool turn_normals = false,
317 bool clip_z = false,
318 bool edge_conformal = false);
319
334 void processEclipseFormat(const grdecl& input_data,
335 bool remove_ij_boundary,
336 bool turn_normals = false,
337 bool edge_conformal = false);
338
340
346
347
354 void createCartesian(const std::array<int, 3>& dims,
355 const std::array<double, 3>& cellsize,
356 const std::array<int, 3>& shift = {0,0,0});
357
361 const std::array<int, 3>& logicalCartesianSize() const;
362
370 const std::vector<int>& globalCell() const;
371
373 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& currentData() const;
374
376 std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& currentData();
377
380
383
391 void getIJK(const int c, std::array<int,3>& ijk) const;
393
397 bool uniqueBoundaryIds() const;
398
401 void setUniqueBoundaryIds(bool uids);
402
403
404 // --- Dune interface below ---
405
407 // \@{
412 std::string name() const;
413
415 int maxLevel() const;
416
418 template<int codim>
419 typename Traits::template Codim<codim>::LevelIterator lbegin (int level) const;
421 template<int codim>
422 typename Traits::template Codim<codim>::LevelIterator lend (int level) const;
423
425 template<int codim, PartitionIteratorType PiType>
426 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator lbegin (int level) const;
428 template<int codim, PartitionIteratorType PiType>
429 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator lend (int level) const;
430
432 template<int codim>
433 typename Traits::template Codim<codim>::LeafIterator leafbegin() const;
435 template<int codim>
436 typename Traits::template Codim<codim>::LeafIterator leafend() const;
437
439 template<int codim, PartitionIteratorType PiType>
440 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafbegin() const;
442 template<int codim, PartitionIteratorType PiType>
443 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafend() const;
444
446 int size (int level, int codim) const;
447
449 int size (int codim) const;
450
452 int size (int level, GeometryType type) const;
453
455 int size (GeometryType type) const;
456
458 const Traits::GlobalIdSet& globalIdSet() const;
459
461 const Traits::LocalIdSet& localIdSet() const;
462
464 const Traits::LevelIndexSet& levelIndexSet(int level) const;
465
467 const Traits::LeafIndexSet& leafIndexSet() const;
468
474 void globalRefine (int refCount, bool throwOnFailure = false);
475
476 const std::vector<Dune::GeometryType>& geomTypes(const int) const;
477
479 template <int codim>
481
500 void addLgrsUpdateLeafView(const std::vector<std::array<int,3>>& cells_per_dim_vec,
501 const std::vector<std::array<int,3>>& startIJK_vec,
502 const std::vector<std::array<int,3>>& endIJK_vec,
503 const std::vector<std::string>& lgr_name_vec,
504 const std::vector<std::string>& lgr_parent_grid_name_vec = std::vector<std::string>{});
505
508 void addLgrsUpdateLeafView(std::vector<Opm::Refinement::BlockRefinement> requests);
509
512
514 {
515 return lgr_backend_;
516 }
517
519 void setRefinementBuilder(std::shared_ptr<Opm::Refinement::Builder> builder);
520
527 void autoRefine(const std::array<int,3>& nxnynz);
528
529 // @brief TO BE DONE
530 const std::map<std::string,int>& getLgrNameToLevel() const;
531
532 // @breif Compute center of an entity/element/cell in the Eclipse way:
533 // - Average of the 4 corners of the bottom face.
534 // - Average of the 4 corners of the top face.
535 // Return average of the previous computations.
536 // @param [in] int Index of a cell.
537 // @return 'eclipse centroid'
538 std::array<double,3> getEclCentroid(const int& idx) const;
539
540 // @breif Compute center of an entity/element/cell in the Eclipse way:
541 // - Average of the 4 corners of the bottom face.
542 // - Average of the 4 corners of the top face.
543 // Return average of the previous computations.
544 // @param [in] Entity<0> Entity
545 // @return 'eclipse centroid'
546 std::array<double,3> getEclCentroid(const cpgrid::Entity<0>& elem) const;
547
558
579 bool mark(int refCount, const cpgrid::Entity<0>& element, bool throwOnFailure = false);
580
584 int getMark(const cpgrid::Entity<0>& element) const;
585
588 bool preAdapt();
589
592 bool adapt();
593
612 bool refineAndUpdateGrid(bool throwOnFailure,
613 const std::vector<std::array<int,3>>& cells_per_dim_vec,
614 const std::vector<int>& assignRefinedLevel,
615 const std::vector<std::string>& lgr_name_vec,
616 const std::vector<std::array<int,3>>& startIJK_vec = std::vector<std::array<int,3>>{},
617 const std::vector<std::array<int,3>>& endIJK_vec = std::vector<std::array<int,3>>{});
618
620 void postAdapt();
622
623 private:
624 void updateCornerHistoryLevels(const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
625 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
626 const std::unordered_map<int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner,
627 const int& corner_count,
628 const std::vector<std::array<int,2>>& preAdaptGrid_corner_history,
629 const int& preAdaptMaxLevel,
630 const int& newLevels);
631
632 void globalIdsPartitionTypesLgrAndLeafGrids(const std::vector<int>& assignRefinedLevel,
633 const std::vector<std::array<int,3>>& cells_per_dim_vec,
634 const std::vector<int>& lgr_with_at_least_one_active_cell);
635
642 void getFirstChildGlobalIds([[maybe_unused]] std::vector<int>& parentToFirstChildGlobalIds);
643 public:
650 private:
651
664 void computeGlobalCellLgr(const int& level, const std::array<int,3>& startIJK, std::vector<int>& global_cell_lgr);
665
669 void computeGlobalCellLeafGridViewWithLgrs(std::vector<int>& global_cell_leaf);
670
671 private:
685 void markElemAssignLevelDetectActiveLgrs(const std::vector<std::array<int,3>>& startIJK_vec,
686 const std::vector<std::array<int,3>>& endIJK_vec,
687 std::vector<int>& assignRefinedLevel,
688 std::vector<int>& lgr_with_at_least_one_active_cell);
689
691 void populateCellIndexSetRefinedGrid(int level);
692
694 void populateCellIndexSetLeafGridView();
695
697 void populateLeafGlobalIdSet();
698
699 public:
700
705 std::vector<std::unordered_map<std::size_t, std::size_t>> mapLocalCartesianIndexSetsToLeafIndexSet() const;
706
708 std::vector<std::array<int,2>> mapLeafIndexSetToLocalCartesianIndexSets() const;
709
711 unsigned int overlapSize(int) const;
712
713
715 unsigned int ghostSize(int) const;
716
718 unsigned int overlapSize(int, int) const;
719
721 unsigned int ghostSize(int, int) const;
722
724 unsigned int numBoundarySegments() const;
725
726 void setPartitioningParams(const std::map<std::string,std::string>& params);
727
728 // loadbalance is not part of the grid interface therefore we skip it.
729
739 bool loadBalance(int overlapLayers=1,
740 int partitionMethod = Dune::PartitionMethod::zoltan,
741 double imbalanceTol = 1.1,
742 int level =-1)
743 {
744 using std::get;
745 return get<0>(scatterGrid(/* edgeWeightMethod = */ defaultTransEdgeWgt,
746 /* ownersFirst = */ false,
747 /* wells = */ nullptr,
748 /* possibleFutureConnections = */ {},
749 /* serialPartitioning = */ false,
750 /* transmissibilities = */ nullptr,
751 /* addCornerCells = */ true,
752 overlapLayers,
753 partitionMethod,
754 imbalanceTol,
755 /* allowDistributedWells = */ false,
756 /* input_cell_part = */ {},
757 level));
758 }
759
760 // loadbalance is not part of the grid interface therefore we skip it.
761
772 bool loadBalanceSerial(int overlapLayers=1,
773 int partitionMethod = Dune::PartitionMethod::zoltan,
774 int edgeWeightMethod = Dune::EdgeWeightMethod::defaultTransEdgeWgt,
775 double imbalanceTol = 1.1,
776 int level = -1)
777 {
778 using std::get;
779 return get<0>(scatterGrid(EdgeWeightMethod(edgeWeightMethod),
780 /* ownersFirst = */ false,
781 /* wells = */ nullptr,
782 /* possibleFutureConnections = */ {},
783 /* serialPartitioning = */ true,
784 /* transmissibilities = */ nullptr,
785 /* addCornerCells = */ true,
786 overlapLayers,
787 partitionMethod,
788 imbalanceTol,
789 /* allowDistributedWells = */ false,
790 /* input_cell_part = */ {},
791 level));
792 }
793
794 // loadbalance is not part of the grid interface therefore we skip it.
795
824 std::pair<bool,std::vector<std::pair<std::string,bool>>>
825 loadBalance(const std::vector<cpgrid::OpmWellType> * wells,
826 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
827 const double* transmissibilities = nullptr,
828 int overlapLayers=1, int partitionMethod=Dune::PartitionMethod::zoltanGoG,
829 int level = -1)
830 {
831 return scatterGrid(defaultTransEdgeWgt, /* ownersFirst = */ false, wells, possibleFutureConnections,
832 /* serialPartitioning = */ false, transmissibilities, /* addCornerCells = */ false,
833 overlapLayers, partitionMethod, /* imbalanceTol = */ 1.1, /* allowDistributeWells = */ false,
834 /* input_cell_part = */ {}, level);
835 }
836
837 // loadbalance is not part of the grid interface therefore we skip it.
838
872 std::pair<bool,std::vector<std::pair<std::string,bool>>>
873 loadBalance(EdgeWeightMethod method, const std::vector<cpgrid::OpmWellType> * wells,
874 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
875 const double* transmissibilities = nullptr, bool ownersFirst=false,
876 bool addCornerCells=false, int overlapLayers=1,
877 int partitionMethod = Dune::PartitionMethod::zoltanGoG,
878 double imbalanceTol = 1.1,
879 int level = -1)
880 {
881 return scatterGrid(method, ownersFirst, wells, possibleFutureConnections, /* serialPartitioning = */ false,
882 transmissibilities, addCornerCells, overlapLayers, partitionMethod, imbalanceTol,
883 /* allowDistributeWells = */ false, /* input_cell_part = */ {}, level);
884 }
885
914 template<class DataHandle>
915 std::pair<bool, std::vector<std::pair<std::string,bool> > >
916 loadBalance(DataHandle& data,
917 const std::vector<cpgrid::OpmWellType> * wells,
918 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
919 const double* transmissibilities = nullptr,
920 int overlapLayers=1, int partitionMethod = 1, int level =-1)
921 {
922 auto ret = loadBalance(wells, possibleFutureConnections, transmissibilities, overlapLayers, partitionMethod, level);
923 using std::get;
924 if (get<0>(ret))
925 {
927 }
928 return ret;
929 }
930
966 template<class DataHandle>
967 std::pair<bool, std::vector<std::pair<std::string,bool> > >
968 loadBalance(DataHandle& data, EdgeWeightMethod method,
969 const std::vector<cpgrid::OpmWellType> * wells,
970 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
971 bool serialPartitioning,
972 const double* transmissibilities = nullptr, bool ownersFirst=false,
973 bool addCornerCells=false, int overlapLayers=1, int partitionMethod = Dune::PartitionMethod::zoltanGoG,
974 double imbalanceTol = 1.1,
975 bool allowDistributedWells = false,
976 bool useTransToFilterOverlap = true)
977 {
978 auto ret = scatterGrid(method, ownersFirst, wells, possibleFutureConnections, serialPartitioning, transmissibilities,
979 addCornerCells, overlapLayers, partitionMethod, imbalanceTol, allowDistributedWells,
980 /* input_cell_parts = */ std::vector<int>{}, /* level = */ 0,
981 useTransToFilterOverlap);
982 using std::get;
983 if (get<0>(ret))
984 {
986 }
987 return ret;
988 }
989
1014 template<class DataHandle>
1015 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1016 loadBalance(DataHandle& data, const std::vector<int>& parts,
1017 const std::vector<cpgrid::OpmWellType> * wells,
1018 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1019 bool ownersFirst=false,
1020 bool addCornerCells=false, int overlapLayers=1)
1021 {
1022 using std::get;
1023 auto ret = scatterGrid(defaultTransEdgeWgt, ownersFirst, wells,
1024 possibleFutureConnections,
1025 /* serialPartitioning = */ false,
1026 /* transmissibilities = */ {},
1027 addCornerCells, overlapLayers, /* partitionMethod =*/ Dune::PartitionMethod::simple,
1028 /* imbalanceTol (ignored) = */ 0.0,
1029 /* allowDistributedWells = */ true, parts, /* level = */ 0);
1030 using std::get;
1031 if (get<0>(ret))
1032 {
1034 }
1035 return ret;
1036 }
1037
1045 template<class DataHandle>
1046 bool loadBalance(DataHandle& data,
1047 decltype(data.fixedSize(0,0)) overlapLayers=1, int partitionMethod = Dune::PartitionMethod::zoltan)
1048 {
1049 // decltype usage needed to tell the compiler not to use this function if first
1050 // argument is std::vector but rather loadbalance by parts
1051 bool ret = loadBalance(overlapLayers, partitionMethod);
1052 if (ret)
1053 {
1055 }
1056 return ret;
1057 }
1058
1070 bool loadBalance(const std::vector<int>& parts, bool ownersFirst=false,
1071 bool addCornerCells=false, int overlapLayers=1)
1072 {
1073 using std::get;
1074 return get<0>(scatterGrid(defaultTransEdgeWgt, ownersFirst, /* wells = */ {},
1075 {},
1076 /* serialPartitioning = */ false,
1077 /* trabsmissibilities = */ {},
1078 addCornerCells, overlapLayers, /* partitionMethod =*/ Dune::PartitionMethod::simple,
1079 /* imbalanceTol (ignored) = */ 0.0,
1080 /* allowDistributedWells = */ true, parts));
1081 }
1082
1095 template<class DataHandle>
1096 bool loadBalance(DataHandle& data, const std::vector<int>& parts, bool ownersFirst=false,
1097 bool addCornerCells=false, int overlapLayers=1)
1098 {
1099 bool ret = loadBalance(parts, ownersFirst, addCornerCells, overlapLayers);
1100 if (ret)
1101 {
1103 }
1104 return ret;
1105 }
1106
1120 std::vector<int>
1121 zoltanPartitionWithoutScatter(const std::vector<cpgrid::OpmWellType>* wells,
1122 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1123 const double* transmissibilities,
1124 const int numParts,
1125 const double imbalanceTol) const;
1126
1134 template<class DataHandle>
1135 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir, int /*level*/) const
1136 {
1137 communicate(data, iftype, dir);
1138 }
1139
1147 template<class DataHandle>
1148 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir) const;
1149
1151 const typename CpGridTraits::Communication& comm () const;
1153
1154 // ------------ End of Dune interface, start of simplified interface --------------
1155
1161
1162 // enum { dimension = 3 }; // already defined
1163
1164 typedef Dune::FieldVector<double, 3> Vector;
1165
1166
1167 const std::vector<double>& zcornData() const;
1168
1169
1170 // Topology
1175 int numCells(int level = -1) const;
1176
1181 int numFaces(int level = -1) const;
1182
1184 int numVertices() const;
1185
1186
1195 int numCellFaces(int cell, int level = -1) const;
1196
1203 int cellFace(int cell, int local_index, int level = -1) const;
1204
1208
1228 int faceCell(int face, int local_index, int level = -1) const;
1229
1236 int numCellFaces() const;
1237
1238 int numFaceVertices(int face) const;
1239
1244 int faceVertex(int face, int local_index) const;
1245
1248 double cellCenterDepth(int cell_index) const;
1249
1250
1251 const Vector faceCenterEcl(int cell_index, int face, const Dune::cpgrid::Intersection& intersection) const;
1252
1253 const Vector faceAreaNormalEcl(int face) const;
1255 const Vector faceAreaNormalEcl(int face, int level) const;
1256
1257
1258 // Geometry
1262 const Vector& vertexPosition(int vertex) const;
1263
1266 double faceArea(int face) const;
1267
1270 const Vector& faceCentroid(int face) const;
1271
1275 const Vector& faceNormal(int face) const;
1276
1279 double cellVolume(int cell) const;
1280
1283 const Vector& cellCentroid(int cell) const;
1284
1287 template<int codim>
1289 : public RandomAccessIteratorFacade<CentroidIterator<codim>,
1290 FieldVector<double, 3>,
1291 const FieldVector<double, 3>&, int>
1292 {
1293 public:
1295 typedef typename std::vector<cpgrid::Geometry<3-codim, 3> >::const_iterator
1300 : iter_(iter)
1301 {}
1302
1303 const FieldVector<double,3>& dereference() const
1304 {
1305 return iter_->center();
1306 }
1308 {
1309 ++iter_;
1310 }
1311 const FieldVector<double,3>& elementAt(int n)
1312 {
1313 return iter_[n]->center();
1314 }
1315 void advance(int n){
1316 iter_+=n;
1317 }
1319 {
1320 --iter_;
1321 }
1323 {
1324 return o-iter_;
1325 }
1326 bool equals(const CentroidIterator& o) const{
1327 return o==iter_;
1328 }
1329 private:
1331 GeometryIterator iter_;
1332 };
1333
1336
1339
1340 // Extra
1341 int boundaryId(int face) const;
1342
1349 template<class Cell2FacesRowIterator>
1350 int
1351 faceTag(const Cell2FacesRowIterator& cell_face) const;
1352
1354
1355 // ------------ End of simplified interface --------------
1356
1357 //------------- methods not in the DUNE grid interface.
1358
1363
1364
1373 template<class DataHandle>
1374 void scatterData(DataHandle& handle) const;
1375
1382 template<class DataHandle>
1383 void gatherData(DataHandle& handle) const;
1384
1387
1417
1421
1424
1428
1429#if HAVE_MPI
1434
1437
1442
1444
1446
1448
1450#endif
1451
1453 const std::vector<int>& sortedNumAquiferCells() const;
1454
1455 private:
1487 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1488 scatterGrid(EdgeWeightMethod method,
1489 bool ownersFirst,
1490 const std::vector<cpgrid::OpmWellType> * wells,
1491 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1492 bool serialPartitioning,
1493 const double* transmissibilities,
1494 bool addCornerCells,
1495 int overlapLayers,
1496 int partitionMethod = Dune::PartitionMethod::zoltanGoG,
1497 double imbalanceTol = 1.1,
1498 bool allowDistributedWells = true,
1499 const std::vector<int>& input_cell_part = {},
1500 int level = -1,
1501 bool useTransToFilterOverlap = true);
1502
1507 std::vector<std::shared_ptr<cpgrid::CpGridData>> data_;
1509 std::vector<std::shared_ptr<cpgrid::CpGridData>> distributed_data_;
1511 std::vector<std::shared_ptr<cpgrid::CpGridData>>* current_data_;
1513 std::map<std::string,int> lgr_names_ = {{"GLOBAL", 0}};
1515 std::shared_ptr<Opm::Refinement::Builder> refinement_builder_;
1521 std::shared_ptr<InterfaceMap> cell_scatter_gather_interfaces_;
1522 /*
1523 * @brief Interface for scattering and gathering point data.
1524 *
1525 * @warning Will only update owner cells
1526 */
1527 std::shared_ptr<InterfaceMap> point_scatter_gather_interfaces_;
1531 std::shared_ptr<cpgrid::GlobalIdSet> global_id_set_ptr_;
1532
1533
1537 std::map<std::string,std::string> partitioningParams;
1538
1539 }; // end Class CpGrid
1540
1541} // end namespace Dune
1542
1546
1547
1548namespace Dune
1549{
1550
1551 namespace Capabilities
1552 {
1554 template <>
1555 struct hasEntity<CpGrid, 0>
1556 {
1557 static const bool v = true;
1558 };
1559
1561 template <>
1562 struct hasEntity<CpGrid, 3>
1563 {
1564 static const bool v = true;
1565 };
1566
1567 template<>
1568 struct canCommunicate<CpGrid,0>
1569 {
1570 static const bool v = true;
1571 };
1572
1573 template<>
1574 struct canCommunicate<CpGrid,3>
1575 {
1576 static const bool v = true;
1577 };
1578
1580 template <>
1581 struct hasBackupRestoreFacilities<CpGrid>
1582 {
1583 static const bool v = false;
1584 };
1585
1586 }
1587
1588 template<class DataHandle>
1589 void CpGrid::communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir) const
1590 {
1591 current_data_->back()->communicate(data, iftype, dir);
1592 }
1593
1594
1595 template<class DataHandle>
1596 void CpGrid::scatterData([[maybe_unused]] DataHandle& handle) const
1597 {
1598#if HAVE_MPI
1599 if (distributed_data_.empty()) {
1600 OPM_THROW(std::runtime_error, "Moving Data only allowed with a load balanced grid!");
1601 } else {
1602 distributed_data_[0]->scatterData(handle, data_[0].get(),
1603 distributed_data_[0].get(),
1606 }
1607#endif
1608 }
1609
1610 template<class DataHandle>
1611 void CpGrid::gatherData([[maybe_unused]] DataHandle& handle) const
1612 {
1613#if HAVE_MPI
1614 if (distributed_data_.empty()) {
1615 OPM_THROW(std::runtime_error, "Moving Data only allowed with a load balance grid!");
1616 } else {
1617 distributed_data_[0]->gatherData(handle, data_[0].get(), distributed_data_[0].get());
1618 }
1619#endif
1620 }
1621
1622
1623 template<class Cell2FacesRowIterator>
1624 int
1625 CpGrid::faceTag(const Cell2FacesRowIterator& cell_face) const
1626 {
1627 // Note that this relies on the following implementation detail:
1628 // The grid is always constructed such that the interior faces constructed
1629 // with orientation set to true are
1630 // oriented along the positive IJK direction. Oriented means that
1631 // the first cell attached to face has the lower index.
1632 // For faces along the boundary (only one cell, always attached at index 0)
1633 // the orientation has to be determined by the orientation of the cell.
1634 // If it is true then in UnstructuredGrid it would be stored at index 0,
1635 // otherwise at index 1.
1636 const int cell = cell_face.getCellIndex();
1637 const int face = *cell_face;
1638 assert (0 <= cell); assert (cell < numCells());
1639 assert (0 <= face); assert (face < numFaces());
1640
1642
1643 const cpgrid::EntityRep<1> f(face, true);
1644 const F2C& f2c = current_data_->back()->face_to_cell_[f];
1645 const face_tag tag = current_data_->back()->face_tag_[f];
1646
1647 assert ((f2c.size() == 1) || (f2c.size() == 2));
1648
1649 int inside_cell = 0;
1650
1651 if ( f2c.size() == 2 ) // Two cells => interior
1652 {
1653 if ( f2c[1].index() == cell )
1654 {
1655 inside_cell = 1;
1656 }
1657 }
1658 const bool normal_is_in = ! f2c[inside_cell].orientation();
1659
1660 switch (tag) {
1661 case I_FACE:
1662 // LEFT : RIGHT
1663 return normal_is_in ? 0 : 1; // min(I) : max(I)
1664 case J_FACE:
1665 // BACK : FRONT
1666 return normal_is_in ? 2 : 3; // min(J) : max(J)
1667 case K_FACE:
1668 // Note: TOP at min(K) as 'z' measures *depth*.
1669 // TOP : BOTTOM
1670 return normal_is_in ? 4 : 5; // min(K) : max(K)
1671 case NNC_FACE:
1672 // For nnc faces we return the otherwise unused value -1.
1673 return -1;
1674 default:
1675 OPM_THROW(std::logic_error, "Unhandled face tag. This should never happen!");
1676 }
1677 }
1678
1679 template<int dim>
1681
1682} // namespace Dune
1683
1686#include "cpgrid/Intersection.hpp"
1687#include "cpgrid/Geometry.hpp"
1688#include "cpgrid/Indexsets.hpp"
1689
1690#endif // OPM_CPGRID_HEADER
DataHandle & data
Definition: CpGridData.hpp:1136
An iterator over the centroids of the geometry of the entities.
Definition: CpGrid.hpp:1292
void increment()
Definition: CpGrid.hpp:1307
CentroidIterator(GeometryIterator iter)
Constructs a new iterator from an iterator over the geometries.
Definition: CpGrid.hpp:1299
const FieldVector< double, 3 > & dereference() const
Definition: CpGrid.hpp:1303
int distanceTo(const CentroidIterator &o)
Definition: CpGrid.hpp:1322
void decrement()
Definition: CpGrid.hpp:1318
void advance(int n)
Definition: CpGrid.hpp:1315
std::vector< cpgrid::Geometry< 3-codim, 3 > >::const_iterator GeometryIterator
The type of the iterator over the codim geometries.
Definition: CpGrid.hpp:1296
bool equals(const CentroidIterator &o) const
Definition: CpGrid.hpp:1326
const FieldVector< double, 3 > & elementAt(int n)
Definition: CpGrid.hpp:1311
[ provides Dune::Grid ]
Definition: CpGrid.hpp:204
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(DataHandle &data, const std::vector< int > &parts, const std::vector< cpgrid::OpmWellType > *wells, const std::unordered_map< std::string, std::set< int > > &possibleFutureConnections={}, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:1016
std::string name() const
Get the grid name.
std::vector< std::unordered_map< std::size_t, std::size_t > > mapLocalCartesianIndexSetsToLeafIndexSet() const
Compute for each level grid, a map from the global_cell_[ cell index in level grid ] to the leaf inde...
CentroidIterator< 0 > beginCellCentroids() const
Get an iterator over the cell centroids positioned at the first one.
void switchToGlobalView()
Switch to the global view.
const Vector faceCenterEcl(int cell_index, int face, const Dune::cpgrid::Intersection &intersection) const
int numFaceVertices(int face) const
unsigned int numBoundarySegments() const
returns the number of boundary segments within the macro grid
CpGridFamily GridFamily
Family typedef, why is this not defined by Grid<>?
Definition: CpGrid.hpp:219
Traits::template Codim< codim >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
void gatherData(DataHandle &handle) const
Moves data from the distributed view to the global (all data on process) view.
Definition: CpGrid.hpp:1611
CentroidIterator< 1 > beginFaceCentroids() const
Get an iterator over the face centroids positioned at the first one.
int numFaces(int level=-1) const
Get the number of faces.
std::vector< std::array< int, 2 > > mapLeafIndexSetToLocalCartesianIndexSets() const
Reverse map: from leaf index cell to { level, local/level Cartesian index of the cell }.
const std::vector< std::shared_ptr< Dune::cpgrid::CpGridData > > & currentData() const
Returns either data_ or distributed_data_(if non empty).
int size(GeometryType type) const
number of leaf entities per geometry type in this process
cpgrid::CpGridDataTraits::ParallelIndexSet ParallelIndexSet
The type of the parallel index set.
Definition: CpGrid.hpp:1431
int faceTag(const Cell2FacesRowIterator &cell_face) const
Get the cartesian tag associated with a face tag.
Definition: CpGrid.hpp:1625
const std::vector< double > & zcornData() const
ParallelIndexSet & getCellIndexSet()
void setUniqueBoundaryIds(bool uids)
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(DataHandle &data, EdgeWeightMethod method, const std::vector< cpgrid::OpmWellType > *wells, const std::unordered_map< std::string, std::set< int > > &possibleFutureConnections, bool serialPartitioning, const double *transmissibilities=nullptr, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1, int partitionMethod=Dune::PartitionMethod::zoltanGoG, double imbalanceTol=1.1, bool allowDistributedWells=false, bool useTransToFilterOverlap=true)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:968
std::array< double, 3 > getEclCentroid(const cpgrid::Entity< 0 > &elem) const
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(EdgeWeightMethod method, const std::vector< cpgrid::OpmWellType > *wells, const std::unordered_map< std::string, std::set< int > > &possibleFutureConnections={}, const double *transmissibilities=nullptr, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1, int partitionMethod=Dune::PartitionMethod::zoltanGoG, double imbalanceTol=1.1, int level=-1)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:873
void createCartesian(const std::array< int, 3 > &dims, const std::array< double, 3 > &cellsize, const std::array< int, 3 > &shift={0, 0, 0})
Traits::template Codim< codim >::LeafIterator leafend() const
one past the end of the sequence of leaf entities
unsigned int overlapSize(int) const
Size of the overlap on the leaf level.
cpgrid::CpGridDataTraits::InterfaceMap InterfaceMap
The type of the map describing communication interfaces.
Definition: CpGrid.hpp:1386
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(DataHandle &data, const std::vector< cpgrid::OpmWellType > *wells, const std::unordered_map< std::string, std::set< int > > &possibleFutureConnections={}, const double *transmissibilities=nullptr, int overlapLayers=1, int partitionMethod=1, int level=-1)
Distributes this grid and data over the available nodes in a distributed machine.
Definition: CpGrid.hpp:916
Traits::template Codim< codim >::LevelIterator lend(int level) const
one past the end on this level
int numCellFaces() const
Get the sum of all faces attached to all cells.
std::vector< std::size_t > processEclipseFormat(const Opm::EclipseGrid *ecl_grid, Opm::EclipseState *ecl_state, bool periodic_extension, bool turn_normals=false, bool clip_z=false, bool edge_conformal=false)
const Dune::cpgrid::CpGridData & currentLeafData() const
Returns current view data (the leaf grid)
const std::vector< int > & globalCell() const
bool loadBalanceSerial(int overlapLayers=1, int partitionMethod=Dune::PartitionMethod::zoltan, int edgeWeightMethod=Dune::EdgeWeightMethod::defaultTransEdgeWgt, double imbalanceTol=1.1, int level=-1)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:772
const Traits::LocalIdSet & localIdSet() const
Access to the LocalIdSet.
bool loadBalance(int overlapLayers=1, int partitionMethod=Dune::PartitionMethod::zoltan, double imbalanceTol=1.1, int level=-1)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:739
int maxLevel() const
Return maximum level defined in this grid. Levels are 0 and 1, maxlevel = 1 (not counting leafview),...
const CpGridTraits::Communication & comm() const
Get the collective communication object.
double faceArea(int face) const
Get the area of a face.
const std::vector< Dune::GeometryType > & geomTypes(const int) const
void postAdapt()
Clean up refinement markers - set every element to the mark 0 which represents 'doing nothing'.
void addLgrsUpdateLeafView(std::vector< Opm::Refinement::BlockRefinement > requests)
The same refinement given as block requests. Under the Conforming backend the requests may also be gr...
const Vector & vertexPosition(int vertex) const
Get the Position of a vertex.
int size(int level, int codim) const
Number of grid entities per level and codim.
const std::array< int, 3 > & logicalCartesianSize() const
int faceVertex(int face, int local_index) const
Get the index identifying a vertex of a face.
const Vector & faceCentroid(int face) const
Get the coordinates of the center of a face.
unsigned int ghostSize(int, int) const
Size of the ghost cell layer on a given level.
bool mark(int refCount, const cpgrid::Entity< 0 > &element, bool throwOnFailure=false)
Mark entity for refinement (or coarsening).
cpgrid::CpGridDataTraits::RemoteIndices RemoteIndices
The type of the remote indices information.
Definition: CpGrid.hpp:1433
void setRefinementBuilder(std::shared_ptr< Opm::Refinement::Builder > builder)
The builder the Conforming backend refines with.
const InterfaceMap & cellScatterGatherInterface() const
Get an interface for gathering/scattering data attached to cells with communication.
int numVertices() const
Get The number of vertices.
Dune::cpgrid::Intersection getParentIntersectionFromLgrBoundaryFace(const Dune::cpgrid::Intersection &intersection) const
Returns the coarse-level-zero ("parent/origin") intersection of a refined intersection (face) in the ...
void getIJK(const int c, std::array< int, 3 > &ijk) const
Extract Cartesian index triplet (i,j,k) of an active cell.
void processEclipseFormat(const grdecl &input_data, bool remove_ij_boundary, bool turn_normals=false, bool edge_conformal=false)
void syncDistributedGlobalCellIds()
Synchronizes cell global ids across processes after load balancing.
bool uniqueBoundaryIds() const
int faceCell(int face, int local_index, int level=-1) const
Get the index identifying a cell attached to a face.
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator lend(int level) const
one past the end on this level
void setPartitioningParams(const std::map< std::string, std::string > &params)
void setLgrBackend(Opm::Refinement::Backend backend)
Choose the refinement algorithm; only before the grid is refined.
const Traits::GlobalIdSet & globalIdSet() const
Access to the GlobalIdSet.
void globalRefine(int refCount, bool throwOnFailure=false)
Refine the grid refCount times using the default refinement rule. This behaves like marking all eleme...
CpGrid(MPIHelper::MPICommunicator comm)
const ParallelIndexSet & getCellIndexSet() const
cpgrid::Entity< codim > entity(const cpgrid::Entity< codim > &seed) const
given an EntitySeed (or EntityPointer) return an entity object
std::vector< std::shared_ptr< Dune::cpgrid::CpGridData > > & currentData()
Returns either data_ or distributed_data_(if non empty).
int boundaryId(int face) const
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafbegin() const
Iterator to first leaf entity of given codim and PartitionIteratorType.
void addLgrsUpdateLeafView(const std::vector< std::array< int, 3 > > &cells_per_dim_vec, const std::vector< std::array< int, 3 > > &startIJK_vec, const std::vector< std::array< int, 3 > > &endIJK_vec, const std::vector< std::string > &lgr_name_vec, const std::vector< std::string > &lgr_parent_grid_name_vec=std::vector< std::string >{})
Create a grid out of a coarse one and (at most) 2 refinements(LGRs) of selected block-shaped disjoint...
bool loadBalance(DataHandle &data, decltype(data.fixedSize(0, 0)) overlapLayers=1, int partitionMethod=Dune::PartitionMethod::zoltan)
Distributes this grid and data over the available nodes in a distributed machine.
Definition: CpGrid.hpp:1046
unsigned int overlapSize(int, int) const
Size of the overlap on a given level.
unsigned int ghostSize(int) const
Size of the ghost cell layer on the leaf level.
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(const std::vector< cpgrid::OpmWellType > *wells, const std::unordered_map< std::string, std::set< int > > &possibleFutureConnections={}, const double *transmissibilities=nullptr, int overlapLayers=1, int partitionMethod=Dune::PartitionMethod::zoltanGoG, int level=-1)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:825
friend cpgrid::Entity< dim > createEntity(const CpGrid &, int, bool)
Dune::cpgrid::CpGridData & currentLeafData()
Returns current view data (the leaf grid)
const Vector & cellCentroid(int cell) const
Get the coordinates of the center of a cell.
Traits::template Codim< codim >::LeafIterator leafbegin() const
Iterator to first leaf entity of given codim.
const Vector & faceNormal(int face) const
Get the unit normal of a face.
Dune::FieldVector< double, 3 > Vector
Definition: CpGrid.hpp:1164
CpGrid()
Default constructor.
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level and PartitionIteratorType.
const std::map< std::string, int > & getLgrNameToLevel() const
const std::vector< int > & sortedNumAquiferCells() const
Get sorted active cell indices of numerical aquifer.
bool adapt()
Triggers the grid refinement process. Returns true if the grid has changed, false otherwise.
void switchToDistributedView()
Switch to the distributed view.
const RemoteIndices & getCellRemoteIndices() const
const Vector faceAreaNormalEcl(int face) const
bool preAdapt()
Set mightVanish flags for elements that will be refined in the next adapt() call Need to be called af...
int getMark(const cpgrid::Entity< 0 > &element) const
Return refinement mark for entity.
bool loadBalance(DataHandle &data, const std::vector< int > &parts, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1)
Distributes this grid and data over the available nodes in a distributed machine.
Definition: CpGrid.hpp:1096
const Traits::LeafIndexSet & leafIndexSet() const
Access to the LeafIndexSet.
const cpgrid::OrientedEntityTable< 0, 1 >::row_type cellFaceRow(int cell) const
Get a list of indices identifying all faces of a cell.
bool refineAndUpdateGrid(bool throwOnFailure, const std::vector< std::array< int, 3 > > &cells_per_dim_vec, const std::vector< int > &assignRefinedLevel, const std::vector< std::string > &lgr_name_vec, const std::vector< std::array< int, 3 > > &startIJK_vec=std::vector< std::array< int, 3 > >{}, const std::vector< std::array< int, 3 > > &endIJK_vec=std::vector< std::array< int, 3 > >{})
Triggers the grid refinement process, allowing to select diffrent refined level grids.
const Vector faceAreaNormalEcl(int face, int level) const
As above, for a face of the given level's grid.
bool loadBalance(const std::vector< int > &parts, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:1070
std::vector< int > zoltanPartitionWithoutScatter(const std::vector< cpgrid::OpmWellType > *wells, const std::unordered_map< std::string, std::set< int > > &possibleFutureConnections, const double *transmissibilities, const int numParts, const double imbalanceTol) const
Partitions the grid using Zoltan without decomposing and distributing it among processes.
int size(int level, GeometryType type) const
number of entities per level and geometry type in this process
std::array< double, 3 > getEclCentroid(const int &idx) const
int numCells(int level=-1) const
Get the number of cells.
double cellCenterDepth(int cell_index) const
Get vertical position of cell center ("zcorn" average).
Opm::Refinement::Backend lgrBackend() const
Definition: CpGrid.hpp:513
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir, int) const
communicate objects for all codims on a given level
Definition: CpGrid.hpp:1135
const Traits::LevelIndexSet & levelIndexSet(int level) const
Access to the LevelIndexSets.
RemoteIndices & getCellRemoteIndices()
cpgrid::CpGridDataTraits::CommunicationType CommunicationType
The type of the owner-overlap-copy communication.
Definition: CpGrid.hpp:1436
int size(int codim) const
number of leaf entities per codim in this process
const InterfaceMap & pointScatterGatherInterface() const
Get an interface for gathering/scattering data attached to points with communication.
int cellFace(int cell, int local_index, int level=-1) const
Get a specific face of a cell.
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafend() const
one past the end of the sequence of leaf entities
int numCellFaces(int cell, int level=-1) const
Get the number of faces of a cell.
double cellVolume(int cell) const
Get the volume of the cell.
void autoRefine(const std::array< int, 3 > &nxnynz)
Global refine the grid with different refinement factors in each direction.
const CommunicationType & cellCommunication() const
Get the owner-overlap-copy communication for cells.
void scatterData(DataHandle &handle) const
Moves data from the global (all data on process) view to the distributed view.
Definition: CpGrid.hpp:1596
std::vector< std::size_t > processEclipseFormat(const Opm::EclipseGrid *ecl_grid, Opm::EclipseState *ecl_state, bool periodic_extension, bool turn_normals, bool clip_z, bool pinchActive, bool edge_conformal)
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:117
Represents an entity of a given codim, with positive or negative orientation.
Definition: EntityRep.hpp:98
Definition: Geometry.hpp:76
The global id set for Dune.
Definition: Indexsets.hpp:483
Only needs to provide interface for doing nothing.
Definition: Iterators.hpp:118
Definition: Indexsets.hpp:57
Definition: Intersection.hpp:278
Definition: Intersection.hpp:63
Definition: Iterators.hpp:60
A class used as a row type for OrientedEntityTable.
Definition: OrientedEntityTable.hpp:55
The namespace Dune is the main namespace for all Dune code.
Definition: common/CartesianIndexMapper.hpp:10
cpgrid::Entity< dim > createEntity(const CpGrid &, int, bool)
@ simple
Use simple approach based on rectangular partitioning the underlying cartesian grid.
Definition: GridEnums.hpp:46
@ zoltanGoG
use Zoltan on GraphOfGrid for partitioning
Definition: GridEnums.hpp:52
@ zoltan
Use Zoltan for partitioning.
Definition: GridEnums.hpp:48
EdgeWeightMethod
enum for choosing Methods for weighting graph-edges correspoding to cell interfaces in Zoltan's or Me...
Definition: GridEnums.hpp:34
@ defaultTransEdgeWgt
Use the transmissibilities as edge weights.
Definition: GridEnums.hpp:38
void getFirstChildGlobalIds(const Dune::CpGrid &grid, std::vector< int > &parentToFirstChildGlobalIds)
Retrieves the global ids of the first child for each parent cell in the grid.
Backend
Definition: RefinementBuilder.hpp:57
Holds the implementation of the CpGrid as a pimple.
Definition: CellQuadrature.hpp:26
face_tag
Definition: preprocess.h:66
@ K_FACE
Definition: preprocess.h:69
@ J_FACE
Definition: preprocess.h:68
@ NNC_FACE
Definition: preprocess.h:70
@ I_FACE
Definition: preprocess.h:67
Definition: CpGrid.hpp:191
CpGridTraits Traits
Definition: CpGrid.hpp:192
Traits associated with a specific grid partition type.
Definition: CpGrid.hpp:145
cpgrid::Iterator< cd, pitype > LevelIterator
The type of the iterator over the level entities of this codim on this partition.
Definition: CpGrid.hpp:147
cpgrid::Iterator< cd, pitype > LeafIterator
The type of the iterator over the leaf entities of this codim on this partition.
Definition: CpGrid.hpp:149
Traits associated with a specific codim.
Definition: CpGrid.hpp:121
cpgrid::Entity< cd > Entity
The type of the entity.
Definition: CpGrid.hpp:130
cpgrid::Geometry< 3-cd, 3 > Geometry
The type of the geometry associated with the entity. IMPORTANT: Codim<codim>::Geometry == Geometry<di...
Definition: CpGrid.hpp:124
cpgrid::Geometry< 3-cd, 3 > LocalGeometry
The type of the local geometry associated with the entity.
Definition: CpGrid.hpp:127
cpgrid::Iterator< cd, All_Partition > LeafIterator
The type of the iterator over all leaf entities of this codim.
Definition: CpGrid.hpp:136
cpgrid::Iterator< cd, All_Partition > LevelIterator
The type of the iterator over all level entities of this codim.
Definition: CpGrid.hpp:133
cpgrid::Entity< cd > EntitySeed
The type of the entity pointer for entities of this codim.
Definition: CpGrid.hpp:139
Traits associated with a specific grid partition type.
Definition: CpGrid.hpp:157
Dune::GridView< DefaultLeafGridViewTraits< CpGrid > > LeafGridView
The type of the leaf grid view associated with this partition type.
Definition: CpGrid.hpp:161
Dune::GridView< DefaultLevelGridViewTraits< CpGrid > > LevelGridView
The type of the level grid view associated with this partition type.
Definition: CpGrid.hpp:159
Definition: CpGrid.hpp:101
cpgrid::IndexSet LevelIndexSet
The type of the level index set.
Definition: CpGrid.hpp:171
cpgrid::IntersectionIterator LeafIntersectionIterator
The type of the intersection iterator at the leafs of the grid.
Definition: CpGrid.hpp:110
Dune::GridView< DefaultLeafGridViewTraits< CpGrid > > LeafGridView
The type of the leaf grid view associated with this partition type.
Definition: CpGrid.hpp:168
Dune::GridView< DefaultLevelGridViewTraits< CpGrid > > LevelGridView
The type of the level grid view associated with this partition type.
Definition: CpGrid.hpp:166
cpgrid::GlobalIdSet GlobalIdSet
The type of the global id set.
Definition: CpGrid.hpp:175
cpgrid::IntersectionIterator LevelIntersectionIterator
The type of the intersection iterator at the levels of the grid.
Definition: CpGrid.hpp:112
cpgrid::IndexSet LeafIndexSet
The type of the leaf index set.
Definition: CpGrid.hpp:173
cpgrid::CpGridDataTraits::CollectiveCommunication CollectiveCommunication
Definition: CpGrid.hpp:181
GlobalIdSet LocalIdSet
The type of the local id set.
Definition: CpGrid.hpp:177
cpgrid::CpGridDataTraits::Communication Communication
The type of the collective communication.
Definition: CpGrid.hpp:180
cpgrid::HierarchicIterator HierarchicIterator
The type of the hierarchic iterator.
Definition: CpGrid.hpp:115
cpgrid::Intersection LevelIntersection
The type of the intersection at the levels of the grid.
Definition: CpGrid.hpp:108
cpgrid::Intersection LeafIntersection
The type of the intersection at the leafs of the grid.
Definition: CpGrid.hpp:106
CpGrid Grid
The type that implements the grid.
Definition: CpGrid.hpp:103
Dune::RemoteIndices< ParallelIndexSet > RemoteIndices
The type of the remote indices information.
Definition: CpGridDataTraits.hpp:83
typename CommunicationType::ParallelIndexSet ParallelIndexSet
The type of the parallel index set.
Definition: CpGridDataTraits.hpp:80
Dune::Communication< MPICommunicator > CollectiveCommunication
Definition: CpGridDataTraits.hpp:59
Dune::OwnerOverlapCopyCommunication< int, int > CommunicationType
type of OwnerOverlap communication for cells
Definition: CpGridDataTraits.hpp:77
Dune::Communication< MPICommunicator > Communication
Definition: CpGridDataTraits.hpp:58
Communicator::InterfaceMap InterfaceMap
The type of the map describing communication interfaces.
Definition: CpGridDataTraits.hpp:74
Definition: preprocess.h:56