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-2026 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  );
77 
78  //- Construct from owner cloud with name
80  (
81  const word& modelName,
83  const dictionary& dict,
84  const word& baseName,
85  const word& modelType
86  );
87 
88  //- Copy constructor
90 
91 
92  //- Destructor
93  virtual ~CloudSubModelBase();
94 
95  //- Type of cloud this model was instantiated for
96  typedef CloudType cloudType;
97 
98 
99  // Member Functions
100 
101  // Access
102 
103  //- Return const access to the owner cloud
104  const CloudType& owner() const;
105 
106  //- Flag to indicate when to write a property
107  virtual bool writeTime() const;
108 
109 
110  // Edit
111 
112  //- Return non-const access to the owner cloud for manipulation
113  CloudType& owner();
114 
115 
116  // I-O
117 
118  //- Write
119  virtual void write(Ostream& os) const;
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #ifdef NoRepository
130  #include "CloudSubModelBase.C"
131 #endif
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Base class for cloud sub-models.
virtual void write(Ostream &os) const
Write.
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.
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
virtual bool writeTime() const
Flag to indicate when to write a property.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read ...
Definition: subModelBase.H:52
const word & baseName() const
Return const access to the base name of the sub-model.
Definition: subModelBase.C:115
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:109
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:103
const word & modelType() const
Return const access to the sub-model type.
Definition: subModelBase.C:121
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.