WarpX
WarpXConst.H
Go to the documentation of this file.
1 /* Copyright 2019 Andrew Myers, Luca Fedeli, Maxence Thevenet
2  * Weiqun Zhang
3  *
4  * This file is part of WarpX.
5  *
6  * License: BSD-3-Clause-LBNL
7  */
8 #ifndef WARPX_CONST_H_
9 #define WARPX_CONST_H_
10 
11 #include <AMReX_REAL.H>
12 #include <cmath>
13 
14 // Math constants
15 namespace MathConst
16 {
17  static constexpr amrex::Real pi = 3.14159265358979323846;
18 }
19 
20 // Physical constants. Values are the 2018 CODATA recommended values
21 // https://physics.nist.gov/cuu/Constants/index.html
22 namespace PhysConst
23 {
24  static constexpr amrex::Real c = 299'792'458.;
25  static constexpr amrex::Real ep0 = 8.8541878128e-12;
26  static constexpr amrex::Real mu0 = 1.25663706212e-06;
27  static constexpr amrex::Real q_e = 1.602176634e-19;
28  static constexpr amrex::Real m_e = 9.1093837015e-31;
29  static constexpr amrex::Real m_p = 1.67262192369e-27;
30  static constexpr amrex::Real hbar = 1.054571817e-34;
31  static constexpr amrex::Real alpha = mu0/(4*MathConst::pi)*q_e*q_e*c/hbar;
32  static constexpr amrex::Real r_e = 1./(4*MathConst::pi*ep0) * q_e*q_e/(m_e*c*c);
33  static constexpr double xi = (2.*alpha*alpha*ep0*ep0*hbar*hbar*hbar)/
34  (45.*m_e*m_e*m_e*m_e*c*c*c*c*c); // SI value is 1.3050122.e-52
35  static constexpr amrex::Real xi_c2 = xi * c * c; // This should be usable for single precision, though
36  // very close to smallest number possible: smallest number = 1.2e-38, xi_c2 = 1.1e-35
37 }
38 
39 #endif
Definition: WarpXConst.H:22
Definition: WarpXConst.H:15