1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
28 Functions used for exchanging data between processors
32 \*---------------------------------------------------------------------------*/
34 #ifndef helperFunctionsPar_H
35 #define helperFunctionsPar_H
37 #include "labelList.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 //- exchanges the data between processors such that in the end thwy all have
51 //- the necessary information to proceed with the local work
52 template<class sendOp, class combineOp, class T, class ListType>
53 void combineData(const sendOp&, combineOp&);
55 //- each processor exchanges the data with all of its neighbours
56 //- processors with lower labels first send the data to processors with
57 //- higher labels first and and then to the processors with lower labels
58 template<class T, class ListType, class scatterOp, class gatherOp>
59 void whisperReduce(const ListType&, const scatterOp&, gatherOp&);
61 //- send the data stored in the map to other processors and collects the data
62 //- sent from other processors into the list
63 template<class T, class ListType>
66 const std::map<label, ListType>&,
68 const Pstream::commsTypes commsType = Pstream::blocking
71 //- sends the data stored in a map to other processors and receives the data
72 //- received from other processors into another map
73 template<class T, class ListType>
74 void exchangeMap(const std::map<label, ListType>&, std::map<label, List<T> >&);
76 //- calculates the reverse addressing of the graph by transposing the graph
77 template<class RowType, template<class ListTypeArg> class GraphType>
78 void reverseAddressingSMP(const GraphType<RowType>&, GraphType<RowType>&);
80 } // End namespace help
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 } // End namespace Foam
87 # include "helperFunctionsPar.C"
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 // ************************************************************************* //