dummyScotchDecomp.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2015 OpenFOAM Foundation
9  Copyright (C) 2018-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "scotchDecomp.H"
31 #include "Time.H"
32 
33 static const char* notImplementedMessage =
34 "Attempted to use <scotch> without the scotchDecomp library loaded.\n"
35 "This message is from the dummy scotchDecomp stub library instead.\n\n"
36 "Please install <scotch> and ensure libscotch.so is in LD_LIBRARY_PATH.\n"
37 "The scotchDecomp library can then be built from "
38 "src/parallel/decompose/scotchDecomp.\n"
39 "Dynamically loading or linking this library will add "
40 "<scotch> as a decomposition method.\n";
41 
42 
43 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47  defineTypeNameAndDebug(scotchDecomp, 0);
48 
50  (
51  decompositionMethod,
52  scotchDecomp,
53  dictionary
54  );
55 }
56 
57 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
58 
59 void Foam::scotchDecomp::graphPath(const polyMesh& unused) const {}
60 
61 void Foam::scotchDecomp::check(const int retVal, const char* str) {}
62 
63 
64 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
65 
67 (
68  const labelList& adjncy,
69  const labelList& xadj,
70  const List<scalar>& cWeights,
71  labelList& decomp
72 ) const
73 {
76  << exit(FatalError);
77 
78  return -1;
79 }
80 
81 
82 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
83 
85 (
86  const dictionary& decompDict
87 )
88 :
89  metisLikeDecomp("scotch", decompDict)
90 {}
91 
92 
94 (
95  const dictionary& decompDict,
96  const word& regionName
97 )
98 :
99  metisLikeDecomp("scotch", decompDict, regionName)
100 {}
101 
102 
103 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
104 
106 (
107  const polyMesh& mesh,
108  const pointField& points,
109  const scalarField& pointWeights
110 ) const
111 {
114 
115  return labelList();
116 }
117 
118 
120 (
121  const polyMesh& mesh,
122  const labelList& agglom,
123  const pointField& agglomPoints,
124  const scalarField& pointWeights
125 ) const
126 {
129 
130  return labelList();
131 }
132 
133 
135 (
136  const labelListList& globalCellCells,
137  const pointField& cellCentres,
138  const scalarField& cWeights
139 ) const
140 {
143 
144  return labelList();
145 }
146 
147 
148 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::scotchDecomp::decomposeSerial
virtual label decomposeSerial(const labelList &adjncy, const labelList &xadj, const List< scalar > &cWeights, labelList &decomp) const
Decompose non-parallel.
Definition: dummyScotchDecomp.C:67
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
Foam::Field< vector >
scotchDecomp.H
Foam::metisLikeDecomp
Domain decomposition using METIS-like data structures.
Definition: metisLikeDecomp.H:51
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
notImplementedMessage
static const char * notImplementedMessage
Definition: dummyScotchDecomp.C:33
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::scotchDecomp::scotchDecomp
scotchDecomp(const scotchDecomp &)=delete
No copy construct.
Time.H
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::List< label >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::scotchDecomp::decompose
virtual labelList decompose(const polyMesh &mesh, const pointField &points, const scalarField &pointWeights) const
Return for every coordinate the wanted processor number.
Definition: dummyScotchDecomp.C:106
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)