All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Go to the documentation of this file.
1 #ifndef EQUIL_HPP
2 #define EQUIL_HPP
3 #include "space_settings.hpp"
4 #include "simd.hpp"
6 // Options for generating analytic equilibrium for testing
7 enum PsiOption{
8  NoXPoints = 0,
11 };
13 template<class Device>
14 class Equilibrium {
16  public:
18  Equilibrium(double eq_min_r, double eq_max_r, double eq_min_z, double eq_max_z,
19  double eq_x_psi, double epsil_psi_in, double eq_x_r, double eq_x_slope, double eq_x_z,
20  double eq_x2_r, double eq_x2_slope, double eq_x2_z, double eq_x2_psi, double eq_axis_r,
21  double eq_axis_z, int eq_mpsi);
23  // Constructor for tests
25  : min_r(0.5),
26  max_r(2.5),
27  min_z(-1.0),
28  max_z(1.0),
30  // Axis
31  axis_r(1.5),
32  axis_z(0.1),
34  epsil_psi(1.0e-05),
36  // Xpt1
37  // XGC simulates circular case by putting the xpoint outside the model
38  // Place xpoint below min_z if no X-points
39  // Circular case still uses xpt_psi as a reference, but it's far away; so increase it
40  xpt_r(1.6),
41  xpt_z((psi_opt == NoXPoints) ? (min_z - 1.0) : -0.8),
42  xpt_slope(-0.5),
43  xpt_psi((psi_opt == NoXPoints) ? 5.0 : .8),
45  // Xpt2
46  xpt2_r(1.4),
47  xpt2_z(0.7),
48  xpt2_slope(-0.5),
49  xpt2_psi(1.0),
50  set_xpt2(psi_opt == TwoXPoints),
52  // Used by profile testing
53  out_decay_factor(0.25),
54  out_decay_width(2.0),
57  {}
59  // Default constructor
62  KOKKOS_INLINE_FUNCTION bool is_in_region_1_or_2(double r,double z,double psi) const;
63  KOKKOS_INLINE_FUNCTION bool is_in_region_1(double r,double z,double psi) const;
64  KOKKOS_INLINE_FUNCTION void check_boundaries(const SimdVector2D& x, Simd<bool>& rz_outside) const;
65  KOKKOS_INLINE_FUNCTION void get_theta(const SimdVector2D& x, Simd<double>& theta) const;
67  void set_decay_factors(double out_decay_factor_in, double priv_flux_decay_factor_in, double out_decay_width_in, double priv_flux_decay_width_in, bool set_xpt2_in);
69  // Equil variables
70  double min_r;
71  double max_r;
72  double min_z;
73  double max_z;
74  double xpt_psi;
75  double epsil_psi;
76  double xpt_r;
77  double xpt_slope;
78  double xpt_z;
79  double xpt2_r;
80  double xpt2_slope;
81  double xpt2_z;
82  double xpt2_psi;
83  double axis_r;
84  double axis_z;
85  int mpsi;
87  // Use in eq profile calculations
90  double out_decay_width;
92  bool set_xpt2;
93 };
95 #include "equil.tpp"
97 #endif
Definition: equil.hpp:9
double xpt_psi
Psi coordinate of 1st X-point.
Definition: equil.hpp:74
Definition: equil.hpp:7
void set_decay_factors(double out_decay_factor_in, double priv_flux_decay_factor_in, double out_decay_width_in, double priv_flux_decay_width_in, bool set_xpt2_in)
Definition: equil.tpp:31
KOKKOS_INLINE_FUNCTION void get_theta(const SimdVector2D &x, Simd< double > &theta) const
Definition: equil.tpp:96
double min_r
Minimum r.
Definition: equil.hpp:70
KOKKOS_INLINE_FUNCTION bool is_in_region_1_or_2(double r, double z, double psi) const
Definition: equil.tpp:45
double min_z
Minimum z.
Definition: equil.hpp:72
double max_r
Maximum r.
Definition: equil.hpp:71
double xpt2_slope
Slope (which slope?) at 2nd X-point.
Definition: equil.hpp:80
double max_z
Maximum z.
Definition: equil.hpp:73
double xpt_slope
Slope (which slope?) at 1st X-point.
Definition: equil.hpp:77
double priv_flux_decay_width
width for exponential decay in private flux region
Definition: equil.hpp:91
int mpsi
Not sure?
Definition: equil.hpp:85
double xpt_r
r coordinate of 1st X-point
Definition: equil.hpp:76
double out_decay_width
width for exponential decay for psi&gt;sml_outpsi
Definition: equil.hpp:90
double epsil_psi
Not sure?
Definition: equil.hpp:75
double xpt2_psi
psi coordinate at 2nd X-point
Definition: equil.hpp:82
double axis_z
z coordinate of axis
Definition: equil.hpp:84
double axis_r
r coordinate of axis
Definition: equil.hpp:83
KOKKOS_INLINE_FUNCTION void check_boundaries(const SimdVector2D &x, Simd< bool > &rz_outside) const
Definition: equil.tpp:84
Equilibrium(PsiOption psi_opt)
Definition: equil.hpp:24
Definition: simd.hpp:18
Definition: equil.hpp:10
Definition: simd.hpp:139
double out_decay_factor
profiles decay exponentially to f(sml_outpsi)/decay_factor for psi&gt;sml_outpsi
Definition: equil.hpp:88
double xpt_z
z coordinate of 1st X-point
Definition: equil.hpp:78
double priv_flux_decay_factor
profiles decay exponentially to f(sml_outpsi)/decay_factor in priv. flux region
Definition: equil.hpp:89
bool set_xpt2
whether xpt2 is set
Definition: equil.hpp:92
KOKKOS_INLINE_FUNCTION bool is_in_region_1(double r, double z, double psi) const
Definition: equil.tpp:69
Definition: equil.hpp:60
Definition: equil.hpp:8
double xpt2_r
r coordinate of 2nd X-point
Definition: equil.hpp:79
Definition: equil.hpp:14
double xpt2_z
z coordinate at 2nd X-point
Definition: equil.hpp:81