Loading...
Searching...
No Matches
CloudSubModelBase.H
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-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::CloudSubModelBase
28
29Description
30 Base class for cloud sub-models
31
32SourceFiles
33 CloudSubModelBase.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef CloudSubModelBase_H
38#define CloudSubModelBase_H
39
40#include "subModelBase.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47/*---------------------------------------------------------------------------*\
48 Class CloudSubModelBase Declaration
49\*---------------------------------------------------------------------------*/
50
51template<class CloudType>
53:
54 public subModelBase
55{
56protected:
57
58 // Protected Data
59
60 //- Reference to the cloud
62
63
64public:
65
66 // Constructors
67
68 //- Construct null from owner cloud
70
71 //- Construct from owner cloud without name
73 (
75 const dictionary& dict,
76 const word& baseName,
77 const word& modelType,
78 const word& dictExt = "Coeffs"
79 );
80
81 //- Construct from owner cloud with name
83 (
84 const word& modelName,
86 const dictionary& dict,
87 const word& baseName,
88 const word& modelType
89 );
90
91 //- Construct as copy
93
94
95 //- Destructor
96 virtual ~CloudSubModelBase() = default;
97
98 //- Type of cloud this model was instantiated for
99 typedef CloudType cloudType;
100
101
102 // Member Functions
104 // Access
105
106 //- Return const access to the owner cloud
107 const CloudType& owner() const;
109 //- Flag to indicate when to write a property
110 virtual bool writeTime() const;
111
112 //- Output directory
113 virtual fileName localPath() const;
114
115
116 // Edit
117
118 //- Return non-const access to the owner cloud for manipulation
119 CloudType& owner();
120
121
122 // I-O
123
124 //- Write to info
125 virtual void info();
126
127 //- Write to os
128 virtual void write(Ostream& os) const;
129};
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134} // End namespace Foam
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138#ifdef NoRepository
139 #include "CloudSubModelBase.C"
140#endif
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144#endif
145
146// ************************************************************************* //
virtual fileName localPath() const
Output directory.
CloudType & owner_
Reference to the cloud.
CloudType cloudType
Type of cloud this model was instantiated for.
const CloudType & owner() const
Return const access to the owner cloud.
virtual void info()
Write to info.
virtual ~CloudSubModelBase()=default
Destructor.
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
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
const word & baseName() const
Return const access to the base name of the sub-model.
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.
subModelBase(dictionary &properties)
Construct null.
A class for handling words, derived from Foam::string.
Definition word.H:66
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
DSMCCloud< dsmcParcel > CloudType
runTime write()