OpenFOAM
v2406
The open source CFD toolbox
IOporosityModelList.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-2014 OpenFOAM Foundation
9
Copyright (C) 2021 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
\*---------------------------------------------------------------------------*/
28
29
#include "
IOporosityModelList.H
"
30
#include "
fvMesh.H
"
31
#include "
Time.H
"
32
33
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
34
35
Foam::IOobject
Foam::IOporosityModelList::createIOobject
36
(
37
const
fvMesh&
mesh
38
)
const
39
{
40
IOobject
io
41
(
42
"porosityProperties"
,
43
mesh
.time().constant(),
44
mesh
,
45
IOobject::MUST_READ
,
46
IOobject::NO_WRITE
47
);
48
49
if
(
io
.typeHeaderOk<
IOdictionary
>(
true
))
50
{
51
Info
<<
"Creating porosity model list from "
<<
io
.name() <<
nl
<<
endl
;
52
53
io
.readOpt(
IOobject::MUST_READ_IF_MODIFIED
);
54
}
55
else
56
{
57
Info
<<
"No porosity models present"
<<
nl
<<
endl
;
58
59
io
.readOpt(
IOobject::NO_READ
);
60
}
61
62
return
io
;
63
}
64
65
66
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
67
68
Foam::IOporosityModelList::IOporosityModelList
69
(
70
const
fvMesh
&
mesh
71
)
72
:
73
IOdictionary
(createIOobject(
mesh
)),
74
porosityModelList
(
mesh
, *this)
75
{}
76
77
78
bool
Foam::IOporosityModelList::read
()
79
{
80
if
(
regIOobject::read
())
81
{
82
porosityModelList::read
(*
this
);
83
return
true
;
84
}
85
86
return
false
;
87
}
88
89
90
// ************************************************************************* //
Foam::porosityModelList::read
bool read(const dictionary &dict)
Read dictionary.
Definition:
porosityModelList.C:90
Foam::IOdictionary::IOdictionary
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
Definition:
IOdictionary.C:30
Foam::regIOobject::read
virtual bool read()
Read object.
Definition:
regIOobjectRead.C:181
Time.H
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:50
fvMesh.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:531
Foam::IOobjectOption::NO_WRITE
Ignore writing from objectRegistry::writeObject()
Definition:
IOobjectOption.H:86
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition:
IOdictionary.H:50
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
Foam::IOobjectOption::MUST_READ_IF_MODIFIED
Definition:
IOobjectOption.H:71
Foam::IOporosityModelList::read
virtual bool read()
Read dictionary.
Definition:
IOporosityModelList.C:71
Foam::IOobjectOption::MUST_READ
Reading required.
Definition:
IOobjectOption.H:63
IOporosityModelList.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition:
fvMesh.H:78
Foam::IOobject::IOobject
IOobject(const IOobject &)=default
Copy construct.
Foam::porosityModelList
List container for porosity models.
Definition:
porosityModelList.H:53
Foam::IOobjectOption::NO_READ
Nothing to be read.
Definition:
IOobjectOption.H:60
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
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
src
finiteVolume
cfdTools
general
porosityModel
porosityModel
IOporosityModelList.C
Generated by
1.8.14