UIPread.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM 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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25  Read from UIPstream
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "UIPstream.H"
30 
31 // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
32 
34 (
35  const commsTypes commsType,
36  const int fromProcNo,
37  DynamicList<char>& externalBuf,
38  label& externalBufPosition,
39  const int tag,
40  const label comm,
41  const bool clearAtEnd,
42  const streamFormat format,
43  const versionNumber version,
44  const bool global
45 )
46 :
47  UPstream(commsType),
48  Istream(format, version, UNCOMPRESSED, global),
49  fromProcNo_(fromProcNo),
50  externalBuf_(externalBuf),
51  externalBufPosition_(externalBufPosition),
52  tag_(tag),
53  comm_(comm),
54  clearAtEnd_(clearAtEnd),
55  messageSize_(0)
56 {
58 }
59 
60 
61 Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
62 :
63  UPstream(buffers.commsType_),
64  Istream(buffers.format_, buffers.version_),
65  fromProcNo_(fromProcNo),
66  externalBuf_(buffers.recvBuf_[fromProcNo]),
67  externalBufPosition_(buffers.recvBufPos_[fromProcNo]),
68  tag_(buffers.tag_),
69  comm_(buffers.comm_),
70  clearAtEnd_(true),
71  messageSize_(0)
72 {
74 }
75 
76 
77 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
78 
80 (
81  const commsTypes commsType,
82  const int fromProcNo,
83  char* buf,
84  const std::streamsize bufSize,
85  const int tag,
86  const label communicator
87 )
88 {
90 
91  return 0;
92 }
93 
94 
95 // ************************************************************************* //
Version number type.
Definition: IOstream.H:97
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:87
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Buffers for inter-processor communications streams (UOPstream, UIPstream).
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Read into given buffer from given processor and return the.
Definition: UIPread.C:80
UIPstream(const commsTypes commsType, const int fromProcNo, DynamicList< char > &externalBuf, label &externalBufPosition, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool clearAtEnd=false, const streamFormat format=BINARY, const versionNumber version=currentVersion, const bool global=false)
Construct given process index to read from and optional buffer size,.
Definition: UIPread.C:34
Helper class for allocating/freeing communicators.
Definition: UPstream.H:315
Inter-processor communications stream.
Definition: UPstream.H:59
commsTypes
Types of communications.
Definition: UPstream.H:65
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
word format(conversionProperties.lookup("format"))