FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 2009-2010 OpenCFD Ltd.
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  NewInflowBoundaryModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef InflowBoundaryModel_H
38 #define InflowBoundaryModel_H
39 
40 #include <OpenFOAM/IOdictionary.H>
41 #include <OpenFOAM/autoPtr.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,
81  CloudType& owner
82  ),
83  (dict, owner)
84  );
85 
86 
87  // Constructors
88 
89  //- Construct from dictionary
91  (
92  const dictionary& dict,
93  CloudType& owner,
94  const word& type
95  );
96 
97 
98  //- Destructor
99  virtual ~InflowBoundaryModel();
100 
101 
102  //- Selector
104  (
105  const dictionary& dict,
106  CloudType& owner
107  );
108 
109 
110  // Access
111 
112  //- Return const access the owner cloud object
113  inline const CloudType& owner() const;
114 
115  //- Return non-const access the owner cloud object for manipulation
116  inline CloudType& owner();
117 
118  //- Return the owner cloud dictionary
119  inline const dictionary& dict() const;
120 
121  //- Return the coefficients dictionary
122  inline const dictionary& coeffDict() const;
123 
124  //- Introduce particles
125  virtual void inflow() = 0;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #define makeInflowBoundaryModel(CloudType) \
136  \
137  defineNamedTemplateTypeNameAndDebug(InflowBoundaryModel<CloudType>, 0); \
138  \
139  defineTemplateRunTimeSelectionTable \
140  ( \
141  InflowBoundaryModel<CloudType>, \
142  dictionary \
143  );
144 
145 
146 #define makeInflowBoundaryModelType(SS, CloudType, ParcelType) \
147  \
148  defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
149  \
150  InflowBoundaryModel<CloudType<ParcelType> >:: \
151  adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
152  add##SS##CloudType##ParcelType##ConstructorToTable_;
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
158 # include "InflowBoundaryModel.C"
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************ vim: set sw=4 sts=4 et: ************************ //