chemistryReader.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) 2011-2016 OpenFOAM Foundation
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::chemistryReader
26 
27 Description
28  Abstract class for reading chemistry
29 
30 SourceFiles
31  chemistryReader.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef chemistryReader_H
36 #define chemistryReader_H
37 
38 #include "typeInfo.H"
39 #include "runTimeSelectionTables.H"
40 #include "Reaction.H"
41 #include "ReactionList.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class chemistryReader Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class ThermoType>
53 class chemistryReader
54 {
55  // Private Member Functions
56 
57  //- Disallow default bitwise copy construct
59 
60  //- Disallow default bitwise assignment
61  void operator=(const chemistryReader&);
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("chemistryReader");
68 
69  //- The type of thermo package the reader was instantiated for
70  typedef ThermoType thermoType;
71 
72 
73  // Constructors
74 
75  //- Construct null
77  {}
78 
79 
80  // Declare run-time constructor selection table
81 
83  (
84  autoPtr,
86  dictionary,
87  (
88  const dictionary& thermoDict,
90  ),
91  (thermoDict, species)
92  );
93 
94 
95  // Selectors
96 
97  //- Select constructed from dictionary
99  (
100  const dictionary& thermoDict,
101  speciesTable& species
102  );
103 
104 
105  //- Destructor
106  virtual ~chemistryReader()
107  {}
108 
109 
110  // Member Functions
111 
112  //- Return access to the list of species
113  virtual const speciesTable& species() const = 0;
114 
115  //- Return access to the thermo packages
116  virtual const HashPtrTable<ThermoType>& speciesThermo() const = 0;
117 
118  //- Return access to the list of reactions
119  virtual const ReactionList<ThermoType>& reactions() const = 0;
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #ifdef NoRepository
130  #include "chemistryReader.C"
131 #endif
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
137 #define makeChemistryReader(Thermo) \
138  defineTemplateTypeNameAndDebug(chemistryReader<Thermo>, 0); \
139  defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary)
140 
142 #define makeChemistryReaderType(Reader, Thermo) \
143  defineNamedTemplateTypeNameAndDebug(Reader<Thermo>, 0); \
144  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader<Thermo>> \
145  add##Reader##Thermo##ConstructorToTable_
146 
147 
148 // for non-templated chemistry readers
149 #define addChemistryReaderType(Reader, Thermo) \
150  defineTypeNameAndDebug(Reader, 0); \
151  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader> \
152  add##Reader##Thermo##ConstructorToTable_
153 
154 
155 // for templated chemistry readers
156 #define addTemplateChemistryReaderType(Reader, Thermo) \
157  defineNamedTemplateTypeNameAndDebug(Reader, 0); \
158  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader> \
159  add##Reader##Thermo##ConstructorToTable_
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
ThermoType thermoType
The type of thermo package the reader was instantiated for.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual const speciesTable & species() const =0
Return access to the list of species.
virtual const HashPtrTable< ThermoType > & speciesThermo() const =0
Return access to the thermo packages.
chemistryReader()
Construct null.
TypeName("chemistryReader")
Runtime type information.
virtual const ReactionList< ThermoType > & reactions() const =0
Return access to the list of reactions.
declareRunTimeSelectionTable(autoPtr, chemistryReader, dictionary,(const dictionary &thermoDict, speciesTable &species),(thermoDict, species))
static autoPtr< chemistryReader > New(const dictionary &thermoDict, speciesTable &species)
Select constructed from dictionary.
List of templated reactions.
Definition: ReactionList.H:54
A wordList with hashed indices for faster lookup by name.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Macros to ease declaration of run-time selection tables.
Abstract class for reading chemistry.
Namespace for OpenFOAM.
virtual ~chemistryReader()
Destructor.