GlobalIOList.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) 2015 OpenFOAM Foundation
9 Copyright (C) 2016-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "GlobalIOList.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33template<class Type>
35:
37{
38 // Check for MUST_READ_IF_MODIFIED
39 warnNoRereading<GlobalIOList<Type>>();
40
42}
43
44
45template<class Type>
47:
49{
50 // Check for MUST_READ_IF_MODIFIED
51 warnNoRereading<GlobalIOList<Type>>();
52
54}
55
56
57template<class Type>
59:
61{
62 // Check for MUST_READ_IF_MODIFIED
63 warnNoRereading<GlobalIOList<Type>>();
64
66 {
68 }
70
71
72template<class Type>
74(
75 const IOobject& io,
76 const UList<Type>& content
77)
80{
81 // Check for MUST_READ_IF_MODIFIED
82 warnNoRereading<GlobalIOList<Type>>();
83
84 if (!readHeaderOk(IOstream::BINARY, typeName))
85 {
86 List<Type>::operator=(content);
87 }
88}
89
90
91template<class Type>
93(
94 const IOobject& io,
95 List<Type>&& content
96)
97:
99{
100 // Check for MUST_READ_IF_MODIFIED
101 warnNoRereading<GlobalIOList<Type>>();
102
103 List<Type>::transfer(content);
106}
108
109// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110
111template<class Type>
114 is >> *this;
115 return is.good();
116}
117
118
119template<class Type>
121{
122 return (os << *this).good();
123}
124
125
126// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
127
128template<class Type>
130{
132}
133
134
135// ************************************************************************* //
virtual bool resize()
Resize the ODE solver.
Definition: Euler.C:53
IOList with global data (so optionally read from master)
Definition: GlobalIOList.H:57
const word typeName("scalarVectorTable")
virtual bool readData(Istream &is)
The readData method for regIOobject read operation.
Definition: GlobalIOList.C:112
void operator=(const GlobalIOList< Type > &rhs)
Copy assignment of entries.
Definition: GlobalIOList.C:129
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
bool good() const noexcept
Did last readHeader() succeed?
Definition: IOobjectI.H:222
bool good() const noexcept
True if next operation might succeed.
Definition: IOstream.H:233
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
Definition: List.C:480
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
bool readHeaderOk(const IOstreamOption::streamFormat fmt, const word &typeName)
Helper: check readOpt flags and read if necessary.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)