IPstream.H
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-2013 OpenFOAM Foundation
9 Copyright (C) 2021-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::IPstream
29
30Description
31 Input inter-processor communications stream.
32
33SourceFiles
34 IPstreams.C
35
36\*---------------------------------------------------------------------------*/
37
38#include "Pstream.H"
39
40#ifndef Foam_IPstream_H
41#define Foam_IPstream_H
42
43#include "UIPstream.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class IPstream Declaration
52\*---------------------------------------------------------------------------*/
54class IPstream
55:
56 public Pstream,
57 public UIPstream
58{
59 // Private Data
60
61 //- Receive index into Pstream::transferBuf_
62 label transferBufPosition_;
63
64public:
65
66 // Constructors
67
68 //- Construct given process index to read from
69 //- and optional buffer size, read format
71 (
73 const int fromProcNo,
74 const label bufSize = 0,
75 const int tag = UPstream::msgType(),
76 const label comm = UPstream::worldComm,
78 );
79};
80
81
82/*---------------------------------------------------------------------------*\
83 Class IPBstream Declaration
84\*---------------------------------------------------------------------------*/
85
86//- Input inter-processor communications stream
87//- using MPI broadcast.
88class IPBstream
89:
90 public Pstream,
91 public UIPBstream
92{
93 // Private Data
94
95 //- Receive index into Pstream::transferBuf_
96 label transferBufPosition_;
97
98public:
99
100 // Constructors
101
102 //- Construct for broadcast root, optional buffer size, read format
104 (
105 const commsTypes commsType,
106 const int rootProcNo,
107 const label bufSize = 0,
108 const int tag = UPstream::msgType(),
109 const label comm = UPstream::worldComm,
111 );
112
113 //- Construct for broadcast root with optional communicator,
114 //- write format
115 explicit IPBstream
116 (
117 const int rootProcNo,
118 const label comm = UPstream::worldComm,
120 );
121};
122
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126} // End namespace Foam
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#endif
131
132// ************************************************************************* //
streamFormat
Data format (ascii | binary)
Input inter-processor communications stream.
Definition: IPstream.H:57
Inter-processor communications stream.
Definition: Pstream.H:63
commsTypes
Types of communications.
Definition: UPstream.H:67
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:556
commsTypes commsType() const noexcept
Get the communications type of the stream.
Definition: UPstream.H:562
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:293
Namespace for OpenFOAM.