metisDecomp.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-2021 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::metisDecomp
26 
27 Description
28  Metis domain decomposition
29 
30 SourceFiles
31  metisDecomp.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef metisDecomp_H
36 #define metisDecomp_H
37 
38 #include "decompositionMethod.H"
39 
40 namespace Foam
41 {
42 
43 /*---------------------------------------------------------------------------*\
44  Class metisDecomp Declaration
45 \*---------------------------------------------------------------------------*/
46 
47 class metisDecomp
48 :
49  public decompositionMethod
50 {
51  // Private Member Functions
52 
53  //- Call Metis with options from dictionary.
55  (
56  const List<label>& adjncy,
57  const List<label>& xadj,
58  const scalarField& cellWeights,
59  List<label>& finalDecomp
60  );
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("metis");
67 
68 
69  // Constructors
70 
71  //- Construct given the decomposition dictionary
72  metisDecomp(const dictionary&);
73 
74  //- Disallow default bitwise copy construction
75  metisDecomp(const metisDecomp&) = delete;
76 
77 
78  //- Destructor
79  virtual ~metisDecomp()
80  {}
81 
82 
83  // Member Functions
84 
85  //- Inherit decompose from decompositionMethod
87 
88  //- Return for every coordinate the wanted processor number. Use the
89  // mesh connectivity (if needed)
90  // Weights get normalised so the minimum value is 1 before truncation
91  // to an integer so the weights should be multiples of the minimum
92  // value. The overall sum of weights might otherwise overflow.
93  virtual labelList decompose
94  (
95  const polyMesh& mesh,
96  const pointField& points,
97  const scalarField& pointWeights
98  );
99 
100  //- Return for every coordinate the wanted processor number. Gets
101  // passed agglomeration map (from fine to coarse cells) and coarse cell
102  // location. Can be overridden by decomposers that provide this
103  // functionality natively.
104  // See note on weights above.
105  virtual labelList decompose
106  (
107  const polyMesh& mesh,
108  const labelList& agglom,
109  const pointField& regionPoints,
110  const scalarField& regionWeights
111  );
112 
113  //- Return for every coordinate the wanted processor number. Explicitly
114  // provided mesh connectivity.
115  // The connectivity is equal to mesh.cellCells() except for
116  // - in parallel the cell numbers are global cell numbers (starting
117  // from 0 at processor0 and then incrementing all through the
118  // processors)
119  // - the connections are across coupled patches
120  // See note on weights above.
121  virtual labelList decompose
122  (
123  const labelListList& globalCellCells,
124  const pointField& cc,
125  const scalarField& cWeights
126  );
127 
128 
129  // Member Operators
130 
131  //- Disallow default bitwise assignment
132  void operator=(const metisDecomp&) = delete;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Abstract base class for decomposition.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Return for every coordinate the wanted processor number.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Metis domain decomposition.
Definition: metisDecomp.H:49
TypeName("metis")
Runtime type information.
virtual ~metisDecomp()
Destructor.
Definition: metisDecomp.H:78
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Inherit decompose from decompositionMethod.
void operator=(const metisDecomp &)=delete
Disallow default bitwise assignment.
metisDecomp(const dictionary &)
Construct given the decomposition dictionary.
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