OpenFOAM
8
The OpenFOAM Foundation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
IOporosityModelList.C
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration | Website: https://openfoam.org
5
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
11
OpenFOAM is free software: you can redistribute it and/or modify it
12
under the terms of the GNU General Public License as published by
13
the Free Software Foundation, either version 3 of the License, or
14
(at your option) any later version.
15
16
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19
for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24
\*---------------------------------------------------------------------------*/
25
26
#include "
IOporosityModelList.H
"
27
#include "
fvMesh.H
"
28
#include "
Time.H
"
29
30
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
31
32
Foam::IOobject
Foam::IOporosityModelList::createIOobject
33
(
34
const
fvMesh& mesh
35
)
const
36
{
37
IOobject
io
38
(
39
"porosityProperties"
,
40
mesh.time().constant(),
41
mesh
,
42
IOobject::MUST_READ
,
43
IOobject::NO_WRITE
44
);
45
46
if
(io.typeHeaderOk<
IOdictionary
>(
true
))
47
{
48
Info
<<
"Creating porosity model list from "
<< io.name() <<
nl
<<
endl
;
49
50
io.readOpt() =
IOobject::MUST_READ_IF_MODIFIED
;
51
return
io;
52
}
53
else
54
{
55
Info
<<
"No porosity models present"
<<
nl
<<
endl
;
56
57
io.readOpt() =
IOobject::NO_READ
;
58
return
io;
59
}
60
}
61
62
63
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
64
65
Foam::IOporosityModelList::IOporosityModelList
66
(
67
const
fvMesh
& mesh
68
)
69
:
70
IOdictionary
(createIOobject(mesh)),
71
porosityModelList
(mesh, *
this
)
72
{}
73
74
75
bool
Foam::IOporosityModelList::read
()
76
{
77
if
(
regIOobject::read
())
78
{
79
porosityModelList::read
(*
this
);
80
return
true
;
81
}
82
else
83
{
84
return
false
;
85
}
86
}
87
88
89
// ************************************************************************* //
Foam::IOporosityModelList::IOporosityModelList
IOporosityModelList(const fvMesh &mesh)
Construct from mesh.
Definition:
IOporosityModelList.C:66
Foam::porosityModelList::read
bool read(const dictionary &dict)
Read dictionary.
Definition:
porosityModelList.C:101
Foam::regIOobject::read
virtual bool read()
Read object.
Definition:
regIOobjectRead.C:205
Time.H
Foam::IOobject::MUST_READ
Definition:
IOobject.H:112
Foam::IOobject::IOobject
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
Definition:
IOobject.C:177
fvMesh.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:251
Foam::porosityModelList::porosityModelList
porosityModelList(const fvMesh &mesh, const dictionary &dict)
Definition:
porosityModelList.C:32
Foam::IOobject::NO_WRITE
Definition:
IOobject.H:122
Foam::IOobject::MUST_READ_IF_MODIFIED
Definition:
IOobject.H:113
Foam::IOobject::NO_READ
Definition:
IOobject.H:115
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:18
Foam::IOporosityModelList::read
virtual bool read()
Read dictionary.
Definition:
IOporosityModelList.C:75
IOporosityModelList.H
Foam::nl
static const char nl
Definition:
Ostream.H:260
Foam::IOdictionary::IOdictionary
IOdictionary(const IOobject &)
Construct given an IOobject.
Definition:
IOdictionary.C:30
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition:
fvMesh.H:78
Foam::Info
messageStream Info
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition:
IOobject.H:92
src
finiteVolume
cfdTools
general
porosityModel
porosityModel
IOporosityModelList.C
Generated by
1.8.13