1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 Metis domain decomposition
33 \*---------------------------------------------------------------------------*/
38 #include "decompositionMethod.H"
43 /*---------------------------------------------------------------------------*\
44 Class metisDecomp Declaration
45 \*---------------------------------------------------------------------------*/
49 public decompositionMethod
52 // Private Member Functions
56 const List<int>& adjncy,
57 const List<int>& xadj,
58 const scalarField& cellWeights,
59 List<int>& finalDecomp
62 //- Disallow default bitwise copy construct and assignment
63 void operator=(const metisDecomp&);
64 metisDecomp(const metisDecomp&);
69 //- Runtime type information
75 //- Construct given the decomposition dictionary
76 metisDecomp(const dictionary&);
80 virtual ~metisDecomp()
86 virtual bool parallelAware() const
88 // Metis does not know about proc boundaries
92 //- Return for every coordinate the wanted processor number. Use the
93 // mesh connectivity (if needed)
94 // Weights get normalised so the minimum value is 1 before truncation
95 // to an integer so the weights should be multiples of the minimum
96 // value. The overall sum of weights might otherwise overflow.
97 virtual labelList decompose
100 const pointField& points,
101 const scalarField& pointWeights
104 //- Return for every coordinate the wanted processor number. Gets
105 // passed agglomeration map (from fine to coarse cells) and coarse cell
106 // location. Can be overridden by decomposers that provide this
107 // functionality natively.
108 // See note on weights above.
109 virtual labelList decompose
111 const polyMesh& mesh,
112 const labelList& agglom,
113 const pointField& regionPoints,
114 const scalarField& regionWeights
117 //- Return for every coordinate the wanted processor number. Explicitly
118 // provided mesh connectivity.
119 // The connectivity is equal to mesh.cellCells() except for
120 // - in parallel the cell numbers are global cell numbers (starting
121 // from 0 at processor0 and then incrementing all through the
123 // - the connections are across coupled patches
124 // See note on weights above.
125 virtual labelList decompose
127 const labelListList& globalCellCells,
128 const pointField& cc,
129 const scalarField& cWeights
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 } // End namespace Foam
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 // ************************************************************************* //