XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cpp_globals.hpp
Go to the documentation of this file.
1 #ifndef CPP_GLOBALS_HPP
2 #define CPP_GLOBALS_HPP
3 #include "space_settings.hpp"
4 #include "array_deep_copy.hpp"
5 #include "access_add.hpp"
6 #include "simd.hpp"
7 
9  ELECTRON = 0,
11 };
12 
13 enum KinType{
16 };
17 
19  PIR = 0,
20  PIZ,
21  PIP,
23  PIW1,
24  PIW2,
26 };
27 
29  PIM = 0,
30  PIW0,
31  PIF0,
33 };
34 
35 const double UNIT_CHARGE = 1.6022e-19;
36 const double EV_2_J=UNIT_CHARGE;
37 const double J_2_EV=1.0/EV_2_J;
38 const double PROTON_MASS = 1.6720e-27; //< proton mass (MKS)
39 const double PI = 3.1415926535897932; //< pi
40 const double TWOPI = 6.2831853071795862; //< 2 pi
41 
42 // Diagnostics
43 const int DIAG_HEAT_NVAR = 5;
44 const int N_VF_DIAG = 9;
45 #ifdef XGC1
46  const int D1D_NPV1 = 16;
47 #else
48  const int D1D_NPV1 = 18;
49 #endif
50 
51 /*** SIMD structures (probably temporary) ****/
52 
53 
54 struct SimdVector2D{
57 };
58 
59 struct SimdVector{
63 
64  // Vector operation, sets SimdVector to 0.0
65  KOKKOS_INLINE_FUNCTION void zero(){
66  for (int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
67  r[i_simd] = 0.0;
68  z[i_simd] = 0.0;
69  phi[i_simd] = 0.0;
70  }
71  }
72 };
73 
74 /* Fortran pointers */
75 // This type is used to refer to fortran pointers that we never plan on using (i.e. dereferencing) inside the C++ code.
76 // The reason we don't use them in the C++ code is that the objects being referred to (spall, grid, psn), are very complicated.
77 // In order to use them, we would need to carefully create the equivalent object in C++, and since developers tend to add members
78 // to those Fortran objects on the fly, using them in C++ would be prone to bugs.
79 // Here we tell C++ that the pointer is to an integer, i.e. int *. This could be anything, but int works.
80 typedef int* FortranPtr;
81 
82 #endif
const double PROTON_MASS
Definition: cpp_globals.hpp:38
KinType
Definition: cpp_globals.hpp:13
Simd< double > r
Definition: cpp_globals.hpp:60
Definition: cpp_globals.hpp:59
const double UNIT_CHARGE
Charge of an electron (C)
Definition: cpp_globals.hpp:35
gyroradius
Definition: cpp_globals.hpp:22
z coordinate
Definition: cpp_globals.hpp:20
Definition: cpp_globals.hpp:15
r coordinate
Definition: cpp_globals.hpp:19
2nd weight
Definition: cpp_globals.hpp:24
Definition: cpp_globals.hpp:10
const double PI
Definition: cpp_globals.hpp:39
ParticlePhase
Definition: cpp_globals.hpp:18
phi coordinate
Definition: cpp_globals.hpp:21
const int D1D_NPV1
Definition: cpp_globals.hpp:48
F0.
Definition: cpp_globals.hpp:31
Magnetic moment mu.
Definition: cpp_globals.hpp:29
Simd< double > z
Definition: cpp_globals.hpp:56
int * FortranPtr
Definition: cpp_globals.hpp:80
Simd< double > phi
Definition: cpp_globals.hpp:62
const double EV_2_J
Conversion rate ev to J.
Definition: cpp_globals.hpp:36
Simd< double > z
Definition: cpp_globals.hpp:61
Definition: cpp_globals.hpp:25
Simd< double > r
Definition: cpp_globals.hpp:55
W0.
Definition: cpp_globals.hpp:30
const int N_VF_DIAG
Definition: cpp_globals.hpp:44
const double TWOPI
Definition: cpp_globals.hpp:40
Definition: cpp_globals.hpp:54
KOKKOS_INLINE_FUNCTION void zero()
Definition: cpp_globals.hpp:65
SpeciesTypes
Definition: cpp_globals.hpp:8
1st weight
Definition: cpp_globals.hpp:23
Definition: cpp_globals.hpp:32
Definition: cpp_globals.hpp:14
ParticleConsts
Definition: cpp_globals.hpp:28
const int DIAG_HEAT_NVAR
Definition: cpp_globals.hpp:43
Definition: cpp_globals.hpp:9
const double J_2_EV
Conversion rate J to ev.
Definition: cpp_globals.hpp:37