My Project
ZoltanPartition.hpp
1 /*
2  Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services.
3  Copyright 2015 Statoil AS
4 
5  This file is part of The Open Porous Media project (OPM).
6 
7  OPM is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  OPM is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with OPM. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #ifndef DUNE_CPGRID_ZOLTANPARTITION_HEADER
21 #define DUNE_CPGRID_ZOLTANPARTITION_HEADER
22 
23 #include <unordered_set>
24 
25 #include <opm/grid/CpGrid.hpp>
26 #include <opm/grid/common/ZoltanGraphFunctions.hpp>
27 #if HAVE_MPI
28 namespace Dune
29 {
30 namespace cpgrid
31 {
60 template<class Id>
61 std::tuple<std::vector<int>, std::vector<std::pair<std::string,bool>>,
62  std::vector<std::tuple<int,int,char> >,
63  std::vector<std::tuple<int,int,char,int> > >
64 makeImportAndExportLists(const Dune::CpGrid& cpgrid,
65  const Dune::CollectiveCommunication<MPI_Comm>& cc,
66  const std::vector<Dune::cpgrid::OpmWellType> * wells,
67  const Dune::cpgrid::CombinedGridWellGraph* gridAndWells,
68  int root,
69  int numExport,
70  int numImport,
71  const Id* exportLocalGids,
72  const Id* exportGlobalGids,
73  const int* exportToPart,
74  const Id* importGlobalGids,
75  bool allowDistributedWells = false);
76 
77 template<class Id>
78 std::tuple<int, std::vector<Id> >
79 scatterExportInformation(int numExport, const Id* exportGlobalGids,
80  const int* exportToPart, int root,
81  const Dune::CollectiveCommunication<MPI_Comm>& cc);
82 } // end namespace cpgrid
83 } // end namespace Dune
84 #endif //HAVE_MPI
85 #if defined(HAVE_ZOLTAN) && defined(HAVE_MPI)
86 namespace Dune
87 {
88 namespace cpgrid
89 {
117 std::tuple<std::vector<int>,std::vector<std::pair<std::string,bool>>,
118  std::vector<std::tuple<int,int,char> >,
119  std::vector<std::tuple<int,int,char,int> > >
120 zoltanGraphPartitionGridOnRoot(const CpGrid& grid,
121  const std::vector<OpmWellType> * wells,
122  const double* transmissibilities,
123  const CollectiveCommunication<MPI_Comm>& cc,
124  EdgeWeightMethod edgeWeightsMethod, int root,
125  const double zoltanImbalanceTol,
126  bool allowDistributedWells);
127 
156 std::tuple<std::vector<int>, std::vector<std::pair<std::string,bool>>,
157  std::vector<std::tuple<int,int,char> >,
158  std::vector<std::tuple<int,int,char,int> > >
159 zoltanSerialGraphPartitionGridOnRoot(const CpGrid& grid,
160  const std::vector<OpmWellType> * wells,
161  const double* transmissibilities,
162  const CollectiveCommunication<MPI_Comm>& cc,
163  EdgeWeightMethod edgeWeightsMethod, int root,
164  const double zoltanImbalanceTol,
165  bool allowDistributedWells);
166 }
167 }
168 #endif // HAVE_ZOLTAN
169 #endif // header guard
[ provides Dune::Grid ]
Definition: CpGrid.hpp:207
A graph repesenting a grid together with the well completions.
Definition: ZoltanGraphFunctions.hpp:131
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10
EdgeWeightMethod
enum for choosing Methods for weighting graph-edges correspoding to cell interfaces in Zoltan's graph...
Definition: GridEnums.hpp:34