OpenFOAM: API Guide
v2112
The open source CFD toolbox
IOMRFZoneList.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) 2012-2017 OpenFOAM Foundation
9
Copyright (C) 2019-2021 OpenCFD Ltd.
10
Copyright (C) 2020 PCOpt/NTUA
11
Copyright (C) 2020 FOSS GP
12
-------------------------------------------------------------------------------
13
License
14
This file is part of OpenFOAM.
15
16
OpenFOAM is free software: you can redistribute it and/or modify it
17
under the terms of the GNU General Public License as published by
18
the Free Software Foundation, either version 3 of the License, or
19
(at your option) any later version.
20
21
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
22
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24
for more details.
25
26
You should have received a copy of the GNU General Public License
27
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28
29
\*---------------------------------------------------------------------------*/
30
31
#include "
IOMRFZoneList.H
"
32
#include "
fvMesh.H
"
33
#include "
Time.H
"
34
35
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
36
37
Foam::IOobject
Foam::IOMRFZoneList::createIOobject
38
(
39
const
fvMesh&
mesh
,
40
const
word& solverName
41
)
const
42
{
43
IOobject
io
44
(
45
"MRFProperties"
+ solverName,
46
mesh
.
time
().
constant
(),
47
mesh
,
48
IOobject::MUST_READ
,
49
IOobject::NO_WRITE
50
);
51
52
if
(
io
.
typeHeaderOk
<IOdictionary>(
true
))
53
{
54
Info
<<
"Creating MRF zone list from "
<<
io
.
name
() <<
endl
;
55
56
io
.
readOpt
(
IOobject::MUST_READ_IF_MODIFIED
);
57
}
58
else
59
{
60
Info
<<
"No MRF models present"
<<
nl
<<
endl
;
61
62
io
.
readOpt
(
IOobject::NO_READ
);
63
}
64
65
return
io
;
66
}
67
68
69
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
70
71
Foam::IOMRFZoneList::IOMRFZoneList
72
(
73
const
fvMesh
&
mesh
,
74
const
word
& solverName
75
)
76
:
77
IOdictionary
(createIOobject(
mesh
, solverName)),
78
MRFZoneList
(
mesh
, *this)
79
{}
80
81
82
bool
Foam::IOMRFZoneList::read
()
83
{
84
if
(
regIOobject::read
())
85
{
86
MRFZoneList::read
(*
this
);
87
return
true
;
88
}
89
90
return
false
;
91
}
92
93
94
// ************************************************************************* //
IOMRFZoneList.H
Time.H
Foam::IOMRFZoneList
List of MRF zones with IO functionality. MRF zones are specified by a list of dictionary entries,...
Definition:
IOMRFZoneList.H:75
Foam::IOMRFZoneList::read
virtual bool read()
Read dictionary.
Definition:
IOMRFZoneList.C:82
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition:
IOdictionary.H:57
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition:
IOobject.H:170
Foam::IOobject::name
const word & name() const noexcept
Return the object name.
Definition:
IOobjectI.H:65
Foam::IOobject::readOpt
readOption readOpt() const noexcept
The read option.
Definition:
IOobjectI.H:164
Foam::IOobject::typeHeaderOk
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
Definition:
IOobjectTemplates.C:39
Foam::IOobject::IOobject
IOobject(const IOobject &)=default
Copy construct.
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition:
IOobject.H:187
Foam::IOobject::NO_READ
@ NO_READ
Definition:
IOobject.H:178
Foam::IOobject::MUST_READ_IF_MODIFIED
@ MUST_READ_IF_MODIFIED
Definition:
IOobject.H:180
Foam::IOobject::MUST_READ
@ MUST_READ
Definition:
IOobject.H:179
Foam::MRFZoneList
List container for MRF zomes.
Definition:
MRFZoneList.H:61
Foam::RASModels::kEpsilonLopesdaCosta::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition:
kEpsilonLopesdaCosta.C:380
Foam::TimePaths::constant
const word & constant() const
Return constant name.
Definition:
TimePathsI.H:96
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition:
fvMesh.H:91
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition:
fvMesh.H:290
Foam::regIOobject::read
virtual bool read()
Read object.
Definition:
regIOobjectRead.C:193
Foam::word
A class for handling words, derived from Foam::string.
Definition:
word.H:68
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
fvMesh.H
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:372
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:53
src
finiteVolume
cfdTools
general
MRF
IOMRFZoneList.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.