OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

chemistryReader.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) 1991-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::chemistryReader
00027 
00028 Description
00029     Abstract class for reading chemistry
00030 
00031 SourceFiles
00032     chemistryReader.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef chemistryReader_H
00037 #define chemistryReader_H
00038 
00039 #include "typeInfo.H"
00040 #include "runTimeSelectionTables.H"
00041 #include "Reaction.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                       Class chemistryReader Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 template<class ThermoType>
00053 class chemistryReader
00054 {
00055     // Private Member Functions
00056 
00057         //- Disallow default bitwise copy construct
00058         chemistryReader(const chemistryReader&);
00059 
00060         //- Disallow default bitwise assignment
00061         void operator=(const chemistryReader&);
00062 
00063 
00064 public:
00065 
00066     //- Runtime type information
00067     TypeName("chemistryReader");
00068 
00069     //- The type of thermo package the reader was instantiated for
00070     typedef ThermoType thermoType;
00071 
00072 
00073     // Constructors
00074 
00075         //- Construct null
00076         chemistryReader()
00077         {}
00078 
00079 
00080     // Declare run-time constructor selection table
00081 
00082         declareRunTimeSelectionTable
00083         (
00084             autoPtr,
00085             chemistryReader,
00086             dictionary,
00087             (
00088                 const dictionary& thermoDict
00089             ),
00090             (thermoDict)
00091         );
00092 
00093 
00094     // Selectors
00095 
00096         //- Select constructed from dictionary
00097         static autoPtr<chemistryReader> New(const dictionary& thermoDict);
00098 
00099 
00100     //- Destructor
00101     virtual ~chemistryReader()
00102     {}
00103 
00104 
00105     // Member Functions
00106 
00107         virtual const speciesTable& species() const = 0;
00108 
00109         virtual const HashPtrTable<ThermoType>& speciesThermo() const = 0;
00110 
00111         virtual const SLPtrList<Reaction<ThermoType> >& reactions() const = 0;
00112 };
00113 
00114 
00115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00116 
00117 } // End namespace Foam
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 #define makeChemistryReader(Thermo)                                           \
00122                                                                               \
00123 defineTemplateTypeNameAndDebug                                                \
00124 (                                                                             \
00125     chemistryReader<Thermo>,                                                  \
00126     0                                                                         \
00127 );                                                                            \
00128                                                                               \
00129 defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary);
00130 
00131 
00132 #define makeChemistryReaderType(SS, Thermo)                                   \
00133                                                                               \
00134     defineNamedTemplateTypeNameAndDebug(SS<Thermo>, 0);                       \
00135                                                                               \
00136     chemistryReader<Thermo>::adddictionaryConstructorToTable<SS<Thermo> >     \
00137         add##SS##Thermo##ConstructorToTable_;
00138 
00139 
00140 #define addChemistryReaderType(SS, Thermo)                                    \
00141                                                                               \
00142     defineNamedTemplateTypeNameAndDebug(SS, 0);                               \
00143                                                                               \
00144     chemistryReader<Thermo>::adddictionaryConstructorToTable<SS>              \
00145         add##SS##Thermo##ConstructorToTable_;
00146 
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 #ifdef NoRepository
00151 #   include "chemistryReader.C"
00152 #endif
00153 
00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00155 
00156 #endif
00157 
00158 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd