filmSubModelBase.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 | Copyright (C) 2011-2016 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 "filmSubModelBase.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 namespace regionModels
33 {
34 namespace surfaceFilmModels
35 {
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 :
41  subModelBase(owner.outputProperties()),
42  owner_(owner)
43 {}
44 
45 
47 (
48  surfaceFilmModel& owner,
49  const dictionary& dict,
50  const word& baseName,
51  const word& modelType,
52  const word& dictExt
53 )
54 :
56  (
57  owner.outputProperties(),
58  dict,
59  baseName,
60  modelType,
61  dictExt
62  ),
63  owner_(owner)
64 {}
65 
66 
68 (
69  const word& modelName,
70  surfaceFilmModel& owner,
71  const dictionary& dict,
72  const word& baseName,
73  const word& modelType
74 )
75 :
77  (
78  modelName,
79  owner.outputProperties(),
80  dict,
81  baseName,
82  modelType
83  ),
84  owner_(owner)
85 {}
86 
87 
88 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
89 
91 {}
92 
93 
94 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
95 
97 {
98  return active() && owner_.time().writeTime();
99 }
100 
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 } // End namespace surfaceFilmModels
105 } // End namespace regionModels
106 } // End namespace Foam
107 
108 // ************************************************************************* //
filmSubModelBase(surfaceFilmModel &owner)
Construct null.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const Time & time() const
Return the reference to the time database.
Definition: regionModelI.H:37
subModelBase(dictionary &properties)
Construct null.
Definition: subModelBase.C:38
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
surfaceFilmModel & owner_
Reference to the owner surface film model.
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
bool writeTime() const
Return true if this is a write time.
Definition: TimeStateI.H:65
const word & modelType() const
Return const access to the sub-model type.
Definition: subModelBase.C:122
A class for handling words, derived from string.
Definition: word.H:59
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
Definition: regionModelI.H:110
Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read ...
Definition: subModelBase.H:51
virtual bool writeTime() const
Flag to indicate when to write a property.
virtual bool active() const
Return the model &#39;active&#39; status - default active = true.
Definition: subModelBase.C:154
Namespace for OpenFOAM.
const word & baseName() const
Return const access to the base name of the sub-model.
Definition: subModelBase.C:116