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 
13 #include <cmath>
14 
15 #include <map>
16 #include <string>
17 
18 // Math constants
19 namespace MathConst
20 {
21  static constexpr amrex::Real pi = static_cast<amrex::Real>(3.14159265358979323846);
22 }
23 
24 // Physical constants. Values are the 2018 CODATA recommended values
25 // https://physics.nist.gov/cuu/Constants/index.html
26 //
27 // New additions here should also be considered for addition to
28 // `warpx_constants` in WarpXUtil.cpp's `makeParser`, so that they're
29 // available in parsing and evaluation of PICMI expressions, as well
30 // as the corresponding Python definitions
31 namespace PhysConst
32 {
33  static constexpr auto c = static_cast<amrex::Real>( 299'792'458. );
34  static constexpr auto ep0 = static_cast<amrex::Real>( 8.8541878128e-12 );
35  static constexpr auto mu0 = static_cast<amrex::Real>( 1.25663706212e-06 );
36  static constexpr auto q_e = static_cast<amrex::Real>( 1.602176634e-19 );
37  static constexpr auto m_e = static_cast<amrex::Real>( 9.1093837015e-31 );
38  static constexpr auto m_p = static_cast<amrex::Real>( 1.67262192369e-27 );
39  static constexpr auto m_u = static_cast<amrex::Real>( 1.66053906660e-27 );
40  static constexpr auto hbar = static_cast<amrex::Real>( 1.054571817e-34 );
41  static constexpr auto alpha = static_cast<amrex::Real>( 0.007297352573748943 );//mu0/(4*MathConst::pi)*q_e*q_e*c/hbar;
42  static constexpr auto r_e = static_cast<amrex::Real>( 2.817940326204929e-15 );//1./(4*MathConst::pi*ep0) * q_e*q_e/(m_e*c*c);
43  static constexpr double xi = 1.3050122447005176e-52; //(2.*alpha*alpha*ep0*ep0*hbar*hbar*hbar)/(45.*m_e*m_e*m_e*m_e*c*c*c*c*c);
44  static constexpr auto xi_c2 = static_cast<amrex::Real>( 1.1728865132395492e-35 ); // This should be usable for single precision, though
45  // very close to smallest number possible (1.2e-38)
46 
47  static constexpr auto kb = static_cast<amrex::Real>( 1.380649e-23 ); // Boltzmann's constant, J/K (exact)
48 }
49 
50 #endif
Definition: WarpXConst.H:31
Definition: WarpXConst.H:19