OpenFOAM
v2406
The open source CFD toolbox
fieldDictionary.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) 2011-2015 OpenFOAM Foundation
9
Copyright (C) 2020 OpenCFD Ltd.
10
-------------------------------------------------------------------------------
11
License
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
Class
28
Foam::fieldDictionary
29
30
Description
31
Read field as dictionary (without mesh).
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef Foam_fieldDictionary_H
36
#define Foam_fieldDictionary_H
37
38
#include "
dictionary.H
"
39
#include "
regIOobject.H
"
40
41
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43
namespace
Foam
44
{
45
46
/*---------------------------------------------------------------------------*\
47
Class fieldDictionary Declaration
48
\*---------------------------------------------------------------------------*/
49
50
class
fieldDictionary
51
:
52
public
regIOobject
,
53
public
dictionary
54
{
55
// Private Data
56
57
//- The specified field type
58
const
word
fieldType_;
59
60
61
public
:
62
63
// Constructors
64
65
//- Construct from IOobject and specified (overloaded) type name
66
fieldDictionary
(
const
IOobject
&
io
,
const
word
& fieldType)
67
:
68
regIOobject
(
io
),
69
dictionary
(
readStream
(fieldType)),
70
fieldType_(fieldType)
71
{
72
close
();
73
}
74
75
76
// Member Functions
77
78
//- Redefine type name to be of the instantiated type
79
virtual
const
word
&
type
()
const
80
{
81
return
fieldType_;
82
}
83
84
//- The writeData function required by regIOobject write operation
85
virtual
bool
writeData
(
Ostream
&
os
)
const
86
{
87
dictionary::write
(
os
,
false
);
88
return
os
.good();
89
}
90
};
91
92
93
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94
95
}
// End namespace Foam
96
97
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98
99
#endif
100
101
// ************************************************************************* //
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition:
dictionary.H:129
Foam::fieldDictionary::type
virtual const word & type() const
Redefine type name to be of the instantiated type.
Definition:
fieldDictionary.H:78
Foam::fieldDictionary::fieldDictionary
fieldDictionary(const IOobject &io, const word &fieldType)
Construct from IOobject and specified (overloaded) type name.
Definition:
fieldDictionary.H:63
Foam::fieldDictionary::writeData
virtual bool writeData(Ostream &os) const
The writeData function required by regIOobject write operation.
Definition:
fieldDictionary.H:86
Foam::regIOobject::close
void close()
Close Istream.
Definition:
regIOobjectRead.C:161
Foam::word
A class for handling words, derived from Foam::string.
Definition:
word.H:63
Foam::fieldDictionary
Read field as dictionary (without mesh).
Definition:
fieldDictionary.H:43
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition:
Ostream.H:56
os
OBJstream os(runTime.globalPath()/outputName)
Foam::dictionary::write
void write(Ostream &os, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
Definition:
dictionaryIO.C:204
regIOobject.H
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition:
regIOobject.H:68
dictionary.H
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition:
IOobject.H:180
Foam::regIOobject::readStream
Istream & readStream(const word &, const bool readOnProc=true)
Return Istream and check object type against that given.
Definition:
regIOobjectRead.C:119
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:26
src
meshTools
topoSet
cellSources
fieldToCell
fieldDictionary.H
Generated by
1.8.14