FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

InflowBoundaryModel.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2009-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::InflowBoundaryModel
00026 
00027 
00028 Description
00029     Templated inflow boundary model class
00030 
00031 SourceFiles
00032     InflowBoundaryModel.C
00033     NewInflowBoundaryModel.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef InflowBoundaryModel_H
00038 #define InflowBoundaryModel_H
00039 
00040 #include <OpenFOAM/IOdictionary.H>
00041 #include <OpenFOAM/autoPtr.H>
00042 #include <OpenFOAM/runTimeSelectionTables.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                      Class InflowBoundaryModel Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 template<class CloudType>
00054 class InflowBoundaryModel
00055 {
00056     // Private data
00057 
00058         //- The cloud dictionary
00059         const dictionary& dict_;
00060 
00061         // Reference to the owner cloud class
00062         CloudType& owner_;
00063 
00064         //- The coefficients dictionary
00065         const dictionary coeffDict_;
00066 
00067 
00068 public:
00069 
00070     //- Runtime type information
00071     TypeName("InflowBoundaryModel");
00072 
00073     //- Declare runtime constructor selection table
00074     declareRunTimeSelectionTable
00075     (
00076         autoPtr,
00077         InflowBoundaryModel,
00078         dictionary,
00079         (
00080             const dictionary& dict,
00081             CloudType& owner
00082         ),
00083         (dict, owner)
00084     );
00085 
00086 
00087     // Constructors
00088 
00089         //- Construct from dictionary
00090         InflowBoundaryModel
00091         (
00092             const dictionary& dict,
00093             CloudType& owner,
00094             const word& type
00095         );
00096 
00097 
00098     //- Destructor
00099     virtual ~InflowBoundaryModel();
00100 
00101 
00102     //- Selector
00103     static autoPtr<InflowBoundaryModel<CloudType> > New
00104     (
00105         const dictionary& dict,
00106         CloudType& owner
00107     );
00108 
00109 
00110     // Access
00111 
00112         //- Return const access the owner cloud object
00113         inline const CloudType& owner() const;
00114 
00115         //- Return non-const access the owner cloud object for manipulation
00116         inline CloudType& owner();
00117 
00118         //- Return the owner cloud dictionary
00119         inline const dictionary& dict() const;
00120 
00121         //- Return the coefficients dictionary
00122         inline const dictionary& coeffDict() const;
00123 
00124     //- Introduce particles
00125     virtual void inflow() = 0;
00126 };
00127 
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 } // End namespace Foam
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 #define makeInflowBoundaryModel(CloudType)                                    \
00136                                                                               \
00137     defineNamedTemplateTypeNameAndDebug(InflowBoundaryModel<CloudType>, 0);   \
00138                                                                               \
00139     defineTemplateRunTimeSelectionTable                                       \
00140     (                                                                         \
00141         InflowBoundaryModel<CloudType>,                                       \
00142         dictionary                                                            \
00143     );
00144 
00145 
00146 #define makeInflowBoundaryModelType(SS, CloudType, ParcelType)                \
00147                                                                               \
00148     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
00149                                                                               \
00150     InflowBoundaryModel<CloudType<ParcelType> >::                             \
00151         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
00152             add##SS##CloudType##ParcelType##ConstructorToTable_;
00153 
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 #ifdef NoRepository
00158 #   include "InflowBoundaryModel.C"
00159 #endif
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 #endif
00164 
00165 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines