WarpX
SpeciesPhysicalProperties.H
Go to the documentation of this file.
1 /* Copyright 2020 Maxence Thevenet
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 
8 #ifndef WARPX_SPECIESPHYSICALPROPERTIES_H_
9 #define WARPX_SPECIESPHYSICALPROPERTIES_H_
10 
11 #include "Utils/WarpXConst.H"
12 
13 #include <AMReX_AmrCore.H>
14 #include <AMReX_REAL.H>
15 
16 #include <limits>
17 #include <map>
18 
20 
21 namespace species
22 {
23  AMREX_FORCE_INLINE
25  {
26  if( species=="unspecified" )
28  if( species=="electron" )
30  if( species=="positron" )
32  if( species=="photon" )
34  if( species=="hydrogen" )
36  if( species=="carbon" )
38  if( species=="nitrogen" )
40  if( species=="oxygen" )
42  if( species=="copper" )
44  amrex::Abort("unknown PhysicalSpecies");
46  }
47 
48  AMREX_FORCE_INLINE
49  amrex::Real get_charge (PhysicalSpecies ps)
50  {
51  switch(ps) {
53  return std::numeric_limits<amrex::Real>::quiet_NaN();
55  return -PhysConst::q_e;
57  return PhysConst::q_e;
59  return 0.;
61  return PhysConst::q_e;
63  return PhysConst::q_e * amrex::Real(6.0);
65  return PhysConst::q_e * amrex::Real(7.0);
67  return PhysConst::q_e * amrex::Real(8.0);
69  return PhysConst::q_e * amrex::Real(29.0);
70  default:
71  amrex::Abort("unknown PhysicalSpecies");
72  return 0.;
73  }
74  }
75 
76  AMREX_FORCE_INLINE
77  amrex::Real get_mass (PhysicalSpecies ps)
78  {
79  switch(ps) {
81  return std::numeric_limits<amrex::Real>::quiet_NaN();
83  return PhysConst::m_e;
85  return PhysConst::m_e;
87  return 0.;
89  return PhysConst::m_p;
91  return PhysConst::m_e * amrex::Real(22032.0);
93  return PhysConst::m_e * amrex::Real(25716.9);
95  return PhysConst::m_p * amrex::Real(15.8834);
97  return PhysConst::m_p * amrex::Real(63.0864);
98  default:
99  amrex::Abort("unknown PhysicalSpecies");
100  return 0.;
101  }
102  }
103 }
104 
105 #endif // WARPX_SPECIESPHYSICALPROPERTIES_H_
AMREX_FORCE_INLINE PhysicalSpecies from_string(std::string species)
Definition: SpeciesPhysicalProperties.H:24
PhysicalSpecies
Definition: SpeciesPhysicalProperties.H:19
AMREX_FORCE_INLINE amrex::Real get_mass(PhysicalSpecies ps)
Definition: SpeciesPhysicalProperties.H:77
AMREX_FORCE_INLINE amrex::Real get_charge(PhysicalSpecies ps)
Definition: SpeciesPhysicalProperties.H:49
Definition: SpeciesPhysicalProperties.H:21