All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CloudSubModelBase.H
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 Class
25  Foam::CloudSubModelBase
26 
27 Description
28  Base class for cloud sub-models
29 
30 SourceFiles
31  CloudSubModelBase.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef CloudSubModelBase_H
36 #define CloudSubModelBase_H
37 
38 #include "subModelBase.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class CloudSubModelBase Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class CloudType>
51 :
52  public subModelBase
53 {
54 protected:
55 
56  // Protected Data
57 
58  //- Reference to the cloud
60 
61 
62 public:
63 
64  // Constructors
65 
66  //- Construct null from owner cloud
68 
69  //- Construct from owner cloud without name
71  (
73  const dictionary& dict,
74  const word& baseName,
75  const word& modelType,
76  const word& dictExt = "Coeffs"
77  );
78 
79  //- Construct from owner cloud with name
81  (
82  const word& modelName,
84  const dictionary& dict,
85  const word& baseName,
86  const word& modelType
87  );
88 
89  //- Copy constructor
91 
92 
93  //- Destructor
94  virtual ~CloudSubModelBase();
95 
96  //- Type of cloud this model was instantiated for
97  typedef CloudType cloudType;
98 
99 
100  // Member Functions
101 
102  // Access
103 
104  //- Return const access to the owner cloud
105  const CloudType& owner() const;
106 
107  //- Flag to indicate when to write a property
108  virtual bool writeTime() const;
109 
110 
111  // Edit
112 
113  //- Return non-const access to the owner cloud for manipulation
114  CloudType& owner();
115 
116 
117  // I-O
118 
119  //- Write
120  virtual void write(Ostream& os) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #ifdef NoRepository
131  #include "CloudSubModelBase.C"
132 #endif
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
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 word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const CloudType & owner() const
Return const access to the owner cloud.
A class for handling words, derived from string.
Definition: word.H:59
CloudType & owner_
Reference to the cloud.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
const word & modelType() const
Return const access to the sub-model type.
Definition: subModelBase.C:122
CloudType cloudType
Type of cloud this model was instantiated for.
Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read ...
Definition: subModelBase.H:51
const word & baseName() const
Return const access to the base name of the sub-model.
Definition: subModelBase.C:116
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Namespace for OpenFOAM.