All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
chemistryReader.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 public:
60 
61  //- Runtime type information
62  TypeName("chemistryReader");
63 
64  //- The type of thermo package the reader was instantiated for
65  typedef ThermoType thermoType;
66 
67 
68  // Constructors
69 
70  //- Construct null
72  {}
73 
74  //- Disallow default bitwise copy construction
75  chemistryReader(const chemistryReader&) = delete;
76 
77 
78  // Declare run-time constructor selection table
79 
81  (
82  autoPtr,
84  dictionary,
85  (
86  const dictionary& thermoDict,
88  ),
89  (thermoDict, species)
90  );
91 
92 
93  // Selectors
94 
95  //- Select constructed from dictionary
97  (
98  const dictionary& thermoDict,
99  speciesTable& species
100  );
101 
102 
103  //- Destructor
104  virtual ~chemistryReader()
105  {}
106 
107 
108  // Member Functions
109 
110  //- Return access to the list of species
111  virtual const speciesTable& species() const = 0;
112 
113  //- Table of species composition
114  virtual const speciesCompositionTable& specieComposition() const = 0;
115 
116  //- Return access to the thermo packages
117  virtual const HashPtrTable<ThermoType>& speciesThermo() const = 0;
118 
119  //- Return access to the list of reactions
120  virtual const ReactionList<ThermoType>& reactions() const = 0;
121 
122 
123  // Member Operators
124 
125  //- Disallow default bitwise assignment
126  void operator=(const chemistryReader&) = delete;
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:158
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))
void operator=(const chemistryReader &)=delete
Disallow default bitwise assignment.
HashTable< List< specieElement > > speciesCompositionTable
An STL-conforming hash table.
Definition: HashTable.H:61
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.