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 <cstdint>
61#include <set>
62#include <utility>
63
64namespace Opm
65{
66struct NNCdata;
67class EclipseGrid;
68class EclipseState;
69}
70
71namespace Dune
72{
73 class CpGrid;
74
75 namespace cpgrid
76 {
77 class CpGridData;
78 template <int> class Entity;
79 template<int,int> class Geometry;
80 class HierarchicIterator;
81 class IntersectionIterator;
82 template<int, PartitionIteratorType> class Iterator;
83 class LevelGlobalIdSet;
84 class GlobalIdSet;
85 class Intersection;
86 class IntersectionIterator;
87 class IndexSet;
88 class IdSet;
89
90 }
91}
92
93namespace Dune
94{
95
97 //
98 // CpGridTraits
99 //
101
103 {
105 typedef CpGrid Grid;
106
115
118
121 template <int cd>
122 struct Codim
123 {
126 typedef cpgrid::Geometry<3-cd, 3> Geometry;
127 //typedef Dune::Geometry<3-cd, 3, CpGrid, cpgrid::Geometry> Geometry;
130 //typedef Dune::Geometry<3-cd, 3, CpGrid, cpgrid::Geometry> LocalGeometry;
133
136
139
142
145 template <PartitionIteratorType pitype>
147 {
152 };
153 };
154
157 template <PartitionIteratorType pitype>
159 {
161 typedef Dune::GridView<DefaultLevelGridViewTraits<CpGrid> > LevelGridView;
163 typedef Dune::GridView<DefaultLeafGridViewTraits<CpGrid> > LeafGridView;
164
165 };
166
168 typedef Dune::GridView<DefaultLevelGridViewTraits<CpGrid>> LevelGridView;
170 typedef Dune::GridView<DefaultLeafGridViewTraits<CpGrid>> LeafGridView;
171
180
184 };
185
187 //
188 // CpGridFamily
189 //
191
193 {
195 };
196
198 //
199 // CpGrid
200 //
202
204 class CpGrid
205 : public GridDefaultImplementation<3, 3, double, CpGridFamily>
206 {
207 friend class cpgrid::CpGridData;
208 friend class cpgrid::Entity<0>;
209 friend class cpgrid::Entity<1>;
210 friend class cpgrid::Entity<2>;
211 friend class cpgrid::Entity<3>;
212 template<int dim>
213 friend cpgrid::Entity<dim> createEntity(const CpGrid&,int,bool);
214
215 public:
216
217 // --- Typedefs ---
218
219
222
223
224 // --- Methods ---
225
226
229
230 explicit CpGrid(MPIHelper::MPICommunicator comm);
231
274 std::vector<std::size_t>
275 processEclipseFormat(const Opm::EclipseGrid* ecl_grid,
276 Opm::EclipseState* ecl_state,
277 bool periodic_extension,
278 bool turn_normals,
279 bool clip_z,
280 bool pinchActive,
281 bool edge_conformal);
282
320 std::vector<std::size_t>
321 processEclipseFormat(const Opm::EclipseGrid* ecl_grid,
322 Opm::EclipseState* ecl_state,
323 bool periodic_extension,
324 bool turn_normals = false,
325 bool clip_z = false,
326 bool edge_conformal = false);
327
342 void processEclipseFormat(const grdecl& input_data,
343 bool remove_ij_boundary,
344 bool turn_normals = false,
345 bool edge_conformal = false);
346
348
350
351
380 void appendDisjointGrid(const CpGrid& other);
381
403 void addNnc(const std::vector<std::pair<int, int>>& nnc);
405
411
412
419 void createCartesian(const std::array<int, 3>& dims,
420 const std::array<double, 3>& cellsize,
421 const std::array<int, 3>& shift = {0,0,0});
422
426 const std::array<int, 3>& logicalCartesianSize() const;
427
435 const std::vector<int>& globalCell() const;
436
439 std::vector<std::int64_t> stableCellId() const;
440
442 const std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& currentData() const;
443
445 std::vector<std::shared_ptr<Dune::cpgrid::CpGridData>>& currentData();
446
449
452
460 void getIJK(const int c, std::array<int,3>& ijk) const;
462
466 bool uniqueBoundaryIds() const;
467
470 void setUniqueBoundaryIds(bool uids);
471
472
473 // --- Dune interface below ---
474
476 // \@{
481 std::string name() const;
482
484 int maxLevel() const;
485
487 template<int codim>
488 typename Traits::template Codim<codim>::LevelIterator lbegin (int level) const;
490 template<int codim>
491 typename Traits::template Codim<codim>::LevelIterator lend (int level) const;
492
494 template<int codim, PartitionIteratorType PiType>
495 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator lbegin (int level) const;
497 template<int codim, PartitionIteratorType PiType>
498 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator lend (int level) const;
499
501 template<int codim>
502 typename Traits::template Codim<codim>::LeafIterator leafbegin() const;
504 template<int codim>
505 typename Traits::template Codim<codim>::LeafIterator leafend() const;
506
508 template<int codim, PartitionIteratorType PiType>
509 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafbegin() const;
511 template<int codim, PartitionIteratorType PiType>
512 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafend() const;
513
515 int size (int level, int codim) const;
516
518 int size (int codim) const;
519
521 int size (int level, GeometryType type) const;
522
524 int size (GeometryType type) const;
525
527 const Traits::GlobalIdSet& globalIdSet() const;
528
530 const Traits::LocalIdSet& localIdSet() const;
531
533 const Traits::LevelIndexSet& levelIndexSet(int level) const;
534
536 const Traits::LeafIndexSet& leafIndexSet() const;
537
543 void globalRefine (int refCount, bool throwOnFailure = false);
544
545 const std::vector<Dune::GeometryType>& geomTypes(const int) const;
546
548 template <int codim>
550
569 void addLgrsUpdateLeafView(const std::vector<std::array<int,3>>& cells_per_dim_vec,
570 const std::vector<std::array<int,3>>& startIJK_vec,
571 const std::vector<std::array<int,3>>& endIJK_vec,
572 const std::vector<std::string>& lgr_name_vec,
573 const std::vector<std::string>& lgr_parent_grid_name_vec = std::vector<std::string>{});
574
577 void addLgrsUpdateLeafView(const std::vector<Opm::Refinement::BlockRefinement>& requests);
578
581
583 {
584 return lgr_backend_;
585 }
586
588 bool isDistributed() const
589 {
590 return !distributed_data_.empty();
591 }
592
594 void setRefinementBuilder(std::shared_ptr<Opm::Refinement::Builder> builder);
595
602 void autoRefine(const std::array<int,3>& nxnynz);
603
604 // @brief TO BE DONE
605 const std::map<std::string,int>& getLgrNameToLevel() const;
606
607 // @breif Compute center of an entity/element/cell in the Eclipse way:
608 // - Average of the 4 corners of the bottom face.
609 // - Average of the 4 corners of the top face.
610 // Return average of the previous computations.
611 // @param [in] int Index of a cell.
612 // @return 'eclipse centroid'
613 std::array<double,3> getEclCentroid(const int& idx) const;
614
615 // @breif Compute center of an entity/element/cell in the Eclipse way:
616 // - Average of the 4 corners of the bottom face.
617 // - Average of the 4 corners of the top face.
618 // Return average of the previous computations.
619 // @param [in] Entity<0> Entity
620 // @return 'eclipse centroid'
621 std::array<double,3> getEclCentroid(const cpgrid::Entity<0>& elem) const;
622
633
654 bool mark(int refCount, const cpgrid::Entity<0>& element, bool throwOnFailure = false);
655
659 int getMark(const cpgrid::Entity<0>& element) const;
660
663 bool preAdapt();
664
667 bool adapt();
668
687 bool refineAndUpdateGrid(bool throwOnFailure,
688 const std::vector<std::array<int,3>>& cells_per_dim_vec,
689 const std::vector<int>& assignRefinedLevel,
690 const std::vector<std::string>& lgr_name_vec,
691 const std::vector<std::array<int,3>>& startIJK_vec = std::vector<std::array<int,3>>{},
692 const std::vector<std::array<int,3>>& endIJK_vec = std::vector<std::array<int,3>>{});
693
695 void postAdapt();
697
698 private:
701 std::vector<std::size_t>
702 processDualContinuumEclipseFormat(const Opm::EclipseGrid& ecl_grid,
703 Opm::EclipseState* ecl_state,
704 bool periodic_extension,
705 bool turn_normals,
706 bool clip_z,
707 bool pinchActive,
708 bool edge_conformal);
709
710 void updateCornerHistoryLevels(const std::vector<std::vector<std::array<int,2>>>& cornerInMarkedElemWithEquivRefinedCorner,
711 const std::map<std::array<int,2>,std::array<int,2>>& elemLgrAndElemLgrCorner_to_refinedLevelAndRefinedCorner,
712 const std::unordered_map<int,std::array<int,2>>& adaptedCorner_to_elemLgrAndElemLgrCorner,
713 const int& corner_count,
714 const std::vector<std::array<int,2>>& preAdaptGrid_corner_history,
715 const int& preAdaptMaxLevel,
716 const int& newLevels);
717
718 void globalIdsPartitionTypesLgrAndLeafGrids(const std::vector<int>& assignRefinedLevel,
719 const std::vector<std::array<int,3>>& cells_per_dim_vec,
720 const std::vector<int>& lgr_with_at_least_one_active_cell);
721
728 void getFirstChildGlobalIds([[maybe_unused]] std::vector<int>& parentToFirstChildGlobalIds);
729 public:
736 private:
737
750 void computeGlobalCellLgr(const int& level, const std::array<int,3>& startIJK, std::vector<int>& global_cell_lgr);
751
755 void computeGlobalCellLeafGridViewWithLgrs(std::vector<int>& global_cell_leaf);
756
757 private:
771 void markElemAssignLevelDetectActiveLgrs(const std::vector<std::array<int,3>>& startIJK_vec,
772 const std::vector<std::array<int,3>>& endIJK_vec,
773 std::vector<int>& assignRefinedLevel,
774 std::vector<int>& lgr_with_at_least_one_active_cell);
775
777 void populateCellIndexSetRefinedGrid(int level);
778
780 void populateCellIndexSetLeafGridView();
781
783 void populateLeafGlobalIdSet();
784
785 public:
786
791 std::vector<std::unordered_map<std::size_t, std::size_t>> mapLocalCartesianIndexSetsToLeafIndexSet() const;
792
794 std::vector<std::array<int,2>> mapLeafIndexSetToLocalCartesianIndexSets() const;
795
797 unsigned int overlapSize(int) const;
798
799
801 unsigned int ghostSize(int) const;
802
804 unsigned int overlapSize(int, int) const;
805
807 unsigned int ghostSize(int, int) const;
808
810 unsigned int numBoundarySegments() const;
811
812 void setPartitioningParams(const std::map<std::string,std::string>& params);
813
814 // loadbalance is not part of the grid interface therefore we skip it.
815
825 bool loadBalance(int overlapLayers=1,
826 int partitionMethod = Dune::PartitionMethod::zoltan,
827 double imbalanceTol = 1.1,
828 int level =-1)
829 {
830 using std::get;
831 return get<0>(scatterGrid(/* edgeWeightMethod = */ defaultTransEdgeWgt,
832 /* ownersFirst = */ false,
833 /* wells = */ nullptr,
834 /* possibleFutureConnections = */ {},
835 /* serialPartitioning = */ false,
836 /* transmissibilities = */ nullptr,
837 /* addCornerCells = */ true,
838 overlapLayers,
839 partitionMethod,
840 imbalanceTol,
841 /* allowDistributedWells = */ false,
842 /* input_cell_part = */ {},
843 level));
844 }
845
846 // loadbalance is not part of the grid interface therefore we skip it.
847
858 bool loadBalanceSerial(int overlapLayers=1,
859 int partitionMethod = Dune::PartitionMethod::zoltan,
860 int edgeWeightMethod = Dune::EdgeWeightMethod::defaultTransEdgeWgt,
861 double imbalanceTol = 1.1,
862 int level = -1)
863 {
864 using std::get;
865 return get<0>(scatterGrid(EdgeWeightMethod(edgeWeightMethod),
866 /* ownersFirst = */ false,
867 /* wells = */ nullptr,
868 /* possibleFutureConnections = */ {},
869 /* serialPartitioning = */ true,
870 /* transmissibilities = */ nullptr,
871 /* addCornerCells = */ true,
872 overlapLayers,
873 partitionMethod,
874 imbalanceTol,
875 /* allowDistributedWells = */ false,
876 /* input_cell_part = */ {},
877 level));
878 }
879
880 // loadbalance is not part of the grid interface therefore we skip it.
881
910 std::pair<bool,std::vector<std::pair<std::string,bool>>>
911 loadBalance(const std::vector<cpgrid::OpmWellType> * wells,
912 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
913 const double* transmissibilities = nullptr,
914 int overlapLayers=1, int partitionMethod=Dune::PartitionMethod::zoltanGoG,
915 int level = -1)
916 {
917 return scatterGrid(defaultTransEdgeWgt, /* ownersFirst = */ false, wells, possibleFutureConnections,
918 /* serialPartitioning = */ false, transmissibilities, /* addCornerCells = */ false,
919 overlapLayers, partitionMethod, /* imbalanceTol = */ 1.1, /* allowDistributeWells = */ false,
920 /* input_cell_part = */ {}, level);
921 }
922
923 // loadbalance is not part of the grid interface therefore we skip it.
924
958 std::pair<bool,std::vector<std::pair<std::string,bool>>>
959 loadBalance(EdgeWeightMethod method, const std::vector<cpgrid::OpmWellType> * wells,
960 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
961 const double* transmissibilities = nullptr, bool ownersFirst=false,
962 bool addCornerCells=false, int overlapLayers=1,
963 int partitionMethod = Dune::PartitionMethod::zoltanGoG,
964 double imbalanceTol = 1.1,
965 int level = -1)
966 {
967 return scatterGrid(method, ownersFirst, wells, possibleFutureConnections, /* serialPartitioning = */ false,
968 transmissibilities, addCornerCells, overlapLayers, partitionMethod, imbalanceTol,
969 /* allowDistributeWells = */ false, /* input_cell_part = */ {}, level);
970 }
971
1000 template<class DataHandle>
1001 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1002 loadBalance(DataHandle& data,
1003 const std::vector<cpgrid::OpmWellType> * wells,
1004 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1005 const double* transmissibilities = nullptr,
1006 int overlapLayers=1, int partitionMethod = 1, int level =-1)
1007 {
1008 auto ret = loadBalance(wells, possibleFutureConnections, transmissibilities, overlapLayers, partitionMethod, level);
1009 using std::get;
1010 if (get<0>(ret))
1011 {
1013 }
1014 return ret;
1015 }
1016
1052 template<class DataHandle>
1053 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1054 loadBalance(DataHandle& data, EdgeWeightMethod method,
1055 const std::vector<cpgrid::OpmWellType> * wells,
1056 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1057 bool serialPartitioning,
1058 const double* transmissibilities = nullptr, bool ownersFirst=false,
1059 bool addCornerCells=false, int overlapLayers=1, int partitionMethod = Dune::PartitionMethod::zoltanGoG,
1060 double imbalanceTol = 1.1,
1061 bool allowDistributedWells = false,
1062 bool useTransToFilterOverlap = true)
1063 {
1064 auto ret = scatterGrid(method, ownersFirst, wells, possibleFutureConnections, serialPartitioning, transmissibilities,
1065 addCornerCells, overlapLayers, partitionMethod, imbalanceTol, allowDistributedWells,
1066 /* input_cell_parts = */ std::vector<int>{}, /* level = */ 0,
1067 useTransToFilterOverlap);
1068 using std::get;
1069 if (get<0>(ret))
1070 {
1072 }
1073 return ret;
1074 }
1075
1100 template<class DataHandle>
1101 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1102 loadBalance(DataHandle& data, const std::vector<int>& parts,
1103 const std::vector<cpgrid::OpmWellType> * wells,
1104 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections = {},
1105 bool ownersFirst=false,
1106 bool addCornerCells=false, int overlapLayers=1)
1107 {
1108 using std::get;
1109 auto ret = scatterGrid(defaultTransEdgeWgt, ownersFirst, wells,
1110 possibleFutureConnections,
1111 /* serialPartitioning = */ false,
1112 /* transmissibilities = */ {},
1113 addCornerCells, overlapLayers, /* partitionMethod =*/ Dune::PartitionMethod::simple,
1114 /* imbalanceTol (ignored) = */ 0.0,
1115 /* allowDistributedWells = */ true, parts, /* level = */ 0);
1116 using std::get;
1117 if (get<0>(ret))
1118 {
1120 }
1121 return ret;
1122 }
1123
1131 template<class DataHandle>
1132 bool loadBalance(DataHandle& data,
1133 decltype(data.fixedSize(0,0)) overlapLayers=1, int partitionMethod = Dune::PartitionMethod::zoltan)
1134 {
1135 // decltype usage needed to tell the compiler not to use this function if first
1136 // argument is std::vector but rather loadbalance by parts
1137 bool ret = loadBalance(overlapLayers, partitionMethod);
1138 if (ret)
1139 {
1141 }
1142 return ret;
1143 }
1144
1156 bool loadBalance(const std::vector<int>& parts, bool ownersFirst=false,
1157 bool addCornerCells=false, int overlapLayers=1)
1158 {
1159 using std::get;
1160 return get<0>(scatterGrid(defaultTransEdgeWgt, ownersFirst, /* wells = */ {},
1161 {},
1162 /* serialPartitioning = */ false,
1163 /* trabsmissibilities = */ {},
1164 addCornerCells, overlapLayers, /* partitionMethod =*/ Dune::PartitionMethod::simple,
1165 /* imbalanceTol (ignored) = */ 0.0,
1166 /* allowDistributedWells = */ true, parts));
1167 }
1168
1181 template<class DataHandle>
1182 bool loadBalance(DataHandle& data, const std::vector<int>& parts, bool ownersFirst=false,
1183 bool addCornerCells=false, int overlapLayers=1)
1184 {
1185 bool ret = loadBalance(parts, ownersFirst, addCornerCells, overlapLayers);
1186 if (ret)
1187 {
1189 }
1190 return ret;
1191 }
1192
1206 std::vector<int>
1207 zoltanPartitionWithoutScatter(const std::vector<cpgrid::OpmWellType>* wells,
1208 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1209 const double* transmissibilities,
1210 const int numParts,
1211 const double imbalanceTol) const;
1212
1220 template<class DataHandle>
1221 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir, int /*level*/) const
1222 {
1223 communicate(data, iftype, dir);
1224 }
1225
1233 template<class DataHandle>
1234 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir) const;
1235
1237 const typename CpGridTraits::Communication& comm () const;
1238
1246
1247 // ------------ End of Dune interface, start of simplified interface --------------
1248
1254
1255 // enum { dimension = 3 }; // already defined
1256
1257 typedef Dune::FieldVector<double, 3> Vector;
1258
1259
1260 const std::vector<double>& zcornData() const;
1261
1262
1263 // Topology
1268 int numCells(int level = -1) const;
1269
1274 int numFaces(int level = -1) const;
1275
1277 int numVertices() const;
1278
1279
1288 int numCellFaces(int cell, int level = -1) const;
1289
1296 int cellFace(int cell, int local_index, int level = -1) const;
1297
1301
1321 int faceCell(int face, int local_index, int level = -1) const;
1322
1329 int numCellFaces() const;
1330
1331 int numFaceVertices(int face) const;
1332
1337 int faceVertex(int face, int local_index) const;
1338
1341 double cellCenterDepth(int cell_index) const;
1342
1343
1344 const Vector faceCenterEcl(int cell_index, int face, const Dune::cpgrid::Intersection& intersection) const;
1345
1346 const Vector faceAreaNormalEcl(int face) const;
1348 const Vector faceAreaNormalEcl(int face, int level) const;
1349
1350
1351 // Geometry
1355 const Vector& vertexPosition(int vertex) const;
1356
1359 double faceArea(int face) const;
1360
1363 const Vector& faceCentroid(int face) const;
1364
1368 const Vector& faceNormal(int face) const;
1369
1372 double cellVolume(int cell) const;
1373
1376 const Vector& cellCentroid(int cell) const;
1377
1380 template<int codim>
1382 : public RandomAccessIteratorFacade<CentroidIterator<codim>,
1383 FieldVector<double, 3>,
1384 const FieldVector<double, 3>&, int>
1385 {
1386 public:
1388 typedef typename std::vector<cpgrid::Geometry<3-codim, 3> >::const_iterator
1393 : iter_(iter)
1394 {}
1395
1396 const FieldVector<double,3>& dereference() const
1397 {
1398 return iter_->center();
1399 }
1401 {
1402 ++iter_;
1403 }
1404 const FieldVector<double,3>& elementAt(int n)
1405 {
1406 return iter_[n]->center();
1407 }
1408 void advance(int n){
1409 iter_+=n;
1410 }
1412 {
1413 --iter_;
1414 }
1416 {
1417 return o-iter_;
1418 }
1419 bool equals(const CentroidIterator& o) const{
1420 return o==iter_;
1421 }
1422 private:
1424 GeometryIterator iter_;
1425 };
1426
1429
1432
1433 // Extra
1434 int boundaryId(int face) const;
1435
1442 template<class Cell2FacesRowIterator>
1443 int
1444 faceTag(const Cell2FacesRowIterator& cell_face) const;
1445
1447
1448 // ------------ End of simplified interface --------------
1449
1450 //------------- methods not in the DUNE grid interface.
1451
1456
1457
1466 template<class DataHandle>
1467 void scatterData(DataHandle& handle) const;
1468
1475 template<class DataHandle>
1476 void gatherData(DataHandle& handle) const;
1477
1480
1510
1514
1517
1521
1522#if HAVE_MPI
1527
1530
1535
1537
1539
1541
1543#endif
1544
1546 const std::vector<int>& sortedNumAquiferCells() const;
1547
1548 private:
1580 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1581 scatterGrid(EdgeWeightMethod method,
1582 bool ownersFirst,
1583 const std::vector<cpgrid::OpmWellType> * wells,
1584 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
1585 bool serialPartitioning,
1586 const double* transmissibilities,
1587 bool addCornerCells,
1588 int overlapLayers,
1589 int partitionMethod = Dune::PartitionMethod::zoltanGoG,
1590 double imbalanceTol = 1.1,
1591 bool allowDistributedWells = true,
1592 const std::vector<int>& input_cell_part = {},
1593 int level = -1,
1594 bool useTransToFilterOverlap = true);
1595
1600 std::vector<std::shared_ptr<cpgrid::CpGridData>> data_;
1602 std::vector<std::shared_ptr<cpgrid::CpGridData>> distributed_data_;
1604 std::vector<std::shared_ptr<cpgrid::CpGridData>>* current_data_;
1606 std::map<std::string,int> lgr_names_ = {{"GLOBAL", 0}};
1608 std::shared_ptr<Opm::Refinement::Builder> refinement_builder_;
1614 std::shared_ptr<InterfaceMap> cell_scatter_gather_interfaces_;
1615 /*
1616 * @brief Interface for scattering and gathering point data.
1617 *
1618 * @warning Will only update owner cells
1619 */
1620 std::shared_ptr<InterfaceMap> point_scatter_gather_interfaces_;
1624 std::shared_ptr<cpgrid::GlobalIdSet> global_id_set_ptr_;
1625
1626
1630 std::map<std::string,std::string> partitioningParams;
1631
1632 }; // end Class CpGrid
1633
1634} // end namespace Dune
1635
1639
1640
1641namespace Dune
1642{
1643
1644 namespace Capabilities
1645 {
1647 template <>
1648 struct hasEntity<CpGrid, 0>
1649 {
1650 static const bool v = true;
1651 };
1652
1654 template <>
1655 struct hasEntity<CpGrid, 3>
1656 {
1657 static const bool v = true;
1658 };
1659
1660 template<>
1661 struct canCommunicate<CpGrid,0>
1662 {
1663 static const bool v = true;
1664 };
1665
1666 template<>
1667 struct canCommunicate<CpGrid,3>
1668 {
1669 static const bool v = true;
1670 };
1671
1673 template <>
1674 struct hasBackupRestoreFacilities<CpGrid>
1675 {
1676 static const bool v = false;
1677 };
1678
1679 }
1680
1681 template<class DataHandle>
1682 void CpGrid::communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir) const
1683 {
1684 current_data_->back()->communicate(data, iftype, dir);
1685 }
1686
1687
1688 template<class DataHandle>
1689 void CpGrid::scatterData([[maybe_unused]] DataHandle& handle) const
1690 {
1691#if HAVE_MPI
1692 if (distributed_data_.empty()) {
1693 OPM_THROW(std::runtime_error, "Moving Data only allowed with a load balanced grid!");
1694 } else {
1695 distributed_data_[0]->scatterData(handle, data_[0].get(),
1696 distributed_data_[0].get(),
1699 }
1700#endif
1701 }
1702
1703 template<class DataHandle>
1704 void CpGrid::gatherData([[maybe_unused]] DataHandle& handle) const
1705 {
1706#if HAVE_MPI
1707 if (distributed_data_.empty()) {
1708 OPM_THROW(std::runtime_error, "Moving Data only allowed with a load balance grid!");
1709 } else {
1710 distributed_data_[0]->gatherData(handle, data_[0].get(), distributed_data_[0].get());
1711 }
1712#endif
1713 }
1714
1715
1716 template<class Cell2FacesRowIterator>
1717 int
1718 CpGrid::faceTag(const Cell2FacesRowIterator& cell_face) const
1719 {
1720 // Note that this relies on the following implementation detail:
1721 // The grid is always constructed such that the interior faces constructed
1722 // with orientation set to true are
1723 // oriented along the positive IJK direction. Oriented means that
1724 // the first cell attached to face has the lower index.
1725 // For faces along the boundary (only one cell, always attached at index 0)
1726 // the orientation has to be determined by the orientation of the cell.
1727 // If it is true then in UnstructuredGrid it would be stored at index 0,
1728 // otherwise at index 1.
1729 const int cell = cell_face.getCellIndex();
1730 const int face = *cell_face;
1731 assert (0 <= cell); assert (cell < numCells());
1732 assert (0 <= face); assert (face < numFaces());
1733
1735
1736 const cpgrid::EntityRep<1> f(face, true);
1737 const F2C& f2c = current_data_->back()->face_to_cell_[f];
1738 const face_tag tag = current_data_->back()->face_tag_[f];
1739
1740 assert ((f2c.size() == 1) || (f2c.size() == 2));
1741
1742 int inside_cell = 0;
1743
1744 if ( f2c.size() == 2 ) // Two cells => interior
1745 {
1746 if ( f2c[1].index() == cell )
1747 {
1748 inside_cell = 1;
1749 }
1750 }
1751 const bool normal_is_in = ! f2c[inside_cell].orientation();
1752
1753 switch (tag) {
1754 case I_FACE:
1755 // LEFT : RIGHT
1756 return normal_is_in ? 0 : 1; // min(I) : max(I)
1757 case J_FACE:
1758 // BACK : FRONT
1759 return normal_is_in ? 2 : 3; // min(J) : max(J)
1760 case K_FACE:
1761 // Note: TOP at min(K) as 'z' measures *depth*.
1762 // TOP : BOTTOM
1763 return normal_is_in ? 4 : 5; // min(K) : max(K)
1764 case NNC_FACE:
1765 // For nnc faces we return the otherwise unused value -1.
1766 return -1;
1767 default:
1768 OPM_THROW(std::logic_error, "Unhandled face tag. This should never happen!");
1769 }
1770 }
1771
1772 template<int dim>
1774
1775} // namespace Dune
1776
1779#include "cpgrid/Intersection.hpp"
1780#include "cpgrid/Geometry.hpp"
1781#include "cpgrid/Indexsets.hpp"
1782
1783#endif // OPM_CPGRID_HEADER
DataHandle & data
Definition: CpGridData.hpp:1228
An iterator over the centroids of the geometry of the entities.
Definition: CpGrid.hpp:1385
void increment()
Definition: CpGrid.hpp:1400
CentroidIterator(GeometryIterator iter)
Constructs a new iterator from an iterator over the geometries.
Definition: CpGrid.hpp:1392
const FieldVector< double, 3 > & dereference() const
Definition: CpGrid.hpp:1396
int distanceTo(const CentroidIterator &o)
Definition: CpGrid.hpp:1415
void decrement()
Definition: CpGrid.hpp:1411
void advance(int n)
Definition: CpGrid.hpp:1408
std::vector< cpgrid::Geometry< 3-codim, 3 > >::const_iterator GeometryIterator
The type of the iterator over the codim geometries.
Definition: CpGrid.hpp:1389
bool equals(const CentroidIterator &o) const
Definition: CpGrid.hpp:1419
const FieldVector< double, 3 > & elementAt(int n)
Definition: CpGrid.hpp:1404
[ provides Dune::Grid ]
Definition: CpGrid.hpp:206
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:1102
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
const CpGridTraits::Communication & getLevelZeroComm() const
Get the collective communication object of level zero.
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:221
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:1704
void addLgrsUpdateLeafView(const std::vector< Opm::Refinement::BlockRefinement > &requests)
The same refinement given as block requests. Under the Conforming backend a request may also be grade...
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:1524
void addNnc(const std::vector< std::pair< int, int > > &nnc)
int faceTag(const Cell2FacesRowIterator &cell_face) const
Get the cartesian tag associated with a face tag.
Definition: CpGrid.hpp:1718
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:1054
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:959
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:1479
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:1002
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:858
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:825
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.
std::vector< std::int64_t > stableCellId() const
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'.
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:1526
void setRefinementBuilder(std::shared_ptr< Opm::Refinement::Builder > builder)
The builder the Conforming backend refines with.
void appendDisjointGrid(const CpGrid &other)
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:1132
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:911
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:1257
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:1182
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:1156
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:582
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir, int) const
communicate objects for all codims on a given level
Definition: CpGrid.hpp:1221
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:1529
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.
bool isDistributed() const
True once the grid has been scattered by loadBalance().
Definition: CpGrid.hpp:588
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:1689
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:144
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:497
Only needs to provide interface for doing nothing.
Definition: Iterators.hpp:118
Definition: Indexsets.hpp:57
Definition: Intersection.hpp:282
Definition: Intersection.hpp:63
Definition: Iterators.hpp:60
A class used as a row type for OrientedEntityTable.
Definition: OrientedEntityTable.hpp:60
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:193
CpGridTraits Traits
Definition: CpGrid.hpp:194
Traits associated with a specific grid partition type.
Definition: CpGrid.hpp:147
cpgrid::Iterator< cd, pitype > LevelIterator
The type of the iterator over the level entities of this codim on this partition.
Definition: CpGrid.hpp:149
cpgrid::Iterator< cd, pitype > LeafIterator
The type of the iterator over the leaf entities of this codim on this partition.
Definition: CpGrid.hpp:151
Traits associated with a specific codim.
Definition: CpGrid.hpp:123
cpgrid::Entity< cd > Entity
The type of the entity.
Definition: CpGrid.hpp:132
cpgrid::Geometry< 3-cd, 3 > Geometry
The type of the geometry associated with the entity. IMPORTANT: Codim<codim>::Geometry == Geometry<di...
Definition: CpGrid.hpp:126
cpgrid::Geometry< 3-cd, 3 > LocalGeometry
The type of the local geometry associated with the entity.
Definition: CpGrid.hpp:129
cpgrid::Iterator< cd, All_Partition > LeafIterator
The type of the iterator over all leaf entities of this codim.
Definition: CpGrid.hpp:138
cpgrid::Iterator< cd, All_Partition > LevelIterator
The type of the iterator over all level entities of this codim.
Definition: CpGrid.hpp:135
cpgrid::Entity< cd > EntitySeed
The type of the entity pointer for entities of this codim.
Definition: CpGrid.hpp:141
Traits associated with a specific grid partition type.
Definition: CpGrid.hpp:159
Dune::GridView< DefaultLeafGridViewTraits< CpGrid > > LeafGridView
The type of the leaf grid view associated with this partition type.
Definition: CpGrid.hpp:163
Dune::GridView< DefaultLevelGridViewTraits< CpGrid > > LevelGridView
The type of the level grid view associated with this partition type.
Definition: CpGrid.hpp:161
Definition: CpGrid.hpp:103
cpgrid::IndexSet LevelIndexSet
The type of the level index set.
Definition: CpGrid.hpp:173
cpgrid::IntersectionIterator LeafIntersectionIterator
The type of the intersection iterator at the leafs of the grid.
Definition: CpGrid.hpp:112
Dune::GridView< DefaultLeafGridViewTraits< CpGrid > > LeafGridView
The type of the leaf grid view associated with this partition type.
Definition: CpGrid.hpp:170
Dune::GridView< DefaultLevelGridViewTraits< CpGrid > > LevelGridView
The type of the level grid view associated with this partition type.
Definition: CpGrid.hpp:168
cpgrid::GlobalIdSet GlobalIdSet
The type of the global id set.
Definition: CpGrid.hpp:177
cpgrid::IntersectionIterator LevelIntersectionIterator
The type of the intersection iterator at the levels of the grid.
Definition: CpGrid.hpp:114
cpgrid::IndexSet LeafIndexSet
The type of the leaf index set.
Definition: CpGrid.hpp:175
cpgrid::CpGridDataTraits::CollectiveCommunication CollectiveCommunication
Definition: CpGrid.hpp:183
GlobalIdSet LocalIdSet
The type of the local id set.
Definition: CpGrid.hpp:179
cpgrid::CpGridDataTraits::Communication Communication
The type of the collective communication.
Definition: CpGrid.hpp:182
cpgrid::HierarchicIterator HierarchicIterator
The type of the hierarchic iterator.
Definition: CpGrid.hpp:117
cpgrid::Intersection LevelIntersection
The type of the intersection at the levels of the grid.
Definition: CpGrid.hpp:110
cpgrid::Intersection LeafIntersection
The type of the intersection at the leafs of the grid.
Definition: CpGrid.hpp:108
CpGrid Grid
The type that implements the grid.
Definition: CpGrid.hpp:105
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