ARTS 2.5.9 (git: 825fa5f2)
partfun.h
Go to the documentation of this file.
1#ifndef partfun_h
2#define partfun_h
3
4#include "auto_partfun.h"
5
6#include "enums.h"
7#include "isotopologues.h"
8#include "matpackI.h"
9
10namespace PartitionFunctions {
11
12namespace detail {
13template <Derivatives d>
15 using Species::Species;
16
17#define deal_with_spec(SPEC) \
18 case Species::SPEC: \
19 return compute##SPEC<d>(T, ir.isotname);
20
21 switch (ir.spec) {
22 case Species::Bath: break;
23 deal_with_spec(Water)
24 deal_with_spec(CarbonDioxide)
25 deal_with_spec(Ozone)
26 deal_with_spec(NitrogenOxide)
27 deal_with_spec(CarbonMonoxide)
28 deal_with_spec(Methane)
29 deal_with_spec(Oxygen)
30 deal_with_spec(NitricOxide)
31 deal_with_spec(SulfurDioxide)
32 deal_with_spec(NitrogenDioxide)
33 deal_with_spec(Ammonia)
34 deal_with_spec(NitricAcid)
35 deal_with_spec(Hydroxyl)
36 deal_with_spec(HydrogenFluoride)
37 deal_with_spec(HydrogenChloride)
38 deal_with_spec(HydrogenBromide)
39 deal_with_spec(HydrogenIodide)
40 deal_with_spec(ChlorineMonoxide)
41 deal_with_spec(CarbonylSulfide)
42 deal_with_spec(Formaldehyde)
43 deal_with_spec(HeavyFormaldehyde)
44 deal_with_spec(VeryHeavyFormaldehyde)
45 deal_with_spec(HypochlorousAcid)
46 deal_with_spec(Nitrogen)
47 deal_with_spec(HydrogenCyanide)
48 deal_with_spec(Chloromethane)
49 deal_with_spec(HydrogenPeroxide)
50 deal_with_spec(Acetylene)
51 deal_with_spec(Ethane)
52 deal_with_spec(Phosphine)
53 deal_with_spec(CarbonylFluoride)
54 deal_with_spec(SulfurHexafluoride)
55 deal_with_spec(HydrogenSulfide)
56 deal_with_spec(FormicAcid)
57 deal_with_spec(LeftHeavyFormicAcid)
58 deal_with_spec(RightHeavyFormicAcid)
59 deal_with_spec(Hydroperoxyl)
60 deal_with_spec(OxygenAtom)
61 deal_with_spec(ChlorineNitrate)
62 deal_with_spec(NitricOxideCation)
63 deal_with_spec(HypobromousAcid)
64 deal_with_spec(Ethylene)
65 deal_with_spec(Methanol)
66 deal_with_spec(Bromomethane)
67 deal_with_spec(Acetonitrile)
68 deal_with_spec(HeavyAcetonitrile)
69 deal_with_spec(CarbonTetrafluoride)
70 deal_with_spec(Diacetylene)
71 deal_with_spec(Cyanoacetylene)
72 deal_with_spec(Hydrogen)
73 deal_with_spec(CarbonMonosulfide)
74 deal_with_spec(SulfurTrioxide)
75 deal_with_spec(Cyanogen)
76 deal_with_spec(Phosgene)
77 deal_with_spec(SulfurMonoxide)
78 deal_with_spec(CarbonDisulfide)
79 deal_with_spec(Methyl)
80 deal_with_spec(Cyclopropene)
81 deal_with_spec(SulfuricAcid)
82 deal_with_spec(HydrogenIsocyanide)
83 deal_with_spec(BromineMonoxide)
84 deal_with_spec(ChlorineDioxide)
85 deal_with_spec(Propane)
86 deal_with_spec(Helium)
87 deal_with_spec(ChlorineMonoxideDimer)
88 deal_with_spec(HydrogenAtom)
89 deal_with_spec(Argon)
90 deal_with_spec(Hexafluoroethane)
91 deal_with_spec(Perfluoropropane)
92 deal_with_spec(Perfluorobutane)
93 deal_with_spec(Perfluoropentane)
94 deal_with_spec(Perfluorohexane)
95 deal_with_spec(Perfluorooctane)
96 deal_with_spec(Perfluorocyclobutane)
97 deal_with_spec(CarbonTetrachloride)
98 deal_with_spec(CFC11)
99 deal_with_spec(CFC113)
100 deal_with_spec(CFC114)
101 deal_with_spec(CFC115)
102 deal_with_spec(CFC12)
103 deal_with_spec(Dichloromethane)
104 deal_with_spec(Trichloroethane)
105 deal_with_spec(Trichloromethane)
106 deal_with_spec(Bromochlorodifluoromethane)
107 deal_with_spec(Bromotrifluoromethane)
108 deal_with_spec(Dibromotetrafluoroethane)
109 deal_with_spec(HCFC141b)
110 deal_with_spec(HCFC142b)
111 deal_with_spec(HCFC22)
112 deal_with_spec(HFC125)
113 deal_with_spec(HFC134a)
114 deal_with_spec(HFC143a)
115 deal_with_spec(HFC152a)
116 deal_with_spec(HFC227ea)
117 deal_with_spec(HFC23)
118 deal_with_spec(HFC236fa)
119 deal_with_spec(HFC245fa)
120 deal_with_spec(HFC32)
121 deal_with_spec(HFC365mfc)
122 deal_with_spec(NitrogenTrifluoride)
123 deal_with_spec(SulfurylFluoride)
124 deal_with_spec(HFC4310mee)
125 deal_with_spec(Germane)
126 deal_with_spec(Iodomethane)
127 deal_with_spec(Fluoromethane)
128 deal_with_spec(liquidcloud)
129 deal_with_spec(icecloud)
130 deal_with_spec(rain)
131 deal_with_spec(free_electrons)
132 deal_with_spec(particles)
133 case Species::FINAL: { /* leave last */
134 }
135 }
136
137#undef deal_with_spec
138
139 ARTS_USER_ERROR("This is not a valid IsotopeRecord:\n", ir)
140}
141
143 Numeric T, const Species::IsotopeRecord& ir);
145 Numeric T, const Species::IsotopeRecord& ir);
146
147} // namespace detail
148
150
152
153constexpr bool has_partfun(const Species::IsotopeRecord& ir) noexcept {
154 using Species::Species;
155
156#define deal_with_spec(SPEC) \
157 case Species::SPEC: \
158 for (auto& x : has##SPEC) \
159 if (x == ir.isotname) return true; \
160 break;
161
162 switch (ir.spec) {
163 case Species::Bath: break;
164 deal_with_spec(Water)
165 deal_with_spec(CarbonDioxide)
166 deal_with_spec(Ozone)
167 deal_with_spec(NitrogenOxide)
168 deal_with_spec(CarbonMonoxide)
169 deal_with_spec(Methane)
170 deal_with_spec(Oxygen)
171 deal_with_spec(NitricOxide)
172 deal_with_spec(SulfurDioxide)
173 deal_with_spec(NitrogenDioxide)
174 deal_with_spec(Ammonia)
175 deal_with_spec(NitricAcid)
176 deal_with_spec(Hydroxyl)
177 deal_with_spec(HydrogenFluoride)
178 deal_with_spec(HydrogenChloride)
179 deal_with_spec(HydrogenBromide)
180 deal_with_spec(HydrogenIodide)
181 deal_with_spec(ChlorineMonoxide)
182 deal_with_spec(CarbonylSulfide)
183 deal_with_spec(Formaldehyde)
184 deal_with_spec(HeavyFormaldehyde)
185 deal_with_spec(VeryHeavyFormaldehyde)
186 deal_with_spec(HypochlorousAcid)
187 deal_with_spec(Nitrogen)
188 deal_with_spec(HydrogenCyanide)
189 deal_with_spec(Chloromethane)
190 deal_with_spec(HydrogenPeroxide)
191 deal_with_spec(Acetylene)
192 deal_with_spec(Ethane)
193 deal_with_spec(Phosphine)
194 deal_with_spec(CarbonylFluoride)
195 deal_with_spec(SulfurHexafluoride)
196 deal_with_spec(HydrogenSulfide)
197 deal_with_spec(FormicAcid)
198 deal_with_spec(LeftHeavyFormicAcid)
199 deal_with_spec(RightHeavyFormicAcid)
200 deal_with_spec(Hydroperoxyl)
201 deal_with_spec(OxygenAtom)
202 deal_with_spec(ChlorineNitrate)
203 deal_with_spec(NitricOxideCation)
204 deal_with_spec(HypobromousAcid)
205 deal_with_spec(Ethylene)
206 deal_with_spec(Methanol)
207 deal_with_spec(Bromomethane)
208 deal_with_spec(Acetonitrile)
209 deal_with_spec(HeavyAcetonitrile)
210 deal_with_spec(CarbonTetrafluoride)
211 deal_with_spec(Diacetylene)
212 deal_with_spec(Cyanoacetylene)
213 deal_with_spec(Hydrogen)
214 deal_with_spec(CarbonMonosulfide)
215 deal_with_spec(SulfurTrioxide)
216 deal_with_spec(Cyanogen)
217 deal_with_spec(Phosgene)
218 deal_with_spec(SulfurMonoxide)
219 deal_with_spec(CarbonDisulfide)
220 deal_with_spec(Methyl)
221 deal_with_spec(Cyclopropene)
222 deal_with_spec(SulfuricAcid)
223 deal_with_spec(HydrogenIsocyanide)
224 deal_with_spec(BromineMonoxide)
225 deal_with_spec(ChlorineDioxide)
226 deal_with_spec(Propane)
227 deal_with_spec(Helium)
228 deal_with_spec(ChlorineMonoxideDimer)
229 deal_with_spec(HydrogenAtom)
230 deal_with_spec(Argon)
231 deal_with_spec(Hexafluoroethane)
232 deal_with_spec(Perfluoropropane)
233 deal_with_spec(Perfluorobutane)
234 deal_with_spec(Perfluoropentane)
235 deal_with_spec(Perfluorohexane)
236 deal_with_spec(Perfluorooctane)
237 deal_with_spec(Perfluorocyclobutane)
238 deal_with_spec(CarbonTetrachloride)
239 deal_with_spec(CFC11)
240 deal_with_spec(CFC113)
241 deal_with_spec(CFC114)
242 deal_with_spec(CFC115)
243 deal_with_spec(CFC12)
244 deal_with_spec(Dichloromethane)
245 deal_with_spec(Trichloroethane)
246 deal_with_spec(Trichloromethane)
247 deal_with_spec(Bromochlorodifluoromethane)
248 deal_with_spec(Bromotrifluoromethane)
249 deal_with_spec(Dibromotetrafluoroethane)
250 deal_with_spec(HCFC141b)
251 deal_with_spec(HCFC142b)
252 deal_with_spec(HCFC22)
253 deal_with_spec(HFC125)
254 deal_with_spec(HFC134a)
255 deal_with_spec(HFC143a)
256 deal_with_spec(HFC152a)
257 deal_with_spec(HFC227ea)
258 deal_with_spec(HFC23)
259 deal_with_spec(HFC236fa)
260 deal_with_spec(HFC245fa)
261 deal_with_spec(HFC32)
262 deal_with_spec(HFC365mfc)
263 deal_with_spec(NitrogenTrifluoride)
264 deal_with_spec(SulfurylFluoride)
265 deal_with_spec(HFC4310mee)
266 deal_with_spec(Germane)
267 deal_with_spec(Iodomethane)
268 deal_with_spec(Fluoromethane)
269 deal_with_spec(liquidcloud)
270 deal_with_spec(icecloud)
271 deal_with_spec(rain)
272 deal_with_spec(free_electrons)
273 deal_with_spec(particles)
274 case Species::FINAL: { /* leave last */
275 }
276 }
277
278 #undef deal_with_spec
279
280 return false;
281}
282} // namespace PartitionFunctions
283
284#endif // partfun_h
#define ARTS_USER_ERROR(...)
Definition: debug.h:150
#define deal_with_spec(SPEC)
Implementation of Matrix, Vector, and such stuff.
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
template Numeric partfun_impl< Derivatives::Yes >(Numeric T, const Species::IsotopeRecord &ir)
template Numeric partfun_impl< Derivatives::No >(Numeric T, const Species::IsotopeRecord &ir)
Numeric partfun_impl(Numeric T, const Species::IsotopeRecord &ir)
Definition: partfun.h:14
Numeric dQdT(Numeric T, const Species::IsotopeRecord &ir)
Definition: partfun.cc:18
constexpr bool has_partfun(const Species::IsotopeRecord &ir) noexcept
Definition: partfun.h:153
Numeric Q(Numeric T, const Species::IsotopeRecord &ir)
Definition: partfun.cc:14
Struct containing all information needed about one isotope.
Definition: isotopologues.h:16
Species spec
Species type as defined in species.h.
Definition: isotopologues.h:18