metis.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::decompositionMethods::metis
26 
27 Description
28  Metis domain decomposition
29 
30 SourceFiles
31  metis.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef metis_H
36 #define metis_H
37 
38 #include "decompositionMethod.H"
39 
40 namespace Foam
41 {
42 namespace decompositionMethods
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class metis Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class metis
50 :
51  public decompositionMethod
52 {
53  dictionary methodDict_;
54 
55  // Private Member Functions
56 
57  //- Call Metis with options from dictionary.
59  (
60  const labelList& adjncy,
61  const labelList& xadj,
62  const scalarField& cellWeights,
63  labelList& finalDecomp
64  );
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("metis");
71 
72 
73  // Constructors
74 
75  //- Construct given the decomposition dictionary
76  metis
77  (
78  const dictionary& decompositionDict,
79  const dictionary& methodDict
80  );
81 
82  //- Disallow default bitwise copy construction
83  metis(const metis&) = delete;
84 
85 
86  //- Destructor
87  virtual ~metis()
88  {}
89 
90 
91  // Member Functions
92 
93  //- Inherit decompose from decompositionMethod
95 
96  //- Return for every coordinate the wanted processor number. Use the
97  // mesh connectivity (if needed)
98  // Weights get normalised so the minimum value is 1 before truncation
99  // to an integer so the weights should be multiples of the minimum
100  // value. The overall sum of weights might otherwise overflow.
101  virtual labelList decompose
102  (
103  const polyMesh& mesh,
104  const pointField& points,
105  const scalarField& pointWeights
106  );
107 
108  //- Return for every coordinate the wanted processor number. Gets
109  // passed agglomeration map (from fine to coarse cells) and coarse cell
110  // location. Can be overridden by decomposers that provide this
111  // functionality natively.
112  // See note on weights above.
113  virtual labelList decompose
114  (
115  const polyMesh& mesh,
116  const labelList& cellToRegion,
117  const pointField& regionPoints,
118  const scalarField& regionWeights
119  );
120 
121  //- Return for every coordinate the wanted processor number. Explicitly
122  // provided mesh connectivity.
123  // The connectivity is equal to mesh.cellCells() except for
124  // - in parallel the cell numbers are global cell numbers (starting
125  // from 0 at processor0 and then incrementing all through the
126  // processors)
127  // - the connections are across coupled patches
128  // See note on weights above.
129  virtual labelList decompose
130  (
131  const labelListList& globalCellCells,
132  const pointField& cellCentres,
133  const scalarField& cellWeights
134  );
135 
136 
137  // Member Operators
138 
139  //- Disallow default bitwise assignment
140  void operator=(const metis&) = delete;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace decompositionMethods
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
Abstract base class for decomposition.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Return for every coordinate the wanted processor number.
Metis domain decomposition.
Definition: metis.H:51
TypeName("metis")
Runtime type information.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Inherit decompose from decompositionMethod.
metis(const dictionary &decompositionDict, const dictionary &methodDict)
Construct given the decomposition dictionary.
Definition: dummyMetis.C:73
void operator=(const metis &)=delete
Disallow default bitwise assignment.
virtual ~metis()
Destructor.
Definition: metis.H:86
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
const pointField & points
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59