IPBstreams.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-2025 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 "UIPstream.H"
29 #include "IPstream.H"
30 #include "IOstreams.H"
31 
32 // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
33 
35 (
36  DynamicList<char>& receiveBuf,
37  label& receiveBufPosition,
38  const int communicator,
39  const bool clearAtEnd,
41 )
42 :
44  (
45  UPstream::commsTypes::scheduled, // irrelevant
46  UPstream::masterNo(), // irrelevant
47  receiveBuf,
48  receiveBufPosition,
49  UPstream::msgType(), // irrelevant
51  clearAtEnd,
52  fmt
53  )
54 {
55  bufferIPCrecv();
56 }
57 
58 
60 (
61  const int communicator,
63 )
64 :
65  Pstream(UPstream::commsTypes::scheduled), // type is irrelevant
67  (
68  Pstream::transferBuf_,
69  UIPstreamBase::storedRecvBufPos_, // Internal only
70  communicator,
71  false, // Do not clear Pstream::transferBuf_ if at end
72  fmt
73  )
74 {}
75 
76 
77 // ************************************************************************* //
commsTypes
Communications types.
Definition: UPstream.H:77
Base class for input inter-processor communications stream (ie, parallel streams). Not to be used directly, thus contructors are protected.
Definition: UIPstream.H:55
IPBstream(const int communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct with optional communicator and read format. Uses UPstream::masterNo() root.
Definition: IPBstreams.C:53
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Input inter-processor communications stream using MPI broadcast - operating on external buffer...
Definition: UIPstream.H:466
Inter-processor communications stream.
Definition: Pstream.H:53
Wrapper for internally indexed communicator label. Always invokes UPstream::allocateCommunicatorCompo...
Definition: UPstream.H:2237
streamFormat
Data format (ascii | binary)
UIPBstream(DynamicList< char > &receiveBuf, label &receiveBufPosition, const int communicator=UPstream::worldComm, const bool clearAtEnd=false, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct using the given attached receive buffer,.
Definition: IPBstreams.C:28
Inter-processor communications stream.
Definition: UPstream.H:65