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