Loading...
Searching...
No Matches
ZoltanPartition.hpp
/*
Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services.
Copyright 2015 Statoil AS
This file is part of The Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DUNE_CPGRID_ZOLTANPARTITION_HEADER
#define DUNE_CPGRID_ZOLTANPARTITION_HEADER
#include <unordered_set>
#include <opm/grid/CpGrid.hpp>
#include <opm/grid/common/ZoltanGraphFunctions.hpp>
#include <opm/grid/common/WellConnections.hpp>
#if HAVE_MPI
namespace Dune
{
namespace cpgrid
{
template<class Id>
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);
template<class Id>
std::tuple<int, std::vector<Id> >
scatterExportInformation(int numExport, const Id* exportGlobalGids,
const int* exportToPart, int root,
const Dune::Communication<MPI_Comm>& cc);
} // end namespace cpgrid
} // end namespace Dune
#endif //HAVE_MPI
#if defined(HAVE_ZOLTAN) && defined(HAVE_MPI)
namespace Dune
{
namespace cpgrid
{
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>
zoltanGraphPartitionGridOnRoot(const CpGrid& grid,
const std::vector<OpmWellType> * wells,
const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
const double* transmissibilities,
const Communication<MPI_Comm>& cc,
EdgeWeightMethod edgeWeightsMethod, int root,
const double zoltanImbalanceTol,
bool allowDistributedWells,
const std::map<std::string,std::string>& params);
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>
zoltanSerialGraphPartitionGridOnRoot(const CpGrid& grid,
const std::vector<OpmWellType> * wells,
const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
const double* transmissibilities,
const Communication<MPI_Comm>& cc,
EdgeWeightMethod edgeWeightsMethod, int root,
const double zoltanImbalanceTol,
bool allowDistributedWells,
const std::map<std::string,std::string>& params);
std::vector<int>
zoltanGraphPartitionGridForJac(const CpGrid& cpgrid,
const std::vector<OpmWellType> * wells,
const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
const double* transmissibilities,
const Communication<MPI_Comm>& cc,
EdgeWeightMethod edgeWeightsMethod, int root,
int numParts, const double zoltanImbalanceTol);
}
}
#endif // HAVE_ZOLTAN
#endif // header guard
Dune::cpgrid::WellConnections
A class calculating and representing all connections of wells.
Definition WellConnections.hpp:51
Dune::cpgrid
Copyright 2019 Equinor AS.
Definition GridPartitioning.cpp:673
Dune
The namespace Dune is the main namespace for all Dune code.
Definition CartesianIndexMapper.hpp:10
Dune::EdgeWeightMethod
EdgeWeightMethod
enum for choosing Methods for weighting graph-edges correspoding to cell interfaces in Zoltan's or Me...
Definition GridEnums.hpp:34