XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
perturbed_B_field.hpp
Go to the documentation of this file.
1 #ifndef PTB_3DB_HPP
2 #define PTB_3DB_HPP
3 #include "NamelistReader.hpp"
4 #include "grid.hpp"
5 
6 #include "push_controls.hpp"
7 
8 struct PertVec {
9  double r;
10  double z;
11  double phi;
12 };
13 
14 // Perturbed magnetic field class
15 template<class Device>
17  public:
18 
19  // Field variables
20  bool rampup_vac;
21  int num_ntor;
24  int start_time;
25  int mode;
27 
28  // Field arrays
29  Kokkos::View<int*,Kokkos::LayoutRight,Device> ntor;
30  Kokkos::View<PertVec**,Kokkos::LayoutRight,Device> bfield_im_vac;
31  Kokkos::View<PertVec**,Kokkos::LayoutRight,Device> bfield_re_vac;
32  Kokkos::View<PertVec**,Kokkos::LayoutRight,Device> bfield_im;
33  Kokkos::View<PertVec**,Kokkos::LayoutRight,Device> bfield_re;
34 
35  // Constructor
36  PerturbedBField(NLReader::NamelistReader& nlr, bool rampup_vac_in, int num_ntor_in,
37  int rampup_interval_in, int rampup_time_in, int start_time_in,
38  int nnode_in, int *ntor_in);
39 
40  // Null constructor if ptb_3db is off
42 
43  // Get perturbed b-field
44  KOKKOS_INLINE_FUNCTION void get_delta_b(const PushControls &push_controls, const Grid<Device> &grid, const Simd<double>& fld_phi, const Simd<int>& itr, const SimdGridVec &p, SimdVector &tdb) const;
45 
46 };
47 
48 #include "perturbed_B_field.tpp"
49 #endif
double r
Definition: perturbed_B_field.hpp:9
int mode
Mode of RMP operation (details in XGC_core/module_ptb_3db.F90 –&gt; ptb_3db_mode)
Definition: perturbed_B_field.hpp:25
Definition: simd.hpp:144
Definition: perturbed_B_field.hpp:16
double phi
Definition: perturbed_B_field.hpp:11
int rampup_time
Number of time steps over which the perturbed field is ramped up.
Definition: perturbed_B_field.hpp:23
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_im
perturbed magnetic field on XGC mesh, imaginary part
Definition: perturbed_B_field.hpp:32
Definition: perturbed_B_field.hpp:8
Definition: push_controls.hpp:8
Definition: NamelistReader.hpp:163
double z
Definition: perturbed_B_field.hpp:10
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_re_vac
perturbed vacuum field on XGC mesh, real part, dimensions: (grid vertex, R-Z-phi components, tor. mode number)
Definition: perturbed_B_field.hpp:31
int rampup_interval
Number of time steps over which the perturbed field is constant during ramp-up.
Definition: perturbed_B_field.hpp:22
Definition: grid.hpp:10
int jpar_avg_period
Averaging period for the perturbed current in time steps.
Definition: perturbed_B_field.hpp:26
Kokkos::View< int *, Kokkos::LayoutRight, Device > ntor
Array to store the toroidal mode numbers.
Definition: perturbed_B_field.hpp:29
int num_ntor
Number of toroidal mode numbers (&lt;= sml_nphi_total)
Definition: perturbed_B_field.hpp:21
Definition: grid_structs.hpp:7
PerturbedBField()
Definition: perturbed_B_field.hpp:41
KOKKOS_INLINE_FUNCTION void get_delta_b(const PushControls &push_controls, const Grid< Device > &grid, const Simd< double > &fld_phi, const Simd< int > &itr, const SimdGridVec &p, SimdVector &tdb) const
Definition: perturbed_B_field.tpp:37
bool rampup_vac
(.true.) Ramp up perturbed field slowly, (.false.) turn on perturbed field abruptly ...
Definition: perturbed_B_field.hpp:20
int start_time
Time step in which perturbed field is switched on.
Definition: perturbed_B_field.hpp:24
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_re
perturbed magnetic field on XGC mesh, real part
Definition: perturbed_B_field.hpp:33
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_im_vac
perturbed vacuum field on XGC mesh, imaginary part
Definition: perturbed_B_field.hpp:30