dummyMetisDecomp.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "metisDecomp.H"
28 #include "Time.H"
29 
30 static const char* notImplementedMessage =
31 "You are trying to use metis but do not have the metisDecomp library loaded."
32 "\nThis message is from the dummy metisDecomp stub library instead.\n"
33 "\n"
34 "Please install metis and make sure that libmetis.so is in your "
35 "LD_LIBRARY_PATH.\n"
36 "The metisDecomp library can then be built from "
37 "$FOAM_SRC/parallel/decompose/metisDecomp and dynamically loading or linking"
38 " this library will add metis as a decomposition method.\n"
39 "Please be aware that there are license restrictions on using Metis.";
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45  defineTypeNameAndDebug(metisDecomp, 0);
46 
48  (
49  decompositionMethod,
50  metisDecomp,
51  dictionary
52  );
53 }
54 
55 
56 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
57 
58 Foam::label Foam::metisDecomp::decompose
59 (
60  const List<label>& adjncy,
61  const List<label>& xadj,
62  const scalarField& cellWeights,
63  List<label>& finalDecomp
64 )
65 {
67  << notImplementedMessage << exit(FatalError);
68 
69  return -1;
70 }
71 
72 
73 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
74 
76 (
77  const dictionary& decompositionDict
78 )
79 :
80  decompositionMethod(decompositionDict)
81 {}
82 
83 
84 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
85 
86 Foam::labelList Foam::metisDecomp::decompose
87 (
88  const polyMesh& mesh,
89  const pointField& points,
90  const scalarField& pointWeights
91 )
92 {
94  << notImplementedMessage << exit(FatalError);
95 
96  return labelList();
97 }
98 
99 
100 Foam::labelList Foam::metisDecomp::decompose
101 (
102  const polyMesh& mesh,
103  const labelList& agglom,
104  const pointField& agglomPoints,
105  const scalarField& agglomWeights
106 )
107 {
109  << notImplementedMessage << exit(FatalError);
110 
111  return labelList();
112 }
113 
114 
115 Foam::labelList Foam::metisDecomp::decompose
116 (
117  const labelListList& globalCellCells,
118  const pointField& cellCentres,
119  const scalarField& cellWeights
120 )
121 {
123  << notImplementedMessage << exit(FatalError);
124 
125  return labelList();
126 }
127 
128 
129 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
Macros for easy insertion into run-time selection tables.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< label > labelList
A List of labels.
Definition: labelList.H:56
Abstract base class for decomposition.
static const char * notImplementedMessage
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.
metisDecomp(const dictionary &)
Construct given the decomposition dictionary.