XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends 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 #include "field.hpp"
6 
7 extern "C" void get_3db_rampup_fac(const double *rampup_fac);
8 
9 // Perturbed magnetic field class
10 template<class Device>
12  public:
13 
14  // Field variables
15  bool rampup_vac;
16  int num_ntor;
18  int start_time;
19  int mode;
20  bool full_spec_on;
21 
22  double rampup_fac;
23 
24  // Field arrays
25  Kokkos::View<int*,Kokkos::LayoutRight,Device> ntor;
26  Kokkos::View<Field<VarType::Vector,PhiInterpType::None>**,Kokkos::LayoutRight,Device> bfield_im_vac;
27  Kokkos::View<Field<VarType::Vector,PhiInterpType::None>**,Kokkos::LayoutRight,Device> bfield_re_vac;
28 
29  // Constructor
30  PerturbedBField(NLReader::NamelistReader& nlr, bool rampup_vac_in, int num_ntor_in,
31  int rampup_time_in, int start_time_in,
32  int nnode_in, int *ntor_in);
33 
34  // Null constructor if ptb_3db is off
36 
37  // Update ramp_up
40  }
41 
42  // Get perturbed b-field
43  KOKKOS_INLINE_FUNCTION void get_delta_b(const Grid<Device> &grid, const Simd<double>& phi, const SimdGridWeights<Order::One, PhiInterpType::None>& grid_wts, SimdVector &tdb) const;
44 
45 };
46 
47 #include "perturbed_B_field.tpp"
48 #endif
double rampup_fac
The current relative amplitude of the vacuum vector potential (if ptb_3db_mode==2) - this is updated ...
Definition: perturbed_B_field.hpp:22
int mode
Mode of RMP operation (details in XGC_core/module_ptb_3db.F90 –&gt; ptb_3db_mode)
Definition: perturbed_B_field.hpp:19
void get_3db_rampup_fac(const double *rampup_fac)
void update_rampup_fac_from_fortran() const
Definition: perturbed_B_field.hpp:38
Definition: simd.hpp:149
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:17
bool full_spec_on
(EM-only) whether to retain the full RMP spectrum from M3D-C1 or only |m/q-n|&lt;=sml_mode_select_mres_q...
Definition: perturbed_B_field.hpp:20
Definition: grid_weights.hpp:47
Definition: NamelistReader.hpp:193
Definition: grid.hpp:67
Kokkos::View< int *, Kokkos::LayoutRight, Device > ntor
Array to store the toroidal mode numbers.
Definition: perturbed_B_field.hpp:25
int num_ntor
Number of toroidal mode numbers (&lt;= sml_nphi_total)
Definition: perturbed_B_field.hpp:16
KOKKOS_INLINE_FUNCTION void get_delta_b(const Grid< Device > &grid, const Simd< double > &phi, const SimdGridWeights< Order::One, PhiInterpType::None > &grid_wts, SimdVector &tdb) const
Definition: perturbed_B_field.tpp:34
Kokkos::View< Field< VarType::Vector, PhiInterpType::None > **, Kokkos::LayoutRight, Device > bfield_im_vac
perturbed vacuum field on XGC mesh, imaginary part
Definition: perturbed_B_field.hpp:26
PerturbedBField()
Definition: perturbed_B_field.hpp:35
bool rampup_vac
(.true.) Ramp up perturbed field slowly, (.false.) turn on perturbed field abruptly ...
Definition: perturbed_B_field.hpp:15
int start_time
Time step in which perturbed field is switched on.
Definition: perturbed_B_field.hpp:18
Kokkos::View< Field< VarType::Vector, PhiInterpType::None > **, 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:27