OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Physics.h
Go to the documentation of this file.
1//
2// Class Physics
3// A namespace defining various mathematical and physical constants.
4//
5// Copyright (c) 2015-2021, Christof Metzger-Kraus, Helmholtz-Zentrum Berlin
6// Pedro Calvo, CIEMAT, Spain
7// All rights reserved
8//
9// Implemented as part of the PhD thesis
10// "Optimizing the radioisotope production of the novel AMIT
11// superconducting weak focusing cyclotron"
12//
13// This file is part of OPAL.
14//
15// OPAL is free software: you can redistribute it and/or modify
16// it under the terms of the GNU General Public License as published by
17// the Free Software Foundation, either version 3 of the License, or
18// (at your option) any later version.
19//
20// You should have received a copy of the GNU General Public License
21// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
22//
23#ifndef OPALX_Physics_HH
24#define OPALX_Physics_HH
25
26#ifdef OPALX_USE_KOKKOS_MATH_CONSTANTS
27#include <Kokkos_MathematicalConstants.hpp>
28#endif
29
30namespace Physics {
31
33#ifdef OPALX_USE_KOKKOS_MATH_CONSTANTS
34 constexpr double pi = Kokkos::numbers::pi_v<double>;
35#else
36 constexpr double pi = 3.14159265358979323846;
37#endif
38
40 constexpr double two_pi = 2 * pi;
41
43 constexpr double u_two_pi = 1.0 / two_pi;
44
46#ifdef OPALX_USE_KOKKOS_MATH_CONSTANTS
47 constexpr double e = Kokkos::numbers::e_v<double>;
48#else
49 constexpr double e = 2.7182818284590452354;
50#endif
51
53#ifdef OPALX_USE_KOKKOS_MATH_CONSTANTS
54 constexpr double log10e = Kokkos::numbers::log10e_v<double>;
55#else
56 constexpr double log10e = 0.43429448190325182765;
57#endif
58
60 constexpr double c = 299792458.0;
61
63 constexpr double mu_0 = 1.25663706212e-06;
64
66 constexpr double epsilon_0 = 8.8541878128e-12;
67
69 constexpr double h_bar = 6.582119569e-25;
70
72 constexpr double Avo = 6.02214076e23;
73
75 constexpr double kB = 8.617333262e-5;
76
78 constexpr double E_ryd = 13.605693122994e-9;
79
81 constexpr double a0 = 5.29177210903e-11;
82
84 constexpr double q_e = 1.602176634e-19;
85
87 constexpr double alpha = 7.2973525693e-03;
88
90 constexpr double amu = 0.93149410242;
91
93 constexpr double m_e = 0.51099895000e-03;
94
96 constexpr double r_e = 2.8179403262e-15;
97
99 constexpr double lamda_e = 3.8615926796e-13;
100
102 constexpr double a_e = 1.15965218128e-03;
103
105 constexpr double m_p = 0.93827208816e+00;
106
108 constexpr double r_p = 1.53469857e-18;
109
111 constexpr double lamda_p = 2.10308910336e-16;
112
114 constexpr double a_p = 1.792847386e+00;
115
117 constexpr double z_p = 1;
118
120 constexpr double m_c = 11.9967074146787 * amu;
121
123 constexpr double m_hm = 1.00837 * amu;
124
126 constexpr double m_u = 237.999501 * amu;
127
129 constexpr double m_mu = 0.1056583755;
130
132 constexpr double tau_mu = 2.1969811e-6;
133
135 constexpr double a_mu = 1.16592061e-03;
136
138 constexpr double m_pi = 0.13957039;
139
141 constexpr double tau_pi = 2.6033e-8;
142
144 constexpr double m_d = 2.013553212745 * amu;
145
147 constexpr double m_xe = 128.87494026 * amu;
148
150 constexpr double m_alpha = 4.001506179127 * amu;
151
153 constexpr double m_h = 1.00782503224 * amu;
154
156 constexpr double m_h2p = 2.01510 * amu;
157
159 constexpr double m_h3p = 3.02293 * amu;
160
161 constexpr double PMASS = 1.67262192369e-27; // kg
162
163 constexpr double EMASS = 9.1093837015e-31; // kg
164
165 constexpr double PCHARGE = 1.602176634e-19; // C
166
167 // alfven current
168 constexpr double Ia = 17.045148e+03;
169 // e/m - electron charge to mass quotient
170 constexpr double e0m = 1.75882001076e+11;
171 // e/mc
172 constexpr double e0mc = e0m / c;
173}; // namespace Physics
174
175#endif // OPALX_Physics_HH
Definition Air.h:27
constexpr double e0m
Definition Physics.h:170
constexpr double lamda_e
The reduced Compton wave length for electrons in m.
Definition Physics.h:99
constexpr double Ia
Definition Physics.h:168
constexpr double u_two_pi
The value of.
Definition Physics.h:43
constexpr double m_xe
The xenon-129 (fully-stripped) rest mass in GeV.
Definition Physics.h:147
constexpr double kB
Boltzman's constant in eV/K.
Definition Physics.h:75
constexpr double m_alpha
The alpha particle rest mass in GeV.
Definition Physics.h:150
constexpr double m_u
The uranium-238 (fully-stripped) rest mass in GeV.
Definition Physics.h:126
constexpr double e0mc
Definition Physics.h:172
constexpr double a_mu
The magnetic moment anomaly for muons, no dimension (PDG, (g-2)/2)
Definition Physics.h:135
constexpr double amu
The atomic mass unit energy equivalent in GeV.
Definition Physics.h:90
constexpr double two_pi
The value of.
Definition Physics.h:40
constexpr double lamda_p
The reduced Compton wave length for protons in m.
Definition Physics.h:111
constexpr double a_p
The magnetic momentum anomaly for protons, no dimension.
Definition Physics.h:114
constexpr double a0
Bohr radius in m.
Definition Physics.h:81
constexpr double h_bar
The reduced Planck constant in GeVs.
Definition Physics.h:69
constexpr double m_pi
The charged pion rest mass in GeV (PDG)
Definition Physics.h:138
constexpr double epsilon_0
The permittivity of vacuum in As/Vm.
Definition Physics.h:66
constexpr double EMASS
Definition Physics.h:163
constexpr double Avo
The Avogadro's number.
Definition Physics.h:72
constexpr double PMASS
Definition Physics.h:161
constexpr double m_p
The proton rest mass in GeV.
Definition Physics.h:105
constexpr double m_h3p
The H3+ rest mass in GeV.
Definition Physics.h:159
constexpr double PCHARGE
Definition Physics.h:165
constexpr double m_h2p
The H2+ rest mass in GeV.
Definition Physics.h:156
constexpr double z_p
The charge of proton.
Definition Physics.h:117
constexpr double tau_mu
Muon mean lifetime at rest [s] (PDG)
Definition Physics.h:132
constexpr double alpha
The fine structure constant, no dimension.
Definition Physics.h:87
constexpr double q_e
The elementary charge in As.
Definition Physics.h:84
constexpr double a_e
The magnetic momentum anomaly for electrons, no dimension.
Definition Physics.h:102
constexpr double m_e
The electron rest mass in GeV.
Definition Physics.h:93
constexpr double m_hm
The H- rest mass in GeV.
Definition Physics.h:123
constexpr double E_ryd
Rydberg's energy (Rydberg's constant times hc) in GeV.
Definition Physics.h:78
constexpr double m_h
The hydrogen atom rest mass in GeV.
Definition Physics.h:153
constexpr double m_mu
The muon rest mass in GeV.
Definition Physics.h:129
constexpr double e
The value of.
Definition Physics.h:49
constexpr double mu_0
The permeability of vacuum in Vs/Am.
Definition Physics.h:63
constexpr double c
The velocity of light in m/s.
Definition Physics.h:60
constexpr double m_c
The carbon-12 (fully-stripped) rest mass in GeV.
Definition Physics.h:120
constexpr double r_p
The classical proton radius in m.
Definition Physics.h:108
constexpr double m_d
The deuteron rest mass in GeV.
Definition Physics.h:144
constexpr double tau_pi
Charged pion mean lifetime at rest [s] (PDG)
Definition Physics.h:141
constexpr double pi
The value of.
Definition Physics.h:36
constexpr double r_e
The classical electron radius in m.
Definition Physics.h:96
constexpr double log10e
The logarithm of $e$ to the base 10.
Definition Physics.h:56