XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
local_equil_profiles.hpp
Go to the documentation of this file.
1 #ifndef LOCAL_EQUIL_PROFILES_HPP
2 #define LOCAL_EQUIL_PROFILES_HPP
3 
4 #include "magnetic_field.hpp"
5 #include "species.hpp"
6 
7 // f0 profile information is required for conventional delta-f method (in dw/dt)
8 template<MarkerType MT> struct LocalEquilProfiles;
9 
10 template<>
17 
18  KOKKOS_INLINE_FUNCTION LocalEquilProfiles(const MagneticField<DeviceType>& magnetic_field, const Species<DeviceType>& species, const Simd<double>& psi, const SimdVector2D& x){
19  bool ftype_non_zero=(species.eq_flow_type>0);
20 
21  for (int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
22  f0tev[i_simd] = species.eq_temp.value(magnetic_field, psi[i_simd],x.r[i_simd],x.z[i_simd]);
23  f0dtev[i_simd] = species.eq_temp.slope(magnetic_field, psi[i_simd],x.r[i_simd],x.z[i_simd]);
24  f0dden_n[i_simd] = species.eq_den.slope(magnetic_field, psi[i_simd],x.r[i_simd],x.z[i_simd])/
25  species.eq_den.value(magnetic_field, psi[i_simd],x.r[i_simd],x.z[i_simd]);
26  f0flow[i_simd] = species.eq_flow.value(magnetic_field, psi[i_simd],x.r[i_simd],x.z[i_simd]);
27  f0dflow[i_simd] = species.eq_flow.slope(magnetic_field, psi[i_simd],x.r[i_simd],x.z[i_simd]);
28 
29  // Only flow_type=0 give consistent weight evolution
30  // When flow_type>0, the poloidal derivative of flow is ignored and inconsitent.
31  // Here, only unit conversion from omega to flow is considered.
32  f0flow[i_simd]=(ftype_non_zero)? f0flow[i_simd]*x.r[i_simd] : f0flow[i_simd];
33  f0dflow[i_simd]=(ftype_non_zero)? f0dflow[i_simd]*x.r[i_simd] : f0dflow[i_simd];
34  }
35  }
36 };
37 
38 template<>
40  KOKKOS_INLINE_FUNCTION LocalEquilProfiles(const MagneticField<DeviceType>& magnetic_field, const Species<DeviceType>& species, const Simd<double>& psi, const SimdVector2D& x){}
41 };
42 
43 #endif
MarkerType
Definition: globals.hpp:110
KOKKOS_INLINE_FUNCTION double slope(const MagneticField< DeviceType > &b_field, double psi_in, double r, double z) const
Definition: profile.hpp:352
Eq::Profile< Device > eq_den
Definition: species.hpp:133
Definition: magnetic_field.hpp:12
Simd< double > f0dflow
Definition: local_equil_profiles.hpp:16
Simd< double > f0dden_n
Definition: local_equil_profiles.hpp:13
int eq_flow_type
Definition: species.hpp:135
KOKKOS_INLINE_FUNCTION LocalEquilProfiles(const MagneticField< DeviceType > &magnetic_field, const Species< DeviceType > &species, const Simd< double > &psi, const SimdVector2D &x)
Definition: local_equil_profiles.hpp:18
Definition: local_equil_profiles.hpp:8
Simd< double > z
Definition: simd.hpp:141
Simd< double > f0tev
Definition: local_equil_profiles.hpp:12
KOKKOS_INLINE_FUNCTION LocalEquilProfiles(const MagneticField< DeviceType > &magnetic_field, const Species< DeviceType > &species, const Simd< double > &psi, const SimdVector2D &x)
Definition: local_equil_profiles.hpp:40
Simd< double > r
Definition: simd.hpp:140
Definition: magnetic_field.F90:1
Eq::Profile< Device > eq_flow
Definition: species.hpp:134
Definition: simd.hpp:139
Simd< double > f0dtev
Definition: local_equil_profiles.hpp:14
KOKKOS_INLINE_FUNCTION double value(const MagneticField< DeviceType > &b_field, double psi_in, double r, double z) const
Definition: profile.hpp:319
Definition: species.hpp:75
Eq::Profile< Device > eq_temp
Definition: species.hpp:132
Simd< double > f0flow
Definition: local_equil_profiles.hpp:15