InflowBoundaryModel.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-2022 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::InflowBoundaryModel
26 
27 
28 Description
29  Templated inflow boundary model class
30 
31 SourceFiles
32  InflowBoundaryModel.C
33  InflowBoundaryModelNew.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef InflowBoundaryModel_H
38 #define InflowBoundaryModel_H
39 
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class InflowBoundaryModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
55 {
56  // Private Data
57 
58  //- The cloud dictionary
59  const dictionary& dict_;
60 
61  // Reference to the owner cloud class
62  CloudType& owner_;
63 
64  //- The coefficients dictionary
65  const dictionary coeffDict_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("InflowBoundaryModel");
72 
73  //- Declare runtime constructor selection table
75  (
76  autoPtr,
78  dictionary,
79  (
80  const dictionary& dict,
82  ),
83  (dict, owner)
84  );
85 
86 
87  // Constructors
88 
89  //- Construct null from owner
91 
92  //- Construct from dictionary
94  (
95  const dictionary& dict,
97  const word& type
98  );
99 
100 
101  //- Destructor
102  virtual ~InflowBoundaryModel();
103 
104 
105  //- Selector
107  (
108  const dictionary& dict,
110  );
111 
112  // Member Functions
113 
114  // Access
115 
116  //- Return const access the owner cloud object
117  inline const CloudType& owner() const;
118 
119  //- Return non-const access the owner cloud object for manipulation
120  inline CloudType& owner();
121 
122  //- Return the owner cloud dictionary
123  inline const dictionary& dict() const;
124 
125  //- Return the coefficients dictionary
126  inline const dictionary& coeffDict() const;
127 
128 
129  // Mapping
130 
131  //- Update following mesh change
132  virtual void topoChange();
133 
134 
135  //- Introduce particles
136  virtual void inflow() = 0;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #define makeInflowBoundaryModel(CloudType) \
147  \
148  defineNamedTemplateTypeNameAndDebug(InflowBoundaryModel<CloudType>, 0); \
149  \
150  defineTemplateRunTimeSelectionTable \
151  ( \
152  InflowBoundaryModel<CloudType>, \
153  dictionary \
154  );
155 
156 
157 #define makeInflowBoundaryModelType(SS, CloudType) \
158  \
159  defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
160  \
161  InflowBoundaryModel<CloudType>:: \
162  adddictionaryConstructorToTable<SS<CloudType>> \
163  add##SS##CloudType##ConstructorToTable_;
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #ifdef NoRepository
169  #include "InflowBoundaryModel.C"
170 #endif
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
Templated inflow boundary model class.
virtual void topoChange()
Update following mesh change.
TypeName("InflowBoundaryModel")
Runtime type information.
InflowBoundaryModel(CloudType &owner)
Construct null from owner.
virtual ~InflowBoundaryModel()
Destructor.
declareRunTimeSelectionTable(autoPtr, InflowBoundaryModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
const dictionary & coeffDict() const
Return the coefficients dictionary.
virtual void inflow()=0
Introduce particles.
const dictionary & dict() const
Return the owner cloud dictionary.
const CloudType & owner() const
Return const access the owner cloud object.
static autoPtr< InflowBoundaryModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
Macros to ease declaration of run-time selection tables.