UIPread.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) 2011-2015 OpenFOAM Foundation
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 Description
27  Read from UIPstream
28 
29 \*---------------------------------------------------------------------------*/
30 
31 #include "UIPstream.H"
32 
33 // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
34 
36 (
37  const commsTypes commsType,
38  const int fromProcNo,
39  DynamicList<char>& externalBuf,
40  label& externalBufPosition,
41  const int tag,
42  const label comm,
43  const bool clearAtEnd,
46 )
47 :
48  UPstream(commsType),
50  fromProcNo_(fromProcNo),
51  externalBuf_(externalBuf),
52  externalBufPosition_(externalBufPosition),
53  tag_(tag),
54  comm_(comm),
55  clearAtEnd_(clearAtEnd),
56  messageSize_(0)
57 {
59 }
60 
61 
62 Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
63 :
64  UPstream(buffers.commsType_),
65  Istream(buffers.format_, buffers.version_),
66  fromProcNo_(fromProcNo),
67  externalBuf_(buffers.recvBuf_[fromProcNo]),
68  externalBufPosition_(buffers.recvBufPos_[fromProcNo]),
69  tag_(buffers.tag_),
70  comm_(buffers.comm_),
71  clearAtEnd_(true),
72  messageSize_(0)
73 {
75 }
76 
77 
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79 
80 Foam::label Foam::UIPstream::read
81 (
82  const commsTypes commsType,
83  const int fromProcNo,
84  char* buf,
85  const std::streamsize bufSize,
86  const int tag,
87  const label communicator
88 )
89 {
91 
92  return 0;
93 }
94 
95 
96 // ************************************************************************* //
Foam::DynamicList< char >
Foam::PstreamBuffers
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Definition: PstreamBuffers.H:87
Foam::UIPstream::read
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:81
format
word format(conversionProperties.get< word >("format"))
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:445
Foam::UPstream
Inter-processor communications stream.
Definition: UPstream.H:61
Foam::IOstreamOption::versionNumber
Representation of a major/minor version number.
Definition: IOstreamOption.H:85
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::IOstreamOption::streamFormat
streamFormat
Data format (ascii | binary)
Definition: IOstreamOption.H:70
Foam::foamVersion::version
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::UIPstream::UIPstream
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, streamFormat format=BINARY, versionNumber version=currentVersion)
Construct given process index to read from and optional buffer size,.
Definition: UIPread.C:36
Foam::UPstream::communicator
Helper class for allocating/freeing communicators.
Definition: UPstream.H:331
UIPstream.H