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 "ptscotchDecomp.H"
27 #include "addToRunTimeSelectionTable.H"
30 static const char* notImplementedMessage =
31 "You are trying to use ptscotch but do not have the "
32 "ptscotchDecomp library loaded."
33 "\nThis message is from the dummy ptscotchDecomp stub library instead.\n"
35 "Please install ptscotch and make sure that libptscotch.so is in your "
37 "The ptscotchDecomp library can then be built in "
38 "$FOAM_SRC/parallel/decompose/ptscotchDecomp\n";
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 defineTypeNameAndDebug(ptscotchDecomp, 0);
47 addToRunTimeSelectionTable
55 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
57 void Foam::ptscotchDecomp::check(const int retVal, const char* str)
61 Foam::label Foam::ptscotchDecomp::decomposeZeroDomains
63 const fileName& meshPath,
64 const List<int>& initxadj,
65 const List<int>& initadjncy,
66 const scalarField& initcWeights,
68 List<int>& finalDecomp
73 "label ptscotchDecomp::decompose"
77 "const scalarField&, "
80 ) << notImplementedMessage << exit(FatalError);
84 Foam::label Foam::ptscotchDecomp::decompose
86 const fileName& meshPath,
87 const List<int>& adjncy,
88 const List<int>& xadj,
89 const scalarField& cWeights,
90 List<int>& finalDecomp
95 "label ptscotchDecomp::decompose"
99 "const scalarField&, "
102 ) << notImplementedMessage << exit(FatalError);
108 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
110 Foam::ptscotchDecomp::ptscotchDecomp
112 const dictionary& decompositionDict
115 decompositionMethod(decompositionDict)
119 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
121 Foam::labelList Foam::ptscotchDecomp::decompose
123 const polyMesh& mesh,
124 const pointField& points,
125 const scalarField& pointWeights
130 "labelList ptscotchDecomp::decompose"
132 "const pointField&, "
135 ) << notImplementedMessage << exit(FatalError);
137 return labelList::null();
141 Foam::labelList Foam::ptscotchDecomp::decompose
143 const polyMesh& mesh,
144 const labelList& agglom,
145 const pointField& agglomPoints,
146 const scalarField& pointWeights
151 "labelList ptscotchDecomp::decompose"
154 "const pointField&, "
157 ) << notImplementedMessage << exit(FatalError);
159 return labelList::null();
163 Foam::labelList Foam::ptscotchDecomp::decompose
165 const labelListList& globalCellCells,
166 const pointField& cellCentres,
167 const scalarField& cWeights
172 "labelList ptscotchDecomp::decompose"
174 "const labelListList&, "
175 "const pointField&, "
178 ) << notImplementedMessage << exit(FatalError);
180 return labelList::null();
184 // ************************************************************************* //