XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tracer_routines.hpp
Go to the documentation of this file.
1 #ifndef TRACER_ROUTINES_HPP
2 #define TRACER_ROUTINES_HPP
3 
4 #ifdef ESC_PTL
5 KOKKOS_INLINE_FUNCTION void flag_set(long long int &flags, const bool tf, const long long int flag_loc);
6 KOKKOS_INLINE_FUNCTION bool flag_check(const long long int flags, const long long int flag_loc);
7 template<class Device>
8 KOKKOS_INLINE_FUNCTION void update_particle_flag1(const PushControls &push_controls, const MagneticField<Device> &magnetic_field, SimdParticles &part_tmp, Simd<double> &psi);
9 
10 // Explicitly set length to 64 bits to keep same length as double
11 const long long int tracer_is_to_write{1}; // need to write
12 const long long int tracer_is_in_init{2}; // inside of separatrix initially -- Not used here
13 const long long int tracer_is_written{4}; // inside of separatrix before push -- Not used here
14 const long long int tracer_is_escaped{8}; // True: Particle crossed the separatrix into the SOL during particle push.
15  // False: Particle did not cross separatrix during particle push
16 const long long int tracer_is_divertor{16}; // why write - just hit the divertor
17 const long long int tracer_is_outboard{32}; // when write - is this outboard?
18 const long long int tracer_was_inside{64}; // aux flag to indicate if the particle was inside before push
19 const long long int tracer_is_tracked{128}; // True: Particle contributes to diffusion analysis
20 
21 // dw can use 38 bits. dw * 2^nb1 will be saved as integer value.
22 // Let dw be between min_dw and max_dw
23 // This should not exceed 2^(63-nb1-nb2)
24 const int tracer_flag_bits = 8;
25 const int tracer_step_bits = 17;
26 const int tracer_flag_step_bits = tracer_flag_bits + tracer_step_bits; //25
27 const int tracer_dw_factor_bits = 28; // should not exceed 31. bits to make dw flot to integer
28 
29 const long long int tracer_flag_step_mask{(1u<<tracer_flag_step_bits)-1}; // 8 bits are used for flag. 17 bits integer is used for esc_step. Above it will be used for dw
30 const long long int tracer_flag_mask{(1u<<tracer_flag_bits)-1}; // mask for zero out above 8 bits - '<<8' makes 8 zeros and '-1' makes them 8 ones.
31 #include "tracer_routines.tpp"
32 #endif
33 // ESC_PTL above
34 #endif
KOKKOS_INLINE_FUNCTION void update_particle_flag1(const PushControls &push_controls, const MagneticField< Device > &magnetic_field, SimdParticles &part_tmp, Simd< double > &psi)
Definition: tracer_routines.tpp:25
Definition: push_controls.hpp:8
Definition: magnetic_field.hpp:9
KOKKOS_INLINE_FUNCTION bool flag_check(const long long int flags, const long long int flag_loc)
Definition: tracer_routines.tpp:12
KOKKOS_INLINE_FUNCTION void flag_set(long long int &flags, const bool tf, const long long int flag_loc)
Definition: tracer_routines.tpp:6
Definition: particles.hpp:58
Definition: magnetic_field.F90:1