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-2019 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 metisDecomp_H
64 #define 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  //- No copy construct
94  metisDecomp(const metisDecomp&) = delete;
95 
96  //- No copy assignment
97  void operator=(const metisDecomp&) = delete;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("metis");
104 
105 
106  // Constructors
107 
108  //- Construct given the decomposition dictionary
109  metisDecomp(const dictionary& decompDict);
110 
111  //- Construct given the decomposition dictionary and region name
113  (
114  const dictionary& decompDict,
115  const word& regionName
116  );
117 
118 
119  //- Destructor
120  virtual ~metisDecomp() = default;
121 
122 
123  // Member Functions
124 
125  virtual bool parallelAware() const
126  {
127  return true;
128  }
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::metisDecomp::~metisDecomp
virtual ~metisDecomp()=default
Destructor.
Foam::metisDecomp::operator=
void operator=(const metisDecomp &)=delete
No copy assignment.
Foam::metisDecomp::parallelAware
virtual bool parallelAware() const
Is method parallel aware?
Definition: metisDecomp.H:142
Foam::metisDecomp::decomposeSerial
virtual label decomposeSerial(const labelList &adjncy, const labelList &xadj, const List< scalar > &cellWeights, labelList &decomp) const
Decompose non-parallel.
Definition: dummyMetisDecomp.C:59
Foam::metisDecomp::TypeName
TypeName("metis")
Runtime type information.
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
Foam::metisLikeDecomp
Domain decomposition using METIS-like data structures.
Definition: metisLikeDecomp.H:51
Foam::metisDecomp::metisDecomp
metisDecomp(const metisDecomp &)=delete
No copy construct.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::metisDecomp
Metis domain decomposition.
Definition: metisDecomp.H:92
metisLikeDecomp.H
Foam::List< label >