UPstreamReduce.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) 2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "Pstream.H"
29#include "PstreamReduceOps.H"
30
31// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
33// Specialisations for bool
34
36(
37 bool& value,
38 const andOp<bool>&,
39 const int tag,
40 const label comm
41)
42{}
43
45(
46 bool& value,
47 const orOp<bool>&,
48 const int tag,
49 const label comm
50)
51{}
52
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56// Specialisations for common reduction types
57
58#undef Pstream_CommonReductions
59#define Pstream_CommonReductions(Native) \
60 \
61void Foam::reduce \
62( \
63 Native& value, \
64 const minOp<Native>&, \
65 const int tag, \
66 const label comm \
67) \
68{} \
69 \
70void Foam::reduce \
71( \
72 Native& value, \
73 const maxOp<Native>&, \
74 const int tag, \
75 const label comm \
76) \
77{} \
78 \
79void Foam::reduce \
80( \
81 Native& value, \
82 const sumOp<Native>&, \
83 const int tag, \
84 const label comm \
85) \
86{} \
87 \
88void Foam::reduce \
89( \
90 Native values[], \
91 const int size, \
92 const sumOp<Native>&, \
93 const int tag, \
94 const label comm \
95) \
96{}
97
98
105
106#undef Pstream_CommonReductions
107
108
109// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110
111// Specialisations for floating-point types
112
113#undef Pstream_FloatReductions
114#define Pstream_FloatReductions(Native) \
115 \
116void Foam::sumReduce \
117( \
118 Native& value, \
119 label& count, \
120 const int tag, \
121 const label comm \
122) \
123{} \
124 \
125void Foam::reduce \
126( \
127 Native& value, \
128 const sumOp<Native>&, \
129 const int tag, \
130 const label comm, \
131 label& requestID \
132) \
133{} \
134 \
135void Foam::reduce \
136( \
137 Native values[], \
138 const int size, \
139 const sumOp<Native>&, \
140 const int tag, \
141 const label comm, \
142 label& requestID \
143) \
144{}
145
146
149
150#undef Pstream_FloatReductions
151
152
153// ************************************************************************* //
Inter-processor communication reduction functions.
#define Pstream_FloatReductions(Native)
#define Pstream_CommonReductions(Native)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)