1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
32 \*---------------------------------------------------------------------------*/
34 #ifndef parMetisDecomp_H
35 #define parMetisDecomp_H
37 #include "decompositionMethod.H"
42 /*---------------------------------------------------------------------------*\
43 Class parMetisDecomp Declaration
44 \*---------------------------------------------------------------------------*/
48 public decompositionMethod
52 const polyMesh& mesh_;
55 // Private Member Functions
57 //- Disallow default bitwise copy construct
58 parMetisDecomp(const parMetisDecomp&);
60 //- Disallow default bitwise assignment
61 void operator=(const parMetisDecomp&);
64 //- Insert list in front of list
66 static void prepend(const UList<Type>&, List<Type>&);
68 //- Insert list at end of list
70 static void append(const UList<Type>&, List<Type>&);
76 const pointField& cellCentres,
77 Field<int>& cellWeights,
78 Field<int>& faceWeights,
79 const List<int>& options,
81 List<int>& finalDecomp
87 //- Runtime type information
93 //- Construct given the decomposition dictionary and mesh
96 const dictionary& decompositionDict,
109 //- parMetis handles Foam processor boundaries
110 virtual bool parallelAware() const
115 //- Return for every coordinate the wanted processor number. Use the
116 // mesh connectivity (if needed)
117 // Weights get normalised so the minimum value is 1 before truncation
118 // to an integer so the weights should be multiples of the minimum
119 // value. The overall sum of weights might otherwise overflow.
120 virtual labelList decompose
122 const pointField& points,
123 const scalarField& pointWeights
126 //- Return for every coordinate the wanted processor number. Gets
127 // passed agglomeration map (from fine to coarse cells) and coarse cell
128 // location. Can be overridden by decomposers that provide this
129 // functionality natively.
130 // See note on weights above.
131 virtual labelList decompose
133 const labelList& cellToRegion,
134 const pointField& regionPoints,
135 const scalarField& regionWeights
138 //- Same but with uniform weights
139 virtual labelList decompose
141 const labelList& cellToRegion,
142 const pointField& regionPoints
149 scalarField(regionPoints.size(), 1.0)
153 //- Return for every coordinate the wanted processor number. Explicitly
154 // provided mesh connectivity.
155 // The connectivity is equal to mesh.cellCells() except for
156 // - in parallel the cell numbers are global cell numbers (starting
157 // from 0 at processor0 and then incrementing all through the
159 // - the connections are across coupled patches
160 // See note on weights above.
161 virtual labelList decompose
163 const labelListList& globalCellCells,
164 const pointField& cc,
165 const scalarField& cWeights
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 } // End namespace Foam
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 # include "parMetisDecompTemplates.C"
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 // ************************************************************************* //