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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "scotchDecomp.H"
27 #include "addToRunTimeSelectionTable.H"
30 static const char* notImplementedMessage =
31 "You are trying to use scotch but do not have the scotchDecomp library loaded."
32 "\nThis message is from the dummy scotchDecomp stub library instead.\n"
34 "Please install scotch and make sure that libscotch.so is in your "
36 "The scotchDecomp library can then be built in "
37 "$FOAM_SRC/parallel/decompose/decompositionMethods/scotchDecomp\n";
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 defineTypeNameAndDebug(scotchDecomp, 0);
46 addToRunTimeSelectionTable
54 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
56 void Foam::scotchDecomp::check(const int retVal, const char* str)
60 Foam::label Foam::scotchDecomp::decompose
62 const fileName& meshPath,
63 const List<int>& adjncy,
64 const List<int>& xadj,
65 const scalarField& cWeights,
67 List<int>& finalDecomp
72 "label scotchDecomp::decompose\n"
74 "const fileName& meshPath,\n"
77 "const scalarField&,\n"
80 ) << notImplementedMessage << exit(FatalError);
86 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
88 Foam::scotchDecomp::scotchDecomp
90 const dictionary& decompositionDict
93 decompositionMethod(decompositionDict)
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 Foam::labelList Foam::scotchDecomp::decompose
101 const polyMesh& mesh,
102 const pointField& points,
103 const scalarField& pointWeights
108 "labelList scotchDecomp::decompose"
110 "const pointField&, "
113 ) << notImplementedMessage << exit(FatalError);
115 return labelList::null();
119 Foam::labelList Foam::scotchDecomp::decompose
121 const polyMesh& mesh,
122 const labelList& agglom,
123 const pointField& agglomPoints,
124 const scalarField& pointWeights
129 "labelList scotchDecomp::decompose"
132 "const pointField&, "
135 ) << notImplementedMessage << exit(FatalError);
137 return labelList::null();
141 Foam::labelList Foam::scotchDecomp::decompose
143 const labelListList& globalCellCells,
144 const pointField& cellCentres,
145 const scalarField& cWeights
150 "labelList scotchDecomp::decompose"
152 "const labelListList&, "
153 "const pointField&, "
156 ) << notImplementedMessage << exit(FatalError);
158 return labelList::null();
162 // ************************************************************************* //