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 PTScotch domain decomposition
33 \*---------------------------------------------------------------------------*/
35 #ifndef ptscotchDecomp_H
36 #define ptscotchDecomp_H
38 #include "decompositionMethod.H"
43 /*---------------------------------------------------------------------------*\
44 Class ptscotchDecomp Declaration
45 \*---------------------------------------------------------------------------*/
49 public decompositionMethod
51 // Private Member Functions
53 //- Insert list in front of list.
55 static void prepend(const UList<Type>&, List<Type>&);
56 //- Insert list at end of list.
58 static void append(const UList<Type>&, List<Type>&);
60 //- Check and print error message
61 static void check(const int, const char*);
63 //- Decompose with optionally zero sized domains
64 label decomposeZeroDomains
66 const fileName& meshPath,
67 const List<int>& initadjncy,
68 const List<int>& initxadj,
69 const scalarField& initcWeights,
70 List<int>& finalDecomp
76 const fileName& meshPath,
77 const List<int>& adjncy,
78 const List<int>& xadj,
79 const scalarField& cWeights,
80 List<int>& finalDecomp
83 //- Disallow default bitwise copy construct and assignment
84 void operator=(const ptscotchDecomp&);
85 ptscotchDecomp(const ptscotchDecomp&);
90 //- Runtime type information
96 //- Construct given the decomposition dictionary and mesh
97 ptscotchDecomp(const dictionary& decompositionDict);
101 virtual ~ptscotchDecomp()
107 virtual bool parallelAware() const
109 // ptscotch does not know about proc boundaries
113 //- Return for every coordinate the wanted processor number. Use the
114 // mesh connectivity (if needed). See note on weights in scotchDecomp.H
115 virtual labelList decompose
117 const polyMesh& mesh,
118 const pointField& points,
119 const scalarField& pointWeights
122 //- Return for every coordinate the wanted processor number. Gets
123 // passed agglomeration map (from fine to coarse cells) and coarse cell
124 // location. Can be overridden by decomposers that provide this
125 // functionality natively. See note on weights in scotchDecomp.H
126 virtual labelList decompose
128 const polyMesh& mesh,
129 const labelList& agglom,
130 const pointField& regionPoints,
131 const scalarField& regionWeights
134 //- Return for every coordinate the wanted processor number. Explicitly
135 // provided mesh connectivity.
136 // The connectivity is equal to mesh.cellCells() except for
137 // - in parallel the cell numbers are global cell numbers (starting
138 // from 0 at processor0 and then incrementing all through the
140 // - the connections are across coupled patches
141 // See note on weights in scotchDecomp.H
142 virtual labelList decompose
144 const labelListList& globalCellCells,
145 const pointField& cc,
146 const scalarField& cWeights
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 # include "ptscotchDecompTemplates.C"
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 // ************************************************************************* //