opm-simulators
Toggle main menu visibility
Loading...
Searching...
No Matches
ParallelNLDDPartitioningZoltan.hpp
1
/*
2
Copyright 2023 Equinor ASA
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_UTILITY_PARALLEL_NLDD_PARTITIONING_ZOLTAN_HPP
21
#define OPM_UTILITY_PARALLEL_NLDD_PARTITIONING_ZOLTAN_HPP
22
23
#include <opm/simulators/utils/ParallelCommunication.hpp>
24
25
#include <cstddef>
26
#include <functional>
27
#include <map>
28
#include <string>
29
#include <utility>
30
#include <vector>
31
32
namespace
Opm
{
33
37
class
ParallelNLDDPartitioningZoltan
38
{
39
public
:
42
using
GlobalCellID
= std::function<int(
int
)>;
43
45
using
ZoltanParamMap
= std::map<std::string, std::string>;
46
57
explicit
ParallelNLDDPartitioningZoltan
(
const
Parallel::Communication comm,
58
const
std::size_t numElements,
59
const
GlobalCellID
& globalCell)
60
: comm_ { comm }
61
, numElements_ { numElements }
62
, globalCell_ { globalCell }
63
{}
64
69
void
registerConnection
(std::size_t c1, std::size_t c2)
70
{
71
this->conns_.emplace_back(c1, c2);
72
}
73
86
std::vector<int>
87
partitionElements
(
const
ZoltanParamMap
& params)
const
;
88
93
void
addVertexGroup
(
const
std::vector<int>& vertices);
94
95
private
:
97
using
Connection = std::pair<std::size_t, std::size_t>;
98
std::vector<std::vector<int>> vertexGroups_{};
99
101
Parallel::Communication comm_{};
102
105
std::size_t numElements_{};
106
109
GlobalCellID
globalCell_{};
110
112
std::vector<Connection> conns_{};
113
};
114
115
}
// namespace Opm
116
117
#endif
// OPM_UTILITY_PARALLEL_NLDD_PARTITIONING_ZOLTAN_HPP
Opm::ParallelNLDDPartitioningZoltan::registerConnection
void registerConnection(std::size_t c1, std::size_t c2)
Insert directed graph edge between two vertices.
Definition
ParallelNLDDPartitioningZoltan.hpp:69
Opm::ParallelNLDDPartitioningZoltan::addVertexGroup
void addVertexGroup(const std::vector< int > &vertices)
Add a group of vertices that should be merged together.
Definition
ParallelNLDDPartitioningZoltan.cpp:562
Opm::ParallelNLDDPartitioningZoltan::partitionElements
std::vector< int > partitionElements(const ZoltanParamMap ¶ms) const
Partition connectivity graph using Zoltan graph partitioning package.
Definition
ParallelNLDDPartitioningZoltan.cpp:568
Opm::ParallelNLDDPartitioningZoltan::GlobalCellID
std::function< int(int)> GlobalCellID
Callback type for mapping a vertex/cell ID to a globally unique ID.
Definition
ParallelNLDDPartitioningZoltan.hpp:42
Opm::ParallelNLDDPartitioningZoltan::ParallelNLDDPartitioningZoltan
ParallelNLDDPartitioningZoltan(const Parallel::Communication comm, const std::size_t numElements, const GlobalCellID &globalCell)
Constructor.
Definition
ParallelNLDDPartitioningZoltan.hpp:57
Opm::ParallelNLDDPartitioningZoltan::ZoltanParamMap
std::map< std::string, std::string > ZoltanParamMap
Collection of parameters to control the partitioning procedure.
Definition
ParallelNLDDPartitioningZoltan.hpp:45
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition
blackoilbioeffectsmodules.hh:43
opm
simulators
utils
ParallelNLDDPartitioningZoltan.hpp
Generated by
1.17.0