All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Go to the documentation of this file.
1 #ifndef SML_HPP
2 #define SML_HPP
3 #include "space_settings.hpp"
4 #include "NamelistReader.hpp"
6 // Simulation class
7 template<class Device>
8 class Simulation {
9  public:
11  // Constructor
14 #ifdef XGCA
15  static constexpr bool is_XGCa = true;
16 #else
17  static constexpr bool is_XGCa = false;
18 #endif
20 #ifdef DELTAF_CONV
21  static constexpr bool reduced_deltaf = true;
22 #else
23  static constexpr bool reduced_deltaf = false;
24 #endif
26 #if defined(DELTAF_CONV_SEPARATE_N0) || !defined(DELTAF_CONV)
27  static constexpr bool separate_n0 = true;
28 #else
29  static constexpr bool separate_n0 = false;
30 #endif
32 #ifdef EXPLICIT_EM
33  static constexpr bool explicit_electromagnetic = true;
34 #else
35  static constexpr bool explicit_electromagnetic = false;
36 #endif
39  static constexpr bool old_f0_update_analytic = true;
40 #else
41  static constexpr bool old_f0_update_analytic = false;
42 #endif
44  // Input parameters
45  int bounce;
47  double bounce_buffer;
48  double dt;
51  bool ptb_3db_on;
52  bool drift_on;
53  bool neutrals;
54  bool diag_heat_on;
55  bool deltaf;
56  bool xz_00_up;
57  int mstep;
58  int nrk;
59  bool electron_on;
60  bool f0_grid;
62  int special;
63  int nthreads;
67  bool field_solver_on=true;
70  bool dwdt_fix_bg; // 1-w factor in dwdt
71  bool dwdt_exb_only; // excluding grad-b drift in dwdt
81  bool em_control_variate_final_cv; // Should be local variable/argument
82  bool em_control_variate_flag; // Should be local variable/argument
85  bool em_es_step;
94  // Used in getf0
96  double dpot_te_limit;
98  // Used in update_f0
99  bool no_fp_in_f;
101  double f0_grid_alpha;
114  bool ignore_f0g;
118  // Diffusion
119  bool diff_on;
121  // Resampling
122  bool resamp_on;
126  // marker setup
142  // Simulation variables
143  double time;
144  int gstep;
147  int mr_factor[5];
149  double mr_psi_max[5];
151  // RMP penetration calculation
158  // Core-edge coupling
161  // Push performance - could be elsewhere
164  // Loop-voltage (for driving the equilibrium current)
165  double loop_voltage;
167 };
169 #include "sml.tpp"
170 #endif
bool multirate_timestepping
Use multirate timestepping.
Definition: sml.hpp:146
Simulation(NLReader::NamelistReader &nlr)
Definition: sml.tpp:5
double f0_update_analytic_damp_width
Definition: sml.hpp:109
bool resamp_for_final_restart_write
Perform resampling before dumping the final restart file.
Definition: sml.hpp:123
double f0_grid_alpha
Definition: sml.hpp:101
double flat_marker_width2
Definition: sml.hpp:137
bool em_control_variate_flag
Definition: sml.hpp:82
double flat_marker_decay_start1
Definition: sml.hpp:132
static constexpr bool separate_n0
Equivalent to the preprocessor flag for now.
Definition: sml.hpp:27
bool em_mixed_variable
Switch for use of mixed-variable formulation.
Definition: sml.hpp:73
double initial_deltaf_noise
Definition: sml.hpp:138
bool drift_on
Toggle for using drift.
Definition: sml.hpp:52
int nrk
Order of Runge-Kutta time integration of particles + fields.
Definition: sml.hpp:58
Definition: sml.hpp:8
static constexpr bool is_XGCa
Equivalent to the preprocessor flag for now.
Definition: sml.hpp:17
static constexpr bool explicit_electromagnetic
Equivalent to the preprocessor flag for now.
Definition: sml.hpp:35
double low_mu_fill_population
Definition: sml.hpp:140
Definition: NamelistReader.hpp:193
int mstep_rmp_es
Definition: sml.hpp:152
bool exclude_private
Whether to exclude private region in ion charge deposition.
Definition: sml.hpp:87
int bounce_zero_weight
If ==1 and bounce&gt;0, set particle weights to zero after bouncing from the outer boundary.
Definition: sml.hpp:46
double flat_marker_decay_start2
Definition: sml.hpp:133
int gstep
Current time step.
Definition: sml.hpp:144
bool em_es_step
Definition: sml.hpp:85
bool split_weight_scheme
Whether to use the split-weight scheme.
Definition: sml.hpp:69
bool diag_heat_on
Use heat diagnostics in sheath.
Definition: sml.hpp:54
bool xz_00_up
Use upper region of xz when obtaining 00 mode.
Definition: sml.hpp:56
bool update_poisson_solver
Whether poisson solver is updated.
Definition: sml.hpp:95
double mr_psi_max[5]
maximum normalized psi value of each multirate region
Definition: sml.hpp:149
static constexpr bool reduced_deltaf
Equivalent to the preprocessor flag for now.
Definition: sml.hpp:23
double loop_voltage_psimax
Inductive current drive: outer boundary (in pol. flux) of the loop voltage.
Definition: sml.hpp:166
double flat_marker_cutoff1
Definition: sml.hpp:134
bool field_solver_on
If false, charge deposition and field solve is skipped.
Definition: sml.hpp:67
int f0_grid_alpha_start
Definition: sml.hpp:111
int mr_factor[5]
Definition: sml.hpp:147
double loop_voltage
Inductive current drive: loop voltage (from Faraday&#39;s law curl(E)=-dB/dt)
Definition: sml.hpp:165
double marker_temp_factor3
Definition: sml.hpp:131
bool cce_coupling_on
Core-edge coupling flag.
Definition: sml.hpp:159
int nthreads
Number of OMP threads on the host.
Definition: sml.hpp:63
double marker_temp_factor
Definition: sml.hpp:129
int em_pullback_mode
Definition: sml.hpp:75
bool grad_psitheta
Definition: sml.hpp:89
bool ignore_f0g
Definition: sml.hpp:114
int restart_write_period
How many steps between restart writes.
Definition: sml.hpp:65
bool deltaf
Whether some species is deltaf.
Definition: sml.hpp:55
bool use_unfused_electron_push_kernel
Definition: sml.hpp:162
bool flat_marker
Definition: sml.hpp:128
bool sheath_adjust
Whether to adjust the sheath.
Definition: sml.hpp:50
bool resamp_on
Do resampling.
Definition: sml.hpp:122
double marker_min_temp
Definition: sml.hpp:139
double flat_marker_width1
Definition: sml.hpp:136
bool dwdt_exb_only
Definition: sml.hpp:71
int special
Special run (eg single particle, poincare)
Definition: sml.hpp:62
double time
Current simulation time.
Definition: sml.hpp:143
bool no_fp_in_f
Definition: sml.hpp:99
bool em_control_variate_final_cv
Definition: sml.hpp:81
int mstep_rmp_em
Definition: sml.hpp:154
bool f0_grid
Whether to use f0 grid.
Definition: sml.hpp:60
double flat_marker_cutoff2
Definition: sml.hpp:135
int sheath_mode
Type of sheath (0 is none)
Definition: sml.hpp:49
double dpot_te_limit
Max absolute value of dpot/temp in getf0.
Definition: sml.hpp:96
bool electron_on
Use kinetic electrons.
Definition: sml.hpp:59
double f0_update_analytic_alpha
Separate alpha from sml_f0_grid_alpha for Maxwellian contribution.
Definition: sml.hpp:108
int rmp_es_to_em_dt_ratio
Ratio of EM to ES time step size in RMP penetration calculation.
Definition: sml.hpp:156
bool em_b_para_eff
Effective dB_|| via a modified grad-B drift (Joiner et al., PoP, 2010)
Definition: sml.hpp:84
bool dwdt_fix_bg
Definition: sml.hpp:70
int mstep
Max number of time steps.
Definition: sml.hpp:57
bool field_aligned_initial
Definition: sml.hpp:127
bool limit_marker_den
Whether to limit marker density.
Definition: sml.hpp:61
bool f0_update_analytic
Definition: sml.hpp:105
double dt
Time step.
Definition: sml.hpp:48
int bounce
Bounce routine switch 0 for off, 1 for inner boundary, 2 for both boundaries.
Definition: sml.hpp:45
bool f0_update_analytic_local
If .false. –&gt; flux-surface average update, .true. –&gt; local.
Definition: sml.hpp:107
bool neutrals
Toggle for using neutrals.
Definition: sml.hpp:53
double marker_temp_factor2
Definition: sml.hpp:130
int em_control_variate_niter
Number of iterations for Ampere solve with control-variate method.
Definition: sml.hpp:83
bool ptb_3db_on
Toggle for ptb_3db.
Definition: sml.hpp:51
double bounce_buffer
Buffer width between sml_outpsi and where the particle actually bounces (must be &gt;=0) ...
Definition: sml.hpp:47
bool em_control_variate
Switch for use of control variate method.
Definition: sml.hpp:74
bool resamp_restart_read
Whether to read a restart file written from a simulation with different grid.
Definition: sml.hpp:124
bool diff_on
Definition: sml.hpp:119
static constexpr bool old_f0_update_analytic
Equivalent to the preprocessor flag for now.
Definition: sml.hpp:41