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 <set>
25#include <string>
26#include <utility>
27#include <vector>
28
29namespace Opm {
30
31class Well;
32
33} // namespace Opm
34
35namespace Opm {
36
40template <typename Element>
42{
45 double domain_imbalance{1.03};
46
49 std::function<int(const Element&)> index;
50
58 std::function<int(int)> local_to_global;
59};
60
93template <class GridView, class Element>
94std::pair<std::vector<int>, int>
95partitionCells(const std::string& method,
96 const int num_local_domains,
97 const GridView& grid_view,
98 const std::vector<Well>& wells,
99 const std::unordered_map<std::string, std::set<int>>& possibleFutureConnections,
101 const int num_neighbor_levels);
102
105std::pair<std::vector<int>, int> partitionCellsFromFile(const std::string& filename, const int num_cells);
106
109std::pair<std::vector<int>, int> partitionCellsSimple(const int num_cells, const int num_domains);
110
111} // namespace Opm
112
113#endif // OPM_ASPINPARTITION_HEADER_INCLUDED
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
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:666
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:710
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
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:737
Control parameters for on-rank subdomain partitioning using Zoltan library.
Definition partitionCells.hpp:42
double domain_imbalance
Partition imbalance, percentage units.
Definition partitionCells.hpp:45
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
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