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