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  // Private Member Functions
54 
55  //- Call Metis with options from dictionary.
57  (
58  const labelList& adjncy,
59  const labelList& xadj,
60  const scalarField& cellWeights,
61  labelList& finalDecomp
62  );
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("metis");
69 
70 
71  // Constructors
72 
73  //- Construct given the decomposition dictionary
74  metis(const dictionary&);
75 
76  //- Disallow default bitwise copy construction
77  metis(const metis&) = delete;
78 
79 
80  //- Destructor
81  virtual ~metis()
82  {}
83 
84 
85  // Member Functions
86 
87  //- Inherit decompose from decompositionMethod
89 
90  //- Return for every coordinate the wanted processor number. Use the
91  // mesh connectivity (if needed)
92  // Weights get normalised so the minimum value is 1 before truncation
93  // to an integer so the weights should be multiples of the minimum
94  // value. The overall sum of weights might otherwise overflow.
95  virtual labelList decompose
96  (
97  const polyMesh& mesh,
98  const pointField& points,
99  const scalarField& pointWeights
100  );
101 
102  //- Return for every coordinate the wanted processor number. Gets
103  // passed agglomeration map (from fine to coarse cells) and coarse cell
104  // location. Can be overridden by decomposers that provide this
105  // functionality natively.
106  // See note on weights above.
107  virtual labelList decompose
108  (
109  const polyMesh& mesh,
110  const labelList& cellToRegion,
111  const pointField& regionPoints,
112  const scalarField& regionWeights
113  );
114 
115  //- Return for every coordinate the wanted processor number. Explicitly
116  // provided mesh connectivity.
117  // The connectivity is equal to mesh.cellCells() except for
118  // - in parallel the cell numbers are global cell numbers (starting
119  // from 0 at processor0 and then incrementing all through the
120  // processors)
121  // - the connections are across coupled patches
122  // See note on weights above.
123  virtual labelList decompose
124  (
125  const labelListList& globalCellCells,
126  const pointField& cellCentres,
127  const scalarField& cellWeights
128  );
129 
130 
131  // Member Operators
132 
133  //- Disallow default bitwise assignment
134  void operator=(const metis&) = delete;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace decompositionMethods
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
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.
void operator=(const metis &)=delete
Disallow default bitwise assignment.
virtual ~metis()
Destructor.
Definition: metis.H:80
metis(const dictionary &)
Construct given the decomposition dictionary.
Definition: dummyMetis.C:73
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
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