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
34 } // namespace math
35
48 namespace SI
49 {
50
52 template<typename T>
53 constexpr auto c_v = static_cast<T>(299'792'458);
54
56 template<typename T>
57 constexpr auto epsilon_0_v = static_cast<T>(8.8541878188e-12);
58
62 template<typename T>
63 constexpr auto mu0_v = static_cast<T>(1.2566370612685e-06);
64
66 template<typename T>
67 constexpr auto q_e_v = static_cast<T>(1.602176634e-19);
68
70 template<typename T>
71 constexpr auto m_e_v = static_cast<T>(9.1093837139e-31);
72
74 template<typename T>
75 constexpr auto m_p_v = static_cast<T>(1.67262192595e-27);
76
78 template<typename T>
79 constexpr auto m_u_v = static_cast<T>(1.66053906892e-27);
80
82 template<typename T>
83 constexpr auto hbar_v = static_cast<T>(1.0545718176461565e-34);
84
88 template<typename T>
89 constexpr auto alpha_v = static_cast<T>(0.0072973525643330135);
90
92 template<typename T>
93 constexpr auto r_e_v = static_cast<T>(2.8179403205e-15);
94
96 template<typename T>
97 constexpr auto xi_c2_v = static_cast<T>(1.1728865075613984e-35);
98
100 template<typename T>
101 constexpr auto schwinger_field_v = static_cast<T>(
103
105 template<typename T>
106 constexpr auto kb_v = static_cast<T>(1.380649e-23);
107
109 template<typename T>
110 constexpr auto eV_v = q_e_v<T>;
111
113 template<typename T>
114 constexpr auto MeV_v = static_cast<T>(q_e_v<double> * 1e6);
115
117 template<typename T>
118 constexpr auto eV_inv_c_v = static_cast<T>(eV_v<double> / c_v<double>);
119
121 template<typename T>
122 constexpr auto MeV_inv_c_v = static_cast<T>(MeV_v<double> / c_v<double>);
123
125 template<typename T>
126 constexpr auto eV_inv_c2_v = static_cast<T>(eV_v<double> / (c_v<double> * c_v<double>));
127
129 template<typename T>
130 constexpr auto MeV_inv_c2_v = static_cast<T>(MeV_v<double> / (c_v<double> * c_v<double>));
131
133 template<typename T>
134 constexpr auto sqrt_4_pi_fine_structure_v = static_cast<T>(0.3028221207690299);
135
137 template<typename T>
138 constexpr auto c2_v = static_cast<T>(c_v<double>*c_v<double>);
139
141 template<typename T>
142 constexpr auto inv_c_v = static_cast<T>(1.0/c_v<double>);
143
145 template<typename T>
146 constexpr auto inv_c2_v = static_cast<T>(1.0/c2_v<double>);
147
149 constexpr auto c = c_v<amrex::Real>;
150
153
155 constexpr auto mu0 = mu0_v<amrex::Real>;
156
158 constexpr auto q_e = q_e_v<amrex::Real>;
159
161 constexpr auto m_e = m_e_v<amrex::Real>;
162
164 constexpr auto m_p = m_p_v<amrex::Real>;
165
167 constexpr auto m_u = m_u_v<amrex::Real>;
168
170 constexpr auto hbar = hbar_v<amrex::Real>;
171
173 constexpr auto alpha = alpha_v<amrex::Real>;
174
176 constexpr auto r_e = r_e_v<amrex::Real>;
177
179 constexpr double xi = 1.3050122383827227e-52;
180
182 constexpr auto xi_c2 = xi_c2_v<amrex::Real>;
183
185 template<typename T>
187
189 constexpr auto kb = kb_v<amrex::Real>;
190
192 constexpr auto eV = eV_v<amrex::Real>;
193
195 constexpr auto MeV = MeV_v<amrex::Real>;
196
199
202
205
208
210 constexpr auto c2 = c2_v<amrex::Real>;
211
213 constexpr auto inv_c = inv_c_v<amrex::Real>;
214
217
218 } // namespace SI
219
220} // namespace ablastr::constant
221
222#endif // ABLASTR_CONSTANT_H_
Definition constant.H:49
constexpr auto inv_c_v
inverse of the vacuum speed of light [s/m] (variable template)
Definition constant.H:142
constexpr auto MeV_inv_c_v
1 MeV/c in [kg*m/s] (variable template)
Definition constant.H:122
constexpr auto r_e
classical electron radius = 1./(4*pi*epsilon_0) * q_e*q_e/(m_e*c*c) [m]
Definition constant.H:176
constexpr auto kb_v
Boltzmann constant (exact) [J/K] (variable template)
Definition constant.H:106
constexpr auto eV_v
1 eV in [J] (variable template)
Definition constant.H:110
constexpr auto schwinger_field_v
Schwinger electric field [V/m] (variable template)
Definition constant.H:101
constexpr auto alpha_v
Definition constant.H:89
constexpr auto alpha
fine-structure constant = mu0/(4*pi)*q_e*q_e*c/hbar [dimensionless]
Definition constant.H:173
constexpr auto MeV
1 MeV in [J]
Definition constant.H:195
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:182
constexpr auto eV_inv_c
1 eV/c in [kg*m/s]
Definition constant.H:198
constexpr auto c
vacuum speed of light [m/s]
Definition constant.H:149
constexpr auto c2
square of the vacuum speed of light [m^2/s^2]
Definition constant.H:210
constexpr auto eV_inv_c2_v
1 eV/c^2 in [kg] (variable template)
Definition constant.H:126
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:97
constexpr auto eV_inv_c2
1 eV/c^2 in [kg]
Definition constant.H:204
constexpr auto q_e_v
elementary charge [C] (variable template)
Definition constant.H:67
constexpr auto mu0_v
Definition constant.H:63
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:93
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:134
constexpr auto inv_c
inverse of the vacuum speed of light [s/m]
Definition constant.H:213
constexpr auto epsilon_0
vacuum permittivity: dielectric permittivity of vacuum [F/m]
Definition constant.H:152
constexpr auto m_e_v
electron mass [kg] (variable template)
Definition constant.H:71
constexpr auto m_p_v
proton mass [kg] (variable template)
Definition constant.H:75
constexpr auto hbar_v
reduced Planck Constant = h / tau [J*s] (variable template)
Definition constant.H:83
constexpr auto eV
1 eV in [J]
Definition constant.H:192
constexpr auto MeV_inv_c2_v
1 MeV/c^2 in [kg] (variable template)
Definition constant.H:130
constexpr auto m_p
proton mass [kg]
Definition constant.H:164
constexpr auto schwinger_field
Schwinger electric field [V/m].
Definition constant.H:186
constexpr auto MeV_v
1 MeV in [J] (variable template)
Definition constant.H:114
constexpr auto inv_c2_v
inverse of the square of the vacuum speed of light [s^2/m^2] (variable template)
Definition constant.H:146
constexpr auto kb
Boltzmann constant (exact) [J/K].
Definition constant.H:189
constexpr auto epsilon_0_v
vacuum permittivity: dielectric permittivity of vacuum [F/m] (variable template)
Definition constant.H:57
constexpr auto eV_inv_c_v
1 eV/c in [kg*m/s] (variable template)
Definition constant.H:118
constexpr auto mu0
vacuum permeability: magnetic permeability of vacuum = 4.0e-7 * pi [H/m]
Definition constant.H:155
constexpr auto hbar
reduced Planck Constant = h / tau [J*s]
Definition constant.H:170
constexpr auto MeV_inv_c2
1 MeV/c^2 in [kg]
Definition constant.H:207
constexpr auto m_e
electron mass [kg]
Definition constant.H:161
constexpr auto c_v
vacuum speed of light [m/s] (variable template)
Definition constant.H:53
constexpr auto MeV_inv_c
1 MeV/c in [kg*m/s]
Definition constant.H:201
constexpr double xi
xi: nonlinearity parameter of Heisenberg-Euler effective theory = (2.*alpha**2*epsilon_0**2*hbar**3)/...
Definition constant.H:179
constexpr auto m_u_v
dalton: unified atomic mass unit [kg] (variable template)
Definition constant.H:79
constexpr auto c2_v
square of the vacuum speed of light [m^2/s^2] (variable template)
Definition constant.H:138
constexpr auto m_u
dalton: unified atomic mass unit [kg]
Definition constant.H:167
constexpr auto inv_c2
inverse of the square of the vacuum speed of light [s^2/m^2]
Definition constant.H:216
constexpr auto q_e
elementary charge [C]
Definition constant.H:158
Definition constant.H:19
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 tau
https://tauday.com/tau-manifesto
Definition constant.H:32
Definition constant.H:16