41#ifndef HEED_SYSTEM_OF_UNITS_H
42#define HEED_SYSTEM_OF_UNITS_H
51static constexpr double pi = 3.14159265358979323846;
52static constexpr double twopi = 2 * pi;
53static constexpr double halfpi = pi / 2;
54static constexpr double pi2 = pi * pi;
59static constexpr double millimeter = 1.;
60static constexpr double millimeter2 = millimeter * millimeter;
61static constexpr double millimeter3 = millimeter * millimeter * millimeter;
63static constexpr double centimeter = 10. * millimeter;
64static constexpr double centimeter2 = centimeter * centimeter;
65static constexpr double centimeter3 = centimeter * centimeter * centimeter;
67static constexpr double meter = 1000. * millimeter;
68static constexpr double meter2 = meter * meter;
69static constexpr double meter3 = meter * meter * meter;
71static constexpr double kilometer = 1000. * meter;
72static constexpr double kilometer2 = kilometer * kilometer;
73static constexpr double kilometer3 = kilometer * kilometer * kilometer;
75static constexpr double parsec = 3.0856775807e+16 * meter;
77static constexpr double micrometer = 1.e-6 * meter;
78static constexpr double nanometer = 1.e-9 * meter;
79static constexpr double angstrom = 1.e-10 * meter;
80static constexpr double fermi = 1.e-15 * meter;
82static constexpr double barn = 1.e-28 * meter2;
83static constexpr double millibarn = 1.e-3 * barn;
84static constexpr double microbarn = 1.e-6 * barn;
85static constexpr double nanobarn = 1.e-9 * barn;
86static constexpr double picobarn = 1.e-12 * barn;
89static constexpr double mm = millimeter;
90static constexpr double mm2 = millimeter2;
91static constexpr double mm3 = millimeter3;
93static constexpr double cm = centimeter;
94static constexpr double cm2 = centimeter2;
95static constexpr double cm3 = centimeter3;
97static constexpr double m = meter;
98static constexpr double m2 = meter2;
99static constexpr double m3 = meter3;
101static constexpr double km = kilometer;
102static constexpr double km2 = kilometer2;
103static constexpr double km3 = kilometer3;
105static constexpr double pc = parsec;
110static constexpr double radian = 1.;
111static constexpr double milliradian = 1.e-3 * radian;
112static constexpr double degree = (3.14159265358979323846 / 180.0) * radian;
114static constexpr double steradian = 1.;
117static constexpr double rad = radian;
118static constexpr double mrad = milliradian;
119static constexpr double sr = steradian;
120static constexpr double deg = degree;
125static constexpr double nanosecond = 1.;
126static constexpr double second = 1.e+9 * nanosecond;
127static constexpr double millisecond = 1.e-3 * second;
128static constexpr double microsecond = 1.e-6 * second;
129static constexpr double picosecond = 1.e-12 * second;
131static constexpr double hertz = 1. / second;
132static constexpr double kilohertz = 1.e+3 * hertz;
133static constexpr double megahertz = 1.e+6 * hertz;
136static constexpr double ns = nanosecond;
137static constexpr double s = second;
138static constexpr double ms = millisecond;
143static constexpr double eplus = 1.;
144static constexpr double e_SI = 1.60217733e-19;
145static constexpr double coulomb = eplus / e_SI;
150static constexpr double megaelectronvolt = 1.;
151static constexpr double electronvolt = 1.e-6 * megaelectronvolt;
152static constexpr double kiloelectronvolt = 1.e-3 * megaelectronvolt;
153static constexpr double gigaelectronvolt = 1.e+3 * megaelectronvolt;
154static constexpr double teraelectronvolt = 1.e+6 * megaelectronvolt;
155static constexpr double petaelectronvolt = 1.e+9 * megaelectronvolt;
157static constexpr double joule = electronvolt / e_SI;
160static constexpr double MeV = megaelectronvolt;
161static constexpr double eV = electronvolt;
162static constexpr double keV = kiloelectronvolt;
163static constexpr double GeV = gigaelectronvolt;
164static constexpr double TeV = teraelectronvolt;
165static constexpr double PeV = petaelectronvolt;
170static constexpr double kilogram = joule * second * second / (meter * meter);
171static constexpr double gram = 1.e-3 * kilogram;
172static constexpr double milligram = 1.e-3 * gram;
175static constexpr double kg = kilogram;
176static constexpr double g = gram;
177static constexpr double mg = milligram;
182static constexpr double watt = joule / second;
187static constexpr double newton = joule / meter;
192#define pascal hep_pascal
193static constexpr double hep_pascal = newton / m2;
194static constexpr double bar = 100000 *
pascal;
195static constexpr double atmosphere =
201static constexpr double ampere =
203static constexpr double milliampere = 1.e-3 * ampere;
204static constexpr double microampere = 1.e-6 * ampere;
205static constexpr double nanoampere = 1.e-9 * ampere;
210static constexpr double megavolt = megaelectronvolt / eplus;
211static constexpr double kilovolt = 1.e-3 * megavolt;
212static constexpr double volt = 1.e-6 * megavolt;
217static constexpr double ohm =
223static constexpr double farad =
225static constexpr double millifarad = 1.e-3 * farad;
226static constexpr double microfarad = 1.e-6 * farad;
227static constexpr double nanofarad = 1.e-9 * farad;
228static constexpr double picofarad = 1.e-12 * farad;
233static constexpr double weber = volt * second;
238static constexpr double tesla =
239 volt * second / meter2;
241static constexpr double gauss = 1.e-4 * tesla;
242static constexpr double kilogauss = 1.e-1 * tesla;
247static constexpr double henry =
253static constexpr double kelvin = 1.;
258static constexpr double mole = 1.;
263static constexpr double becquerel = 1. / second;
264static constexpr double curie = 3.7e+10 * becquerel;
269static constexpr double gray = joule / kilogram;
274static constexpr double candela = 1.;
279static constexpr double lumen = candela * steradian;
284static constexpr double lux = lumen / meter2;
289static constexpr double perCent = 0.01;
290static constexpr double perThousand = 0.001;
291static constexpr double perMillion = 0.000001;