metisDecomp.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) 2011-2015 OpenFOAM Foundation
9  Copyright (C) 2017-2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::metisDecomp
29 
30 Description
31  Metis domain decomposition
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 metisCoeffs, \a coeffs.
37 
38  \verbatim
39  numberOfSubdomains N;
40  method metis;
41 
42  metisCoeffs
43  {
44  method recursive; // k-way
45  options ( ...);
46  processorWeights ( ... );
47  }
48  \endverbatim
49 
50  Method coefficients:
51  \table
52  Property | Description | Required | Default
53  method | recursive / k-way | no | recursive
54  options | metis options | no
55  processorWeights | list of weighting per partition | no
56  \endtable
57 
58 SourceFiles
59  metisDecomp.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef Foam_metisDecomp_H
64 #define Foam_metisDecomp_H
65 
66 #include "metisLikeDecomp.H"
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class metisDecomp Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class metisDecomp
76 :
77  public metisLikeDecomp
78 {
79 protected:
80 
81  // Protected Member Functions
82 
83  //- Decompose non-parallel
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 public:
94 
95  // Generated Methods
96 
97  //- No copy construct
98  metisDecomp(const metisDecomp&) = delete;
99 
100  //- No copy assignment
101  void operator=(const metisDecomp&) = delete;
102 
103 
104  //- Runtime type information
105  TypeName("metis");
106 
107 
108  // Constructors
109 
110  //- Construct with number of domains (no coefficients or constraints)
111  explicit metisDecomp(const label numDomains);
112 
113  //- Construct given decomposition dictionary and optional region name
114  explicit metisDecomp
115  (
116  const dictionary& decompDict,
117  const word& regionName = ""
118  );
119 
120 
121  //- Destructor
122  virtual ~metisDecomp() = default;
123 
124 
125  // Member Functions
126 
127  //- Knows about coupled boundaries
128  virtual bool parallelAware() const
129  {
130  return true;
131  }
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
metisDecomp(const metisDecomp &)=delete
No copy construct.
virtual ~metisDecomp()=default
Destructor.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Metis domain decomposition.
Definition: metisDecomp.H:88
void operator=(const metisDecomp &)=delete
No copy assignment.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
virtual bool parallelAware() const
Knows about coupled boundaries.
Definition: metisDecomp.H:157
TypeName("metis")
Runtime type information.
List< label > labelList
A List of labels.
Definition: List.H:62
virtual label decomposeSerial(const labelList &adjncy, const labelList &xadj, const List< scalar > &cellWeights, labelList &decomp) const
Decompose non-parallel.
Definition: metisDecomp.C:67
Namespace for OpenFOAM.