XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
globals.hpp
Go to the documentation of this file.
1 #ifndef GLOBALS_HPP
2 #define GLOBALS_HPP
3 #include "space_settings.hpp"
4 #include "array_deep_copy.hpp"
5 #include "access_add.hpp"
6 #include "simd.hpp"
7 
8 enum SpeciesType {
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
Definition: globals.hpp:9
Simd< double > r
Definition: globals.hpp:60
Magnetic moment mu.
Definition: globals.hpp:29
Definition: globals.hpp:59
gyroradius
Definition: globals.hpp:22
int * FortranPtr
Definition: globals.hpp:80
const double EV_2_J
Conversion rate ev to J.
Definition: globals.hpp:36
Definition: globals.hpp:14
W0.
Definition: globals.hpp:30
Definition: globals.hpp:25
const double TWOPI
Definition: globals.hpp:40
const double UNIT_CHARGE
Charge of an electron (C)
Definition: globals.hpp:35
const int DIAG_HEAT_NVAR
Definition: globals.hpp:43
r coordinate
Definition: globals.hpp:19
const int N_VF_DIAG
Definition: globals.hpp:44
Simd< double > z
Definition: globals.hpp:56
Definition: globals.hpp:32
Definition: globals.hpp:15
const int D1D_NPV1
Definition: globals.hpp:48
Simd< double > phi
Definition: globals.hpp:62
ParticlePhase
Definition: globals.hpp:18
Simd< double > z
Definition: globals.hpp:61
2nd weight
Definition: globals.hpp:24
KinType
Definition: globals.hpp:13
Simd< double > r
Definition: globals.hpp:55
Definition: globals.hpp:10
F0.
Definition: globals.hpp:31
Definition: globals.hpp:54
KOKKOS_INLINE_FUNCTION void zero()
Definition: globals.hpp:65
phi coordinate
Definition: globals.hpp:21
const double PROTON_MASS
Definition: globals.hpp:38
const double J_2_EV
Conversion rate J to ev.
Definition: globals.hpp:37
1st weight
Definition: globals.hpp:23
const double PI
Definition: globals.hpp:39
ParticleConsts
Definition: globals.hpp:28
z coordinate
Definition: globals.hpp:20
SpeciesType
Definition: globals.hpp:8