XGCa
Classes | Enumerations | Functions | Variables
globals.hpp File Reference
#include <limits.h>
#include <string>
#include <cassert>
#include "space_settings.hpp"
#include "array_deep_copy.hpp"
#include "access_add.hpp"
#include "simd.hpp"
#include "constants.hpp"
Include dependency graph for globals.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  is_same_type< T, U >
 
struct  is_same_type< T, T >
 

Enumerations

enum class  Order { Zero , One , Two }
 
enum  SpeciesType { ELECTRON = 0 , MAIN_ION = 1 }
 
enum  KinType { DriftKin =0 , GyroKin =1 }
 
enum class  PhiInterpType { Planes , None }
 
enum class  MarkerType { ReducedDeltaF , FullF , TotalF , None }
 
enum class  FAnalyticShape { Maxwellian , SlowingDown , None }
 
enum class  WeightEvoEq { Direct , PDE , None }
 
enum class  MagneticFieldMode { Electromagnetic , Electrostatic }
 
enum class  BFieldSymmetry { Tokamak , Stellarator }
 
enum class  GeometryType { Toroidal , CylindricalLimit }
 
enum class  PullbackMethod { Electrostatic , IdealMHD }
 
enum  ParticlePhase {
  PIR = 0 , PIZ , PIP , PIRHO ,
  PIW1 , PIW2 , PTL_NPHASE
}
 
enum  ParticleConsts { PIM = 0 , PIW0 , PIF0 , PTL_NCONST }
 

Functions

int get_num_cpu_threads ()
 
bool is_rank_zero ()
 
void exit_XGC (std::string msg)
 
KOKKOS_INLINE_FUNCTION void assert_XGC (bool cond, const char *msg)
 
bool causes_multiplication_overflow (int a, int b)
 
bool causes_addition_overflow (int a, int b)
 
template<GeometryType GT>
KOKKOS_INLINE_FUNCTION double geometry_switch (double a, double b)
 
template<>
KOKKOS_INLINE_FUNCTION double geometry_switch< GeometryType::Toroidal > (double a, double b)
 
template<>
KOKKOS_INLINE_FUNCTION double geometry_switch< GeometryType::CylindricalLimit > (double a, double b)
 
template<GeometryType GT>
constexpr KOKKOS_INLINE_FUNCTION bool use_toroidal_terms ()
 
template<>
constexpr KOKKOS_INLINE_FUNCTION bool use_toroidal_terms< GeometryType::CylindricalLimit > ()
 
template<>
constexpr KOKKOS_INLINE_FUNCTION bool use_toroidal_terms< GeometryType::Toroidal > ()
 
KOKKOS_INLINE_FUNCTION int divide_and_round_up (int a, int b)
 
KOKKOS_INLINE_FUNCTION unsigned positive_modulo (int value, unsigned m)
 
long long int offsets_of_even_distribution (long long int n_obj, long long int n_subsets, long long int i_subset)
 
long long int counts_of_even_distribution (long long int n_obj, long long int n_subsets, long long int i_subset)
 
std::string formatted_int2str (int input, int n_digits)
 

Variables

constexpr PhiInterpType PIT_GLOBAL = PhiInterpType::None
 
constexpr MagneticFieldMode MFM_GLOBAL = MagneticFieldMode::Electrostatic
 
constexpr BFieldSymmetry BFS_GLOBAL = BFieldSymmetry::Tokamak
 
constexpr GeometryType GEOMETRY = GeometryType::Toroidal
 
bool global_debug_flag
 
bool global_perf_barriers_flag
 

Enumeration Type Documentation

◆ BFieldSymmetry

enum BFieldSymmetry
strong
Enumerator
Tokamak 
Stellarator 

◆ FAnalyticShape

enum FAnalyticShape
strong
Enumerator
Maxwellian 
SlowingDown 
None 

◆ GeometryType

enum GeometryType
strong
Enumerator
Toroidal 
CylindricalLimit 

◆ KinType

enum KinType
Enumerator
DriftKin 
GyroKin 

◆ MagneticFieldMode

enum MagneticFieldMode
strong
Enumerator
Electromagnetic 
Electrostatic 

◆ MarkerType

enum MarkerType
strong
Enumerator
ReducedDeltaF 
FullF 
TotalF 
None 

◆ Order

enum Order
strong
Enumerator
Zero 
One 
Two 

◆ ParticleConsts

Enumerator
PIM 

Magnetic moment mu.

PIW0 

W0.

PIF0 

F0.

PTL_NCONST 

◆ ParticlePhase

Enumerator
PIR 

r coordinate

PIZ 

z coordinate

PIP 

phi coordinate

PIRHO 

gyroradius

PIW1 

1st weight

PIW2 

2nd weight

PTL_NPHASE 

◆ PhiInterpType

enum PhiInterpType
strong
Enumerator
Planes 
None 

◆ PullbackMethod

enum PullbackMethod
strong
Enumerator
Electrostatic 
IdealMHD 

◆ SpeciesType

Enumerator
ELECTRON 
MAIN_ION 

◆ WeightEvoEq

enum WeightEvoEq
strong
Enumerator
Direct 
PDE 
None 

Function Documentation

◆ assert_XGC()

KOKKOS_INLINE_FUNCTION void assert_XGC ( bool  cond,
const char *  msg 
)
Here is the caller graph for this function:

◆ causes_addition_overflow()

bool causes_addition_overflow ( int  a,
int  b 
)
inline
Here is the caller graph for this function:

◆ causes_multiplication_overflow()

bool causes_multiplication_overflow ( int  a,
int  b 
)
inline
Here is the caller graph for this function:

◆ counts_of_even_distribution()

long long int counts_of_even_distribution ( long long int  n_obj,
long long int  n_subsets,
long long int  i_subset 
)
inline
Here is the caller graph for this function:

◆ divide_and_round_up()

KOKKOS_INLINE_FUNCTION int divide_and_round_up ( int  a,
int  b 
)
Here is the caller graph for this function:

◆ exit_XGC()

void exit_XGC ( std::string  msg)
inline
Here is the caller graph for this function:

◆ formatted_int2str()

std::string formatted_int2str ( int  input,
int  n_digits 
)
inline
Here is the caller graph for this function:

◆ geometry_switch()

template<GeometryType GT>
KOKKOS_INLINE_FUNCTION double geometry_switch ( double  a,
double  b 
)

Returns the first input argument if using normal toroidal geometry, and the second input argument if using the cylindrical limit

Parameters
[in]ais the first option
[in]bis the second option
Returns
double the chosen option

◆ geometry_switch< GeometryType::CylindricalLimit >()

template<>
KOKKOS_INLINE_FUNCTION double geometry_switch< GeometryType::CylindricalLimit > ( double  a,
double  b 
)

◆ geometry_switch< GeometryType::Toroidal >()

template<>
KOKKOS_INLINE_FUNCTION double geometry_switch< GeometryType::Toroidal > ( double  a,
double  b 
)

◆ get_num_cpu_threads()

int get_num_cpu_threads ( )
inline
Here is the caller graph for this function:

◆ is_rank_zero()

bool is_rank_zero ( )
inline
Here is the caller graph for this function:

◆ offsets_of_even_distribution()

long long int offsets_of_even_distribution ( long long int  n_obj,
long long int  n_subsets,
long long int  i_subset 
)
inline
Here is the caller graph for this function:

◆ positive_modulo()

KOKKOS_INLINE_FUNCTION unsigned positive_modulo ( int  value,
unsigned  m 
)
Here is the caller graph for this function:

◆ use_toroidal_terms()

template<GeometryType GT>
constexpr KOKKOS_INLINE_FUNCTION bool use_toroidal_terms ( )
constexpr

Returns true if using normal toroidal geometry, false if using the cylindrical limit

◆ use_toroidal_terms< GeometryType::CylindricalLimit >()

template<>
constexpr KOKKOS_INLINE_FUNCTION bool use_toroidal_terms< GeometryType::CylindricalLimit > ( )
constexpr

◆ use_toroidal_terms< GeometryType::Toroidal >()

template<>
constexpr KOKKOS_INLINE_FUNCTION bool use_toroidal_terms< GeometryType::Toroidal > ( )
constexpr

Variable Documentation

◆ BFS_GLOBAL

constexpr BFieldSymmetry BFS_GLOBAL = BFieldSymmetry::Tokamak
constexpr

◆ GEOMETRY

constexpr GeometryType GEOMETRY = GeometryType::Toroidal
constexpr

◆ global_debug_flag

bool global_debug_flag
extern

◆ global_perf_barriers_flag

bool global_perf_barriers_flag
extern

◆ MFM_GLOBAL

constexpr MagneticFieldMode MFM_GLOBAL = MagneticFieldMode::Electrostatic
constexpr

◆ PIT_GLOBAL

constexpr PhiInterpType PIT_GLOBAL = PhiInterpType::None
constexpr