InflowBoundaryModel.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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::InflowBoundaryModel
28 
29 
30 Description
31  Templated inflow boundary model class
32 
33 SourceFiles
34  InflowBoundaryModel.C
35  InflowBoundaryModelNew.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef InflowBoundaryModel_H
40 #define InflowBoundaryModel_H
41 
42 #include "IOdictionary.H"
43 #include "autoPtr.H"
44 #include "runTimeSelectionTables.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class InflowBoundaryModel Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class CloudType>
56 class InflowBoundaryModel
57 {
58  // Private data
59 
60  //- The cloud dictionary
61  const dictionary& dict_;
62 
63  // Reference to the owner cloud class
64  CloudType& owner_;
65 
66  //- The coefficients dictionary
67  const dictionary coeffDict_;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("InflowBoundaryModel");
74 
75  //- Declare runtime constructor selection table
77  (
78  autoPtr,
80  dictionary,
81  (
82  const dictionary& dict,
84  ),
85  (dict, owner)
86  );
87 
88 
89  // Constructors
90 
91  //- Construct null from owner
93 
94  //- Construct from dictionary
96  (
97  const dictionary& dict,
99  const word& type
100  );
101 
102 
103  //- Destructor
104  virtual ~InflowBoundaryModel();
105 
106 
107  //- Selector
108  static autoPtr<InflowBoundaryModel<CloudType>> New
109  (
110  const dictionary& dict,
112  );
113 
114 
115  // Access
116 
117  //- Return const access the owner cloud object
118  inline const CloudType& owner() const;
119 
120  //- Return non-const access the owner cloud object for manipulation
121  inline CloudType& owner();
122 
123  //- Return the owner cloud dictionary
124  inline const dictionary& dict() const;
125 
126  //- Return the coefficients dictionary
127  inline const dictionary& coeffDict() const;
128 
129  // Mapping
130 
131  //- Remap the particles to the correct cells following mesh change
132  virtual void autoMap(const mapPolyMesh&)
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 // ************************************************************************* //
Foam::InflowBoundaryModel::InflowBoundaryModel
InflowBoundaryModel(CloudType &owner)
Construct null from owner.
Definition: InflowBoundaryModel.C:33
Foam::InflowBoundaryModel::coeffDict
const dictionary & coeffDict() const
Return the coefficients dictionary.
Definition: InflowBoundaryModel.C:86
Foam::InflowBoundaryModel::~InflowBoundaryModel
virtual ~InflowBoundaryModel()
Destructor.
Definition: InflowBoundaryModel.C:58
Foam::InflowBoundaryModel::owner
const CloudType & owner() const
Return const access the owner cloud object.
Definition: InflowBoundaryModel.C:65
Foam::InflowBoundaryModel::TypeName
TypeName("InflowBoundaryModel")
Runtime type information.
Foam::InflowBoundaryModel::dict
const dictionary & dict() const
Return the owner cloud dictionary.
Definition: InflowBoundaryModel.C:79
Foam::CloudType
DSMCCloud< dsmcParcel > CloudType
Definition: makeDSMCParcelBinaryCollisionModels.C:38
Foam::InflowBoundaryModel::New
static autoPtr< InflowBoundaryModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: InflowBoundaryModelNew.C:36
InflowBoundaryModel.C
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::InflowBoundaryModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, InflowBoundaryModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
IOdictionary.H
Foam::InflowBoundaryModel::inflow
virtual void inflow()=0
Introduce particles.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::InflowBoundaryModel::autoMap
virtual void autoMap(const mapPolyMesh &)
Remap the particles to the correct cells following mesh change.
Definition: InflowBoundaryModel.H:131
autoPtr.H