GlobalIOField.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) 2015-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "GlobalIOField.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Type>
32 :
33  regIOobject(io)
34 {
35  // Check for MUST_READ_IF_MODIFIED
36  warnNoRereading<GlobalIOField<Type>>();
37 
38  readHeaderOk(IOstream::BINARY, typeName);
39 }
40 
41 
42 template<class Type>
44 :
45  regIOobject(io)
46 {
47  // Check for MUST_READ_IF_MODIFIED
48  warnNoRereading<GlobalIOField<Type>>();
49 
50  if (!readHeaderOk(IOstream::BINARY, typeName))
51  {
53  }
54 }
55 
56 
57 template<class Type>
59 (
60  const IOobject& io,
61  const Field<Type>& f
62 )
63 :
64  regIOobject(io)
65 {
66  // Check for MUST_READ_IF_MODIFIED
67  warnNoRereading<GlobalIOField<Type>>();
68 
69  if (!readHeaderOk(IOstream::BINARY, typeName))
70  {
72  }
73 }
74 
75 
76 template<class Type>
78 (
79  const IOobject& io,
80  const Xfer<Field<Type>>& f
81 )
82 :
83  regIOobject(io)
84 {
85  // Check for MUST_READ_IF_MODIFIED
86  warnNoRereading<GlobalIOField<Type>>();
87 
89 
90  readHeaderOk(IOstream::BINARY, typeName);
91 }
92 
93 
94 // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
95 
96 template<class Type>
98 {}
99 
100 
101 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
102 
103 template<class Type>
105 {
106  is >> *this;
107  return is.good();
108 }
109 
110 
111 template<class Type>
113 {
114  return (os << static_cast<const Field<Type>&>(*this)).good();
115 }
116 
117 
118 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
119 
120 template<class Type>
122 {
124 }
125 
126 
127 template<class Type>
129 {
131 }
132 
133 
134 // ************************************************************************* //
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
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
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
void operator=(const GlobalIOField< Type > &)
bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
virtual ~GlobalIOField()
Destructor.
Definition: GlobalIOField.C:97
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:333
points setSize(newPointi)
Pre-declare SubField and related Field type.
Definition: Field.H:57
IOField with global data (so optionally read from master)
Definition: GlobalIOField.H:50
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
GlobalIOField(const IOobject &)
Construct from IOobject.
Definition: GlobalIOField.C:31
labelList f(nPoints)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92