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 "specieElement.H"
40 #include "Reaction.H"
41 #include "ReactionList.H"
42 #include "runTimeSelectionTables.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
50 
51 
52 /*---------------------------------------------------------------------------*\
53  Class chemistryReader Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class ThermoType>
57 class chemistryReader
58 {
59  // Private Member Functions
60 
61  //- Disallow default bitwise copy construct
63 
64  //- Disallow default bitwise assignment
65  void operator=(const chemistryReader&);
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("chemistryReader");
72 
73  //- The type of thermo package the reader was instantiated for
74  typedef ThermoType thermoType;
75 
76 
77  // Constructors
78 
79  //- Construct null
81  {}
82 
83 
84  // Declare run-time constructor selection table
85 
87  (
88  autoPtr,
90  dictionary,
91  (
92  const dictionary& thermoDict,
94  ),
95  (thermoDict, species)
96  );
97 
98 
99  // Selectors
100 
101  //- Select constructed from dictionary
103  (
104  const dictionary& thermoDict,
105  speciesTable& species
106  );
107 
108 
109  //- Destructor
110  virtual ~chemistryReader()
111  {}
112 
113 
114  // Member Functions
115 
116  //- Return access to the list of species
117  virtual const speciesTable& species() const = 0;
118 
119  //- Table of species composition
120  virtual const speciesCompositionTable& specieComposition() const = 0;
121 
122  //- Return access to the thermo packages
123  virtual const HashPtrTable<ThermoType>& speciesThermo() const = 0;
124 
125  //- Return access to the list of reactions
126  virtual const ReactionList<ThermoType>& reactions() const = 0;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #ifdef NoRepository
137  #include "chemistryReader.C"
138 #endif
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
144 #define makeChemistryReader(Thermo) \
145  defineTemplateTypeNameAndDebug(chemistryReader<Thermo>, 0); \
146  defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary)
147 
149 #define makeChemistryReaderType(Reader, Thermo) \
150  defineNamedTemplateTypeNameAndDebug(Reader<Thermo>, 0); \
151  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader<Thermo>> \
152  add##Reader##Thermo##ConstructorToTable_
153 
154 
155 // for non-templated chemistry readers
156 #define addChemistryReaderType(Reader, Thermo) \
157  defineTypeNameAndDebug(Reader, 0); \
158  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader> \
159  add##Reader##Thermo##ConstructorToTable_
160 
161 
162 // for templated chemistry readers
163 #define addTemplateChemistryReaderType(Reader, Thermo) \
164  defineNamedTemplateTypeNameAndDebug(Reader, 0); \
165  chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader> \
166  add##Reader##Thermo##ConstructorToTable_
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
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.
virtual const speciesCompositionTable & specieComposition() const =0
Table of species composition.
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))
HashTable< List< specieElement > > speciesCompositionTable
An STL-conforming hash table.
Definition: HashTable.H:62
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:52
Macros to ease declaration of run-time selection tables.
Abstract class for reading chemistry.
Namespace for OpenFOAM.
virtual ~chemistryReader()
Destructor.