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 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 "UIPstream.H"
29#include "IPstream.H"
30#include "IOstreams.H"
31
32// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
33
35(
36 const commsTypes commsType,
37 const int fromProcNo,
38 DynamicList<char>& receiveBuf,
39 label& receiveBufPosition,
40 const int tag,
41 const label comm,
42 const bool clearAtEnd,
44)
45:
47 (
48 commsType,
49 fromProcNo,
50 receiveBuf,
51 receiveBufPosition,
52 tag,
53 comm,
54 clearAtEnd,
55 fmt
56 )
57{
58 bufferIPCrecv();
59}
60
61
63(
64 const commsTypes commsType,
65 const int fromProcNo,
66 const label bufSize,
67 const int tag,
68 const label comm,
70)
71:
72 Pstream(commsType, bufSize),
74 (
75 commsType,
76 fromProcNo,
77 Pstream::transferBuf_,
78 transferBufPosition_,
79 tag,
80 comm,
81 false, // Do not clear Pstream::transferBuf_ if at end
82 fmt
83 ),
84 transferBufPosition_(0)
85{}
86
87
89(
90 const int fromProcNo,
91 const label comm,
93)
94:
96 (
97 UPstream::commsTypes::scheduled, // irrelevant
98 fromProcNo,
99 label(0), // bufSize
100 UPstream::msgType(), // irrelevant
101 comm,
102 fmt
103 )
104{}
105
106
107// ************************************************************************* //
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
streamFormat
Data format (ascii | binary)
Inter-processor communications stream.
Definition: Pstream.H:63
Base class for input inter-processor communications stream (ie, parallel streams)....
Definition: UIPstream.H:62
Inter-processor communications stream.
Definition: UPstream.H:59
commsTypes
Types of communications.
Definition: UPstream.H:67