1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
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
53 const polyMesh& mesh_;
56 // Private Member Functions
60 const List<int>& adjncy,
61 const List<int>& xadj,
62 const scalarField& cellWeights,
63 List<int>& finalDecomp
66 //- Disallow default bitwise copy construct and assignment
67 void operator=(const metisDecomp&);
68 metisDecomp(const metisDecomp&);
73 //- Runtime type information
79 //- Construct given the decomposition dictionary and mesh
82 const dictionary& decompositionDict,
89 virtual ~metisDecomp()
95 virtual bool parallelAware() const
97 // Metis does not know about proc boundaries
101 //- Return for every coordinate the wanted processor number. Use the
102 // mesh connectivity (if needed)
103 // Weights get normalised so the minimum value is 1 before truncation
104 // to an integer so the weights should be multiples of the minimum
105 // value. The overall sum of weights might otherwise overflow.
106 virtual labelList decompose
108 const pointField& points,
109 const scalarField& pointWeights
112 //- Return for every coordinate the wanted processor number. Gets
113 // passed agglomeration map (from fine to coarse cells) and coarse cell
114 // location. Can be overridden by decomposers that provide this
115 // functionality natively.
116 // See note on weights above.
117 virtual labelList decompose
119 const labelList& agglom,
120 const pointField& regionPoints,
121 const scalarField& regionWeights
124 //- Same but with uniform weights
125 virtual labelList decompose
127 const labelList& agglom,
128 const pointField& regionPoints
135 scalarField(regionPoints.size(), 1.0)
139 //- Return for every coordinate the wanted processor number. Explicitly
140 // provided mesh connectivity.
141 // The connectivity is equal to mesh.cellCells() except for
142 // - in parallel the cell numbers are global cell numbers (starting
143 // from 0 at processor0 and then incrementing all through the
145 // - the connections are across coupled patches
146 // See note on weights above.
147 virtual labelList decompose
149 const labelListList& globalCellCells,
150 const pointField& cc,
151 const scalarField& cWeights
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 } // End namespace Foam
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 // ************************************************************************* //