ZoltanPartition.hpp
Go to the documentation of this file.
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>
28
29#if HAVE_MPI
30namespace Dune
31{
32namespace cpgrid
33{
64template<class Id>
65std::tuple<std::vector<int>, std::vector<std::pair<std::string,bool>>,
66 std::vector<std::tuple<int,int,char> >,
67 std::vector<std::tuple<int,int,char,int> >,
68 WellConnections>
70 const Dune::Communication<MPI_Comm>& cc,
71 const std::vector<Dune::cpgrid::OpmWellType> * wells,
72 const Dune::cpgrid::CombinedGridWellGraph* gridAndWells,
73 int root,
74 int numExport,
75 int numImport,
76 const Id* exportLocalGids,
77 const Id* exportGlobalGids,
78 const int* exportToPart,
79 const Id* importGlobalGids,
80 bool allowDistributedWells = false);
81
82template<class Id>
83std::tuple<int, std::vector<Id> >
84scatterExportInformation(int numExport, const Id* exportGlobalGids,
85 const int* exportToPart, int root,
86 const Dune::Communication<MPI_Comm>& cc);
87} // end namespace cpgrid
88} // end namespace Dune
89#endif //HAVE_MPI
90#if defined(HAVE_ZOLTAN) && defined(HAVE_MPI)
91namespace Dune
92{
93namespace cpgrid
94{
124
125std::tuple<std::vector<int>,std::vector<std::pair<std::string,bool>>,
126 std::vector<std::tuple<int,int,char> >,
127 std::vector<std::tuple<int,int,char,int> >,
128 WellConnections>
129zoltanGraphPartitionGridOnRoot(const CpGrid& grid,
130 const std::vector<OpmWellType> * wells,
131 const double* transmissibilities,
132 const Communication<MPI_Comm>& cc,
133 EdgeWeightMethod edgeWeightsMethod, int root,
134 const double zoltanImbalanceTol,
135 bool allowDistributedWells,
136 const std::map<std::string,std::string>& params);
137
168std::tuple<std::vector<int>, std::vector<std::pair<std::string,bool>>,
169 std::vector<std::tuple<int,int,char> >,
170 std::vector<std::tuple<int,int,char,int> >,
171 WellConnections>
172zoltanSerialGraphPartitionGridOnRoot(const CpGrid& grid,
173 const std::vector<OpmWellType> * wells,
174 const double* transmissibilities,
175 const Communication<MPI_Comm>& cc,
176 EdgeWeightMethod edgeWeightsMethod, int root,
177 const double zoltanImbalanceTol,
178 bool allowDistributedWells,
179 const std::map<std::string,std::string>& params);
180
200std::vector<int>
201zoltanGraphPartitionGridForJac(const CpGrid& cpgrid,
202 const std::vector<OpmWellType> * wells,
203 const double* transmissibilities,
204 const Communication<MPI_Comm>& cc,
205 EdgeWeightMethod edgeWeightsMethod, int root,
206 int numParts, const double zoltanImbalanceTol);
207
208}
209}
210
211
212#endif // HAVE_ZOLTAN
213#endif // header guard
[ provides Dune::Grid ]
Definition: CpGrid.hpp:238
A graph repesenting a grid together with the well completions.
Definition: ZoltanGraphFunctions.hpp:131
std::tuple< int, std::vector< Id > > scatterExportInformation(int numExport, const Id *exportGlobalGids, const int *exportToPart, int root, const Dune::Communication< MPI_Comm > &cc)
std::tuple< std::vector< int >, std::vector< std::pair< std::string, bool > >, std::vector< std::tuple< int, int, char > >, std::vector< std::tuple< int, int, char, int > >, WellConnections > makeImportAndExportLists(const Dune::CpGrid &cpgrid, const Dune::Communication< MPI_Comm > &cc, const std::vector< Dune::cpgrid::OpmWellType > *wells, const Dune::cpgrid::CombinedGridWellGraph *gridAndWells, int root, int numExport, int numImport, const Id *exportLocalGids, const Id *exportGlobalGids, const int *exportToPart, const Id *importGlobalGids, bool allowDistributedWells=false)
Creates all the information needed from the partitioning.
The namespace Dune is the main namespace for all Dune code.
Definition: common/CartesianIndexMapper.hpp:10
EdgeWeightMethod
enum for choosing Methods for weighting graph-edges correspoding to cell interfaces in Zoltan's graph...
Definition: GridEnums.hpp:34