kahipDecomp.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::kahipDecomp
28
29Description
30 Domain decomposition using KaHIP
31 http://algo2.iti.kit.edu/documents/kahip/
32
33 When run in parallel will collect the entire graph on to the master,
34 decompose and send back.
35
36 Coefficients dictionary: \a kahipCoeffs, \a coeffs.
37
38 \verbatim
39 numberOfSubdomains N;
40 method kahip;
41
42 kahipCoeffs
43 {
44 config fast;
45 imbalance 0.01;
46 }
47 \endverbatim
48
49 Method coefficients:
50 \table
51 Property | Description | Required | Default
52 config | fast / eco / strong | no | fast
53 imbalance | imbalance on cells between domains | no | 0.01
54 seed | initial value for random number generator | no | 0
55 \endtable
56
57SourceFiles
58 kahipDecomp.C
59
60\*---------------------------------------------------------------------------*/
61
62#ifndef kahipDecomp_H
63#define kahipDecomp_H
64
65#include "metisLikeDecomp.H"
66#include "Enum.H"
67
68namespace Foam
69{
70
71/*---------------------------------------------------------------------------*\
72 Class kahipDecomp Declaration
73\*---------------------------------------------------------------------------*/
74
75class kahipDecomp
76:
77 public metisLikeDecomp
78{
79protected:
80
81 // Protected Member Functions
82
83 //- Call kahip with options from dictionary.
84 virtual label decomposeSerial
85 (
86 const labelList& adjncy,
87 const labelList& xadj,
88 const List<scalar>& cellWeights,
89 labelList& decomp
90 ) const;
91
92
93 //- No copy construct
94 kahipDecomp(const kahipDecomp&) = delete;
95
96 //- No copy assignment
97 void operator=(const kahipDecomp&) = delete;
98
99
100public:
101
102 //- The predefined KaHIP configuration types
103 enum class configs
104 {
105 FAST = 0,
106 ECO = 1,
107 STRONG = 2,
108 FASTSOCIAL = 3,
109 ECOSOCIAL = 4,
110 STRONGSOCIAL = 5,
111 };
112
114 //- The selection names for predefined KaHIP configurations
115 static const Enum<configs> configNames;
117
118 //- Runtime type information
119 TypeName("kahip");
120
121
122 // Constructors
123
124 //- Construct given decomposition dictionary and optional region name
125 explicit kahipDecomp
126 (
127 const dictionary& decompDict,
128 const word& regionName = ""
129 );
130
131
132 //- Destructor
133 virtual ~kahipDecomp() = default;
135
136 // Member Functions
137
138 virtual bool parallelAware() const
139 {
140 return true;
141 }
142};
143
144
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147} // End namespace Foam
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151#endif
153// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Domain decomposition using KaHIP http://algo2.iti.kit.edu/documents/kahip/.
Definition: kahipDecomp.H:97
TypeName("kahip")
Runtime type information.
kahipDecomp(const kahipDecomp &)=delete
No copy construct.
virtual label decomposeSerial(const labelList &adjncy, const labelList &xadj, const List< scalar > &cellWeights, labelList &decomp) const
Call kahip with options from dictionary.
configs
The predefined KaHIP configuration types.
Definition: kahipDecomp.H:123
virtual bool parallelAware() const
Is method parallel aware?
Definition: kahipDecomp.H:157
virtual ~kahipDecomp()=default
Destructor.
static const Enum< configs > configNames
The selection names for predefined KaHIP configurations.
Definition: kahipDecomp.H:134
void operator=(const kahipDecomp &)=delete
No copy assignment.
Domain decomposition using METIS-like data structures.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Foam::word regionName(Foam::polyMesh::defaultRegion)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73