My Project
Loading...
Searching...
No Matches
partitionCells.hpp
1/*
2 Copyright 2021 Total SE
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_ASPINPARTITION_HEADER_INCLUDED
21#define OPM_ASPINPARTITION_HEADER_INCLUDED
22
23#include <functional>
24#include <string>
25#include <utility>
26#include <vector>
27
28namespace Opm {
29
30class Well;
31
32} // namespace Opm
33
34namespace Opm {
35
39template <typename Element>
41{
44 double domain_imbalance{1.03};
45
48 std::function<int(const Element&)> index;
49
57 std::function<int(int)> local_to_global;
58};
59
89template <class GridView, class Element>
90std::pair<std::vector<int>, int>
91partitionCells(const std::string& method,
92 const int num_local_domains,
93 const GridView& grid_view,
94 const std::vector<Well>& wells,
95 const ZoltanPartitioningControl<Element>& zoltan_ctrl);
96
99std::pair<std::vector<int>, int> partitionCellsFromFile(const std::string& filename, const int num_cells);
100
103std::pair<std::vector<int>, int> partitionCellsSimple(const int num_cells, const int num_domains);
104
105} // namespace Opm
106
107#endif // OPM_ASPINPARTITION_HEADER_INCLUDED
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27
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:616
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:643
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 ZoltanPartitioningControl< Element > &zoltan_ctrl)
Partition rank's interior cells.
Definition partitionCells.cpp:574
Control parameters for on-rank subdomain partitioning using Zoltan library.
Definition partitionCells.hpp:41
double domain_imbalance
Partition imbalance, percentage units.
Definition partitionCells.hpp:44
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:57
std::function< int(const Element &)> index
Compute a locally unique, for this MPI process, ID of a local cell/element/entity.
Definition partitionCells.hpp:48