FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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 <OpenFOAM/typeInfo.H>
40 #include <specie/Reaction.H>
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class chemistryReader Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class ThermoType>
53 {
54  // Private Member Functions
55 
56  //- Disallow default bitwise copy construct
58 
59  //- Disallow default bitwise assignment
60  void operator=(const chemistryReader&);
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("chemistryReader");
67 
68  //- The type of thermo package the reader was instantiated for
70 
71 
72  // Constructors
73 
74  //- Construct null
76  {}
77 
78 
79  // Declare run-time constructor selection table
80 
82  (
83  autoPtr,
85  dictionary,
86  (
87  const dictionary& thermoDict
88  ),
89  (thermoDict)
90  );
91 
92 
93  // Selectors
94 
95  //- Select constructed from dictionary
96  static autoPtr<chemistryReader> New(const dictionary& thermoDict);
97 
98 
99  //- Destructor
101  {}
102 
103 
104  // Member Functions
105 
106  virtual const speciesTable& species() const = 0;
107 
108  virtual const HashPtrTable<ThermoType>& speciesThermo() const = 0;
109 
110  virtual const SLPtrList<Reaction<ThermoType> >& reactions() const = 0;
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #define makeChemistryReader(Thermo) \
121  \
122 defineTemplateTypeNameAndDebug \
123 ( \
124  chemistryReader<Thermo>, \
125  0 \
126 ); \
127  \
128 defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary);
129 
130 
131 #define makeChemistryReaderType(SS, Thermo) \
132  \
133  defineNamedTemplateTypeNameAndDebug(SS<Thermo>, 0); \
134  \
135  chemistryReader<Thermo>::adddictionaryConstructorToTable<SS<Thermo> > \
136  add##SS##Thermo##ConstructorToTable_;
137 
138 
139 #define addChemistryReaderType(SS, Thermo) \
140  \
141  defineNamedTemplateTypeNameAndDebug(SS, 0); \
142  \
143  chemistryReader<Thermo>::adddictionaryConstructorToTable<SS> \
144  add##SS##Thermo##ConstructorToTable_;
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #ifdef NoRepository
150 # include "chemistryReader.C"
151 #endif
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************ vim: set sw=4 sts=4 et: ************************ //