CloudSubModelBase.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) 2011-2026 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 "CloudSubModelBase.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class CloudType>
32 :
33  subModelBase(owner.outputProperties()),
34  owner_(owner)
35 {}
36 
37 
38 template<class CloudType>
40 (
41  CloudType& owner,
42  const dictionary& dict,
43  const word& baseName,
44  const word& modelType
45 )
46 :
48  (
49  owner.outputProperties(),
50  dict,
51  baseName,
52  modelType
53  ),
54  owner_(owner)
55 {}
56 
57 
58 template<class CloudType>
60 (
61  const word& modelName,
62  CloudType& owner,
63  const dictionary& dict,
64  const word& baseName,
65  const word& modelType
66 )
67 :
69  (
70  modelName,
71  owner.outputProperties(),
72  dict,
73  baseName,
74  modelType
75  ),
76  owner_(owner)
77 {}
78 
79 
80 template<class CloudType>
82 (
84 )
85 :
86  subModelBase(smb),
87  owner_(smb.owner_)
88 {}
89 
90 
91 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
92 
93 template<class CloudType>
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
100 template<class CloudType>
102 {
103  return owner_;
104 }
105 
106 
107 template<class CloudType>
109 {
110  return owner_;
111 }
112 
113 
114 template<class CloudType>
116 {
117  return
118  owner_.solution().transient()
119  && owner_.time().writeTime();
120 }
121 
122 
123 template<class CloudType>
125 {
126  writeEntry(os, "owner", owner_.name());
128 }
129 
130 
131 // ************************************************************************* //
Base class for cloud sub-models.
virtual void write(Ostream &os) const
Write.
const CloudType & owner() const
Return const access to the owner cloud.
virtual ~CloudSubModelBase()
Destructor.
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
virtual bool writeTime() const
Flag to indicate when to write a property.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
virtual const fileName & name() const
Return the name of the stream.
Definition: IOstream.H:297
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read ...
Definition: subModelBase.H:52
virtual void write(Ostream &os) const
Write.
Definition: subModelBase.C:157
A class for handling words, derived from string.
Definition: word.H:63
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
dictionary dict