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{
67template<class Id>
68std::tuple<std::vector<int>, std::vector<std::pair<std::string,bool>>,
69 std::vector<std::tuple<int,int,char> >,
70 std::vector<std::tuple<int,int,char,int> >,
71 WellConnections>
73 const Dune::Communication<MPI_Comm>& cc,
74 const std::vector<Dune::cpgrid::OpmWellType> * wells,
75 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
76 const Dune::cpgrid::CombinedGridWellGraph* gridAndWells,
77 int root,
78 int numExport,
79 int numImport,
80 const Id* exportLocalGids,
81 const Id* exportGlobalGids,
82 const int* exportToPart,
83 const Id* importGlobalGids,
84 bool allowDistributedWells = false);
85
86template<class Id>
87std::tuple<int, std::vector<Id> >
88scatterExportInformation(int numExport, const Id* exportGlobalGids,
89 const int* exportToPart, int root,
90 const Dune::Communication<MPI_Comm>& cc);
91} // end namespace cpgrid
92} // end namespace Dune
93#endif //HAVE_MPI
94#if defined(HAVE_ZOLTAN) && defined(HAVE_MPI)
95namespace Dune
96{
97namespace cpgrid
98{
131
132std::tuple<std::vector<int>,std::vector<std::pair<std::string,bool>>,
133 std::vector<std::tuple<int,int,char> >,
134 std::vector<std::tuple<int,int,char,int> >,
135 WellConnections>
136zoltanGraphPartitionGridOnRoot(const CpGrid& grid,
137 const std::vector<OpmWellType> * wells,
138 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
139 const double* transmissibilities,
140 const Communication<MPI_Comm>& cc,
141 EdgeWeightMethod edgeWeightsMethod, int root,
142 const double zoltanImbalanceTol,
143 bool allowDistributedWells,
144 const std::map<std::string,std::string>& params);
145
179std::tuple<std::vector<int>, std::vector<std::pair<std::string,bool>>,
180 std::vector<std::tuple<int,int,char> >,
181 std::vector<std::tuple<int,int,char,int> >,
182 WellConnections>
183zoltanSerialGraphPartitionGridOnRoot(const CpGrid& grid,
184 const std::vector<OpmWellType> * wells,
185 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
186 const double* transmissibilities,
187 const Communication<MPI_Comm>& cc,
188 EdgeWeightMethod edgeWeightsMethod, int root,
189 const double zoltanImbalanceTol,
190 bool allowDistributedWells,
191 const std::map<std::string,std::string>& params);
192
215std::vector<int>
216zoltanGraphPartitionGridForJac(const CpGrid& cpgrid,
217 const std::vector<OpmWellType> * wells,
218 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
219 const double* transmissibilities,
220 const Communication<MPI_Comm>& cc,
221 EdgeWeightMethod edgeWeightsMethod, int root,
222 int numParts, const double zoltanImbalanceTol);
223
224}
225}
226
227
228#endif // HAVE_ZOLTAN
229#endif // header guard
[ provides Dune::Grid ]
Definition: CpGrid.hpp:198
A graph repesenting a grid together with the well completions.
Definition: ZoltanGraphFunctions.hpp:138
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 std::unordered_map< std::string, std::set< int > > &possibleFutureConnections, 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 or Me...
Definition: GridEnums.hpp:34