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-------------------------------------------------------------------------------
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::InflowBoundaryModel
28
29
30Description
31 Templated inflow boundary model class
32
33SourceFiles
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"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class InflowBoundaryModel Declaration
53\*---------------------------------------------------------------------------*/
54
55template<class CloudType>
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
70public:
71
72 //- Runtime type information
73 TypeName("InflowBoundaryModel");
74
75 //- Declare runtime constructor selection table
77 (
78 autoPtr,
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
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// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146#define makeInflowBoundaryModel(CloudType) \
147 \
148 defineNamedTemplateTypeNameAndDebug(InflowBoundaryModel<CloudType>, 0); \
149 \
150 defineTemplateRunTimeSelectionTable \
151 ( \
152 InflowBoundaryModel<CloudType>, \
153 dictionary \
154 );
155
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:75
Templated inflow boundary model class.
TypeName("InflowBoundaryModel")
Runtime type information.
virtual void autoMap(const mapPolyMesh &)
Remap the particles to the correct cells following mesh change.
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.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73