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-2020 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  const word& dictExt
46 )
47 :
49  (
50  owner.outputProperties(),
51  dict,
52  baseName,
53  modelType,
54  dictExt
55  ),
56  owner_(owner)
57 {}
58 
59 
60 template<class CloudType>
62 (
63  const word& modelName,
64  CloudType& owner,
65  const dictionary& dict,
66  const word& baseName,
67  const word& modelType
68 )
69 :
71  (
72  modelName,
73  owner.outputProperties(),
74  dict,
75  baseName,
76  modelType
77  ),
78  owner_(owner)
79 {}
80 
81 
82 template<class CloudType>
84 (
86 )
87 :
88  subModelBase(smb),
89  owner_(smb.owner_)
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
94 
95 template<class CloudType>
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
102 template<class CloudType>
104 {
105  return owner_;
106 }
107 
108 
109 template<class CloudType>
111 {
112  return owner_;
113 }
114 
115 
116 template<class CloudType>
118 {
119  return
120  owner_.solution().transient()
121  && owner_.db().time().writeTime();
122 }
123 
124 
125 template<class CloudType>
127 {
128  writeEntry(os, "owner", owner_.name());
130 }
131 
132 
133 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
virtual ~CloudSubModelBase()
Destructor.
Base class for cloud sub-models.
virtual void write(Ostream &os) const
Write.
virtual bool writeTime() const
Flag to indicate when to write a property.
const CloudType & owner() const
Return const access to the owner cloud.
A class for handling words, derived from string.
Definition: word.H:59
virtual const fileName & name() const
Return the name of the stream.
Definition: IOstream.H:294
CloudType & owner_
Reference to the cloud.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read ...
Definition: subModelBase.H:51
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75