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();
97
98 //- Type of cloud this model was instantiated for
99 typedef CloudType cloudType;
100
101
102 // Member Functions
103
104 // Access
105
106 //- Return const access to the owner cloud
107 const CloudType& owner() const;
108
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
125 virtual void write(Ostream& os) const;
126};
127
128
129// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130
131} // End namespace Foam
132
133// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
135#ifdef NoRepository
136 #include "CloudSubModelBase.C"
137#endif
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141#endif
142
143// ************************************************************************* //
Base class for cloud sub-models.
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 ~CloudSubModelBase()
Destructor.
virtual bool writeTime() const
Flag to indicate when to write a property.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read ...
Definition: subModelBase.H:55
const word & baseName() const
Return const access to the base name of the sub-model.
Definition: subModelBase.C:119
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
const word & modelType() const
Return const access to the sub-model type.
Definition: subModelBase.C:125
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()