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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "parMetisDecomp.H"
27 #include "addToRunTimeSelectionTable.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 defineTypeNameAndDebug(parMetisDecomp, 0);
37 addToRunTimeSelectionTable
45 static const char* notImplementedMessage =
46 "You are trying to use parMetis but do not have the parMetisDecomp library "
48 "This message is from the dummy parMetisDecomp stub library instead.\n"
50 "Please install parMetis and make sure that libparMetis.so is in your "
52 "The parMetisDecomp library can then be built in $FOAM_SRC/decompositionMethods/"
56 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
58 //- Does prevention of 0 cell domains and calls parmetis.
59 Foam::label Foam::parMetisDecomp::decompose
63 const pointField& cellCentres,
64 Field<int>& cellWeights,
65 Field<int>& faceWeights,
66 const List<int>& options,
68 List<int>& finalDecomp
73 "label parMetisDecomp::decompose"
83 )<< notImplementedMessage << exit(FatalError);
89 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
91 Foam::parMetisDecomp::parMetisDecomp
93 const dictionary& decompositionDict,
97 decompositionMethod(decompositionDict),
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
104 Foam::labelList Foam::parMetisDecomp::decompose
106 const pointField& cc,
107 const scalarField& cWeights
112 "labelList parMetisDecomp::decompose"
114 "const pointField&, "
117 ) << notImplementedMessage << exit(FatalError);
123 Foam::labelList Foam::parMetisDecomp::decompose
125 const labelList& cellToRegion,
126 const pointField& regionPoints,
127 const scalarField& regionWeights
132 "labelList parMetisDecomp::decompose"
135 "const pointField&, "
138 ) << notImplementedMessage << exit(FatalError);
144 Foam::labelList Foam::parMetisDecomp::decompose
146 const labelListList& globalCellCells,
147 const pointField& cellCentres,
148 const scalarField& cWeights
153 "labelList parMetisDecomp::decompose"
155 "const labelListList&, "
156 "const pointField&, "
159 ) << notImplementedMessage << exit(FatalError);
165 void Foam::parMetisDecomp::calcMetisDistributedCSR
167 const polyMesh& mesh,
174 "void parMetisDecomp::calcMetisDistributedCSR"
180 ) << notImplementedMessage << exit(FatalError);
184 // ************************************************************************* //