WarpX
Loading...
Searching...
No Matches
constant.H
Go to the documentation of this file.
1/* Copyright 2019-2022 Andrew Myers, Luca Fedeli, Maxence Thevenet,
2 * Weiqun Zhang, Axel Huebl
3 *
4 * This file is part of WarpX.
5 *
6 * License: BSD-3-Clause-LBNL
7 */
8#ifndef ABLASTR_CONSTANT_H_
9#define ABLASTR_CONSTANT_H_
10
11#include <AMReX_REAL.H>
12
13
16{
18 namespace math
19 {
21 template<typename T>
22 constexpr auto pi_v = static_cast<T>(3.14159265358979323846);
23
25 template<typename T>
26 constexpr auto tau_v = static_cast<T>(2.0 * pi_v<double>);
27
29 constexpr auto pi = pi_v<amrex::Real>;
30
32 constexpr auto tau = tau_v<amrex::Real>;
33
35 template<typename T>
36 constexpr auto degree2rad_v = pi_v<T> / static_cast<T>(180);
37
40
41 } // namespace math
42
55 namespace SI
56 {
57
59 template<typename T>
60 constexpr auto c_v = static_cast<T>(299'792'458);
61
63 template<typename T>
64 constexpr auto epsilon_0_v = static_cast<T>(8.8541878188e-12);
65
69 template<typename T>
70 constexpr auto mu0_v = static_cast<T>(1.2566370612685e-06);
71
73 template<typename T>
74 constexpr auto q_e_v = static_cast<T>(1.602176634e-19);
75
77 template<typename T>
78 constexpr auto m_e_v = static_cast<T>(9.1093837139e-31);
79
81 template<typename T>
82 constexpr auto m_p_v = static_cast<T>(1.67262192595e-27);
83
85 template<typename T>
86 constexpr auto m_u_v = static_cast<T>(1.66053906892e-27);
87
89 template<typename T>
90 constexpr auto hbar_v = static_cast<T>(1.0545718176461565e-34);
91
95 template<typename T>
96 constexpr auto alpha_v = static_cast<T>(0.0072973525643330135);
97
99 template<typename T>
100 constexpr auto r_e_v = static_cast<T>(2.8179403205e-15);
101
103 template<typename T>
104 constexpr auto xi_c2_v = static_cast<T>(1.1728865075613984e-35);
105
107 template<typename T>
108 constexpr auto schwinger_field_v = static_cast<T>(
110
112 template<typename T>
113 constexpr auto kb_v = static_cast<T>(1.380649e-23);
114
116 template<typename T>
117 constexpr auto eV_v = q_e_v<T>;
118
120 template<typename T>
121 constexpr auto MeV_v = static_cast<T>(q_e_v<double> * 1e6);
122
124 template<typename T>
125 constexpr auto eV_inv_c_v = static_cast<T>(eV_v<double> / c_v<double>);
126
128 template<typename T>
129 constexpr auto MeV_inv_c_v = static_cast<T>(MeV_v<double> / c_v<double>);
130
132 template<typename T>
133 constexpr auto eV_inv_c2_v = static_cast<T>(eV_v<double> / (c_v<double> * c_v<double>));
134
136 template<typename T>
137 constexpr auto MeV_inv_c2_v = static_cast<T>(MeV_v<double> / (c_v<double> * c_v<double>));
138
140 template<typename T>
141 constexpr auto sqrt_4_pi_fine_structure_v = static_cast<T>(0.3028221207690299);
142
144 template<typename T>
145 constexpr auto c2_v = static_cast<T>(c_v<double>*c_v<double>);
146
148 template<typename T>
149 constexpr auto inv_c_v = static_cast<T>(1.0/c_v<double>);
150
152 template<typename T>
153 constexpr auto inv_c2_v = static_cast<T>(1.0/c2_v<double>);
154
156 template<typename T>
158
160 constexpr auto c = c_v<amrex::Real>;
161
164
166 constexpr auto mu0 = mu0_v<amrex::Real>;
167
169 constexpr auto q_e = q_e_v<amrex::Real>;
170
172 constexpr auto m_e = m_e_v<amrex::Real>;
173
175 constexpr auto m_p = m_p_v<amrex::Real>;
176
178 constexpr auto m_u = m_u_v<amrex::Real>;
179
181 constexpr auto hbar = hbar_v<amrex::Real>;
182
184 constexpr auto alpha = alpha_v<amrex::Real>;
185
187 constexpr auto r_e = r_e_v<amrex::Real>;
188
190 constexpr double xi = 1.3050122383827227e-52;
191
193 constexpr auto xi_c2 = xi_c2_v<amrex::Real>;
194
196 template<typename T>
198
200 constexpr auto kb = kb_v<amrex::Real>;
201
203 constexpr auto eV = eV_v<amrex::Real>;
204
206 constexpr auto MeV = MeV_v<amrex::Real>;
207
210
213
216
219
221 constexpr auto c2 = c2_v<amrex::Real>;
222
224 constexpr auto inv_c = inv_c_v<amrex::Real>;
225
228
231
232 } // namespace SI
233
234} // namespace ablastr::constant
235
236#endif // ABLASTR_CONSTANT_H_
Definition constant.H:56
constexpr auto inv_c_v
inverse of the vacuum speed of light [s/m] (variable template)
Definition constant.H:149
constexpr auto MeV_inv_c_v
1 MeV/c in [kg*m/s] (variable template)
Definition constant.H:129
constexpr auto r_e
classical electron radius = 1./(4*pi*epsilon_0) * q_e*q_e/(m_e*c*c) [m]
Definition constant.H:187
constexpr auto kb_v
Boltzmann constant (exact) [J/K] (variable template)
Definition constant.H:113
constexpr auto reduced_compton_wavelength
reduced Compton wavelength [m]
Definition constant.H:230
constexpr auto eV_v
1 eV in [J] (variable template)
Definition constant.H:117
constexpr auto schwinger_field_v
Schwinger electric field [V/m] (variable template)
Definition constant.H:108
constexpr auto alpha_v
Definition constant.H:96
constexpr auto alpha
fine-structure constant = mu0/(4*pi)*q_e*q_e*c/hbar [dimensionless]
Definition constant.H:184
constexpr auto MeV
1 MeV in [J]
Definition constant.H:206
constexpr auto xi_c2
xi times c2 = xi*c*c. This should be usable for single precision instead of xi; very close to smalles...
Definition constant.H:193
constexpr auto eV_inv_c
1 eV/c in [kg*m/s]
Definition constant.H:209
constexpr auto c
vacuum speed of light [m/s]
Definition constant.H:160
constexpr auto c2
square of the vacuum speed of light [m^2/s^2]
Definition constant.H:221
constexpr auto eV_inv_c2_v
1 eV/c^2 in [kg] (variable template)
Definition constant.H:133
constexpr auto xi_c2_v
xi times c2 = xi*c*c. This should be usable for single precision instead of xi; very close to smalles...
Definition constant.H:104
constexpr auto eV_inv_c2
1 eV/c^2 in [kg]
Definition constant.H:215
constexpr auto q_e_v
elementary charge [C] (variable template)
Definition constant.H:74
constexpr auto reduced_compton_wavelength_v
reduced Compton wavelength [m] (variable template)
Definition constant.H:157
constexpr auto mu0_v
Definition constant.H:70
constexpr auto r_e_v
classical electron radius = 1./(4*pi*epsilon_0) * q_e*q_e/(m_e*c*c) [m] (variable template)
Definition constant.H:100
constexpr auto sqrt_4_pi_fine_structure_v
sqrt(4*pi*alpha) is a constant used for the Heaviside Lorentz unit system (variable template)
Definition constant.H:141
constexpr auto inv_c
inverse of the vacuum speed of light [s/m]
Definition constant.H:224
constexpr auto epsilon_0
vacuum permittivity: dielectric permittivity of vacuum [F/m]
Definition constant.H:163
constexpr auto m_e_v
electron mass [kg] (variable template)
Definition constant.H:78
constexpr auto m_p_v
proton mass [kg] (variable template)
Definition constant.H:82
constexpr auto hbar_v
reduced Planck Constant = h / tau [J*s] (variable template)
Definition constant.H:90
constexpr auto eV
1 eV in [J]
Definition constant.H:203
constexpr auto MeV_inv_c2_v
1 MeV/c^2 in [kg] (variable template)
Definition constant.H:137
constexpr auto m_p
proton mass [kg]
Definition constant.H:175
constexpr auto schwinger_field
Schwinger electric field [V/m].
Definition constant.H:197
constexpr auto MeV_v
1 MeV in [J] (variable template)
Definition constant.H:121
constexpr auto inv_c2_v
inverse of the square of the vacuum speed of light [s^2/m^2] (variable template)
Definition constant.H:153
constexpr auto kb
Boltzmann constant (exact) [J/K].
Definition constant.H:200
constexpr auto epsilon_0_v
vacuum permittivity: dielectric permittivity of vacuum [F/m] (variable template)
Definition constant.H:64
constexpr auto eV_inv_c_v
1 eV/c in [kg*m/s] (variable template)
Definition constant.H:125
constexpr auto mu0
vacuum permeability: magnetic permeability of vacuum = 4.0e-7 * pi [H/m]
Definition constant.H:166
constexpr auto hbar
reduced Planck Constant = h / tau [J*s]
Definition constant.H:181
constexpr auto MeV_inv_c2
1 MeV/c^2 in [kg]
Definition constant.H:218
constexpr auto m_e
electron mass [kg]
Definition constant.H:172
constexpr auto c_v
vacuum speed of light [m/s] (variable template)
Definition constant.H:60
constexpr auto MeV_inv_c
1 MeV/c in [kg*m/s]
Definition constant.H:212
constexpr double xi
xi: nonlinearity parameter of Heisenberg-Euler effective theory = (2.*alpha**2*epsilon_0**2*hbar**3)/...
Definition constant.H:190
constexpr auto m_u_v
dalton: unified atomic mass unit [kg] (variable template)
Definition constant.H:86
constexpr auto c2_v
square of the vacuum speed of light [m^2/s^2] (variable template)
Definition constant.H:145
constexpr auto m_u
dalton: unified atomic mass unit [kg]
Definition constant.H:178
constexpr auto inv_c2
inverse of the square of the vacuum speed of light [s^2/m^2]
Definition constant.H:227
constexpr auto q_e
elementary charge [C]
Definition constant.H:169
Definition constant.H:19
constexpr auto degree2rad
convert degree to radian
Definition constant.H:39
constexpr auto tau_v
https://tauday.com/tau-manifesto (variable template)
Definition constant.H:26
constexpr auto pi
ratio of a circle's circumference to its diameter
Definition constant.H:29
constexpr auto pi_v
ratio of a circle's circumference to its diameter (variable template)
Definition constant.H:22
constexpr auto degree2rad_v
convert degree to radian (variable template)
Definition constant.H:36
constexpr auto tau
https://tauday.com/tau-manifesto
Definition constant.H:32
Definition constant.H:16