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-2018 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  //- Disallow default bitwise copy construct and assignment
64  void operator=(const metisDecomp&);
65  metisDecomp(const metisDecomp&);
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("metis");
72 
73 
74  // Constructors
75 
76  //- Construct given the decomposition dictionary
77  metisDecomp(const dictionary&);
78 
79 
80  //- Destructor
81  virtual ~metisDecomp()
82  {}
83 
84 
85  // Member Functions
86 
87  virtual bool parallelAware() const
88  {
89  // Metis does not know about proc boundaries
90  return false;
91  }
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& agglom,
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& cc,
133  const scalarField& cWeights
134  );
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
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:137
dynamicFvMesh & mesh
const pointField & points
Abstract base class for decomposition.
Metis domain decomposition.
Definition: metisDecomp.H:46
virtual ~metisDecomp()
Destructor.
Definition: metisDecomp.H:80
virtual bool parallelAware() const
Is method parallel aware (i.e. does it synchronize domains across.
Definition: metisDecomp.H:86
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
TypeName("metis")
Runtime type information.
Namespace for OpenFOAM.