Loading...
Searching...
No Matches
partitionCells.hpp
/*
Copyright 2021 Total SE
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 OPM_ASPINPARTITION_HEADER_INCLUDED
#define OPM_ASPINPARTITION_HEADER_INCLUDED
#include <functional>
#include <set>
#include <string>
#include <utility>
#include <vector>
namespace Opm {
class Well;
} // namespace Opm
namespace Opm {
template <typename Element>
struct ZoltanPartitioningControl
{
double domain_imbalance{1.03};
std::function<int(const Element&)> index;
std::function<int(int)> local_to_global;
};
template <class GridView, class Element>
std::pair<std::vector<int>, int>
partitionCells(const std::string& method,
const int num_local_domains,
const GridView& grid_view,
const std::vector<Well>& wells,
const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
const ZoltanPartitioningControl<Element>& zoltan_ctrl,
const int num_neighbor_levels);
std::pair<std::vector<int>, int> partitionCellsFromFile(const std::string& filename, const int num_cells);
std::pair<std::vector<int>, int> partitionCellsSimple(const int num_cells, const int num_domains);
} // namespace Opm
#endif // OPM_ASPINPARTITION_HEADER_INCLUDED
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Opm::partitionCells
std::pair< std::vector< int >, int > partitionCells(const std::string &method, const int num_local_domains, const GridView &grid_view, const std::vector< Well > &wells, const std::unordered_map< std::string, std::set< int > > &possibleFutureConnections, const ZoltanPartitioningControl< Element > &zoltan_ctrl, const int num_neighbor_levels)
Partition rank's interior cells.
Definition partitionCells.cpp:664
Opm::partitionCellsFromFile
std::pair< std::vector< int >, int > partitionCellsFromFile(const std::string &filename, const int num_cells)
Read a partitioning from file, assumed to contain one number per cell, its partition number.
Definition partitionCells.cpp:708
Opm::partitionCellsSimple
std::pair< std::vector< int >, int > partitionCellsSimple(const int num_cells, const int num_domains)
Trivially simple partitioner assigning partitions en bloc, consecutively by cell index.
Definition partitionCells.cpp:735
Opm::ZoltanPartitioningControl
Control parameters for on-rank subdomain partitioning using Zoltan library.
Definition partitionCells.hpp:42
Opm::ZoltanPartitioningControl::domain_imbalance
double domain_imbalance
Partition imbalance, percentage units.
Definition partitionCells.hpp:45
Opm::ZoltanPartitioningControl::local_to_global
std::function< int(int)> local_to_global
Compute a globally unique, across all MPI processes, ID for a local cell/element/entity.
Definition partitionCells.hpp:58
Opm::ZoltanPartitioningControl::index
std::function< int(const Element &)> index
Compute a locally unique, for this MPI process, ID of a local cell/element/entity.
Definition partitionCells.hpp:49