rawIOField.H
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) 2020 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
26Class
27 Foam::rawIOField
28
29Description
30 Like IOField but falls back to raw IFstream if no header found.
31 Optionally reads average value. For use in MappedFile container.
32
33SourceFiles
34 rawIOField.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef rawIOField_H
39#define rawIOField_H
40
41#include "IOField.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class rawIOField Declaration
50\*---------------------------------------------------------------------------*/
51
52template<class Type>
53class rawIOField
54:
55 public regIOobject,
56 public Field<Type>
57{
58 // Private Data
59
60 //- The average of the field (Zero if not used)
61 Type average_;
62
63
64public:
66 TypeName("rawField");
67
68
69 // Constructors
70
71 //- Default copy construct
72 rawIOField(const rawIOField&) = default;
73
74 //- Construct from IOobject
75 explicit rawIOField(const IOobject& io, const bool readAverage);
76
77
78 //- Destructor
79 virtual ~rawIOField() = default;
80
81
82 // Member Functions
84 const Type& average() const
85 {
86 return average_;
87 }
88
89 bool writeData(Ostream& os) const;
90
91
92 // Member Operators
93
94 //- Copy or move assignment of entries
95 using Field<Type>::operator=;
96};
97
98
99// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100
101} // End namespace Foam
102
103// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104
105#ifdef NoRepository
106 #include "rawIOField.C"
107#endif
108
109// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110
111#endif
112
113// ************************************************************************* //
Generic templated field type.
Definition: Field.H:82
friend Ostream & operator(Ostream &, const Field< Type > &)
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Like IOField but falls back to raw IFstream if no header found. Optionally reads average value....
Definition: rawIOField.H:56
rawIOField(const rawIOField &)=default
Default copy construct.
TypeName("rawField")
bool writeData(Ostream &os) const
Pure virtual writeData function.
Definition: rawIOField.C:136
virtual ~rawIOField()=default
Destructor.
const Type & average() const
Definition: rawIOField.H:83
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73