Loading...
Searching...
No Matches
CloudSubModelBase.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
29#include "CloudSubModelBase.H"
30#include "cloud.H"
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
34template<class CloudType>
36:
37 subModelBase(owner.outputProperties()),
39{
40 this->log = owner_.solution().log();
41}
42
43
44template<class CloudType>
46(
47 CloudType& owner,
48 const dictionary& dict,
49 const word& baseName,
50 const word& modelType,
51 const word& dictExt
52)
53:
55 (
56 owner.outputProperties(),
57 dict,
58 baseName,
59 modelType,
60 dictExt
61 ),
63{
64 this->log = owner_.solution().log();
65}
66
67
68template<class CloudType>
70(
71 const word& modelName,
73 const dictionary& dict,
74 const word& baseName,
75 const word& modelType
76)
77:
79 (
81 owner.outputProperties(),
82 dict,
85 ),
87{
88 this->log = owner_.solution().log();
89}
90
91
92template<class CloudType>
94(
96)
97:
98 subModelBase(smb),
99 owner_(smb.owner_)
100{
101 this->log = owner_.solution().log();
102}
103
104
105// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
106
107template<class CloudType>
109{
110 return owner_;
111}
112
113
114template<class CloudType>
116{
117 return owner_;
119
120
121template<class CloudType>
124 return
126 && owner_.solution().transient()
127 && owner_.db().time().writeTime();
129
130
131template<class CloudType>
133{
134 if (!modelName_.empty())
135 {
136 return cloud::prefix/owner_.name()/modelName_;
138
139 return cloud::prefix/owner_.name()/baseName_;
140}
141
142
143template<class CloudType>
145{
146 this->log = owner_.solution().log();
147}
148
150template<class CloudType>
152{
153 os.writeEntry("owner", owner_.name());
154
156}
157
158
159// ************************************************************************* //
Base class for cloud sub-models.
virtual fileName localPath() const
Output directory.
virtual void write(Ostream &os) const
Write to os.
CloudType & owner_
Reference to the cloud.
const CloudType & owner() const
Return const access to the owner cloud.
virtual void info()
Write to info.
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
virtual bool writeTime() const
Flag to indicate when to write a property.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
static const word prefix
The prefix to local: lagrangian.
Definition cloud.H:79
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A class for handling file names.
Definition fileName.H:75
Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read ...
const word modelName_
Name of the sub-model.
const word & baseName() const
Return const access to the base name of the sub-model.
virtual void write(Ostream &os) const
Write.
const dictionary & dict() const
Return const access to the cloud dictionary.
const word & modelName() const
Return const access to the name of the sub-model.
const word & modelType() const
Return const access to the sub-model type.
virtual bool active() const
Return the model 'active' status - default active = true.
bool log
Flag to write log into Info.
subModelBase(dictionary &properties)
Construct null.
A class for handling words, derived from Foam::string.
Definition word.H:66
OBJstream os(runTime.globalPath()/outputName)
DSMCCloud< dsmcParcel > CloudType
dictionary dict