All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Go to the documentation of this file.
1 #ifndef PTB_3DB_HPP
2 #define PTB_3DB_HPP
4 struct PertVec {
5  double r;
6  double z;
7  double phi;
8 };
10 // Perturbed magnetic field class
11 template<class Device>
13  public:
15  // Field variables
16  bool rampup_vac;
17  int num_ntor;
20  int start_time;
22  // Field arrays
23  Kokkos::View<int*,Kokkos::LayoutRight,Device> ntor;
24  Kokkos::View<PertVec**,Kokkos::LayoutRight,Device> bfield_im_vac;
25  Kokkos::View<PertVec**,Kokkos::LayoutRight,Device> bfield_re_vac;
26  Kokkos::View<PertVec**,Kokkos::LayoutRight,Device> bfield_im;
27  Kokkos::View<PertVec**,Kokkos::LayoutRight,Device> bfield_re;
29  // Constructor
30  PerturbedBField(bool rampup_vac_in, int num_ntor_in, int rampup_interval_in, int rampup_time_in, int start_time_in, int nnode_in, int *ntor_in);
32  // Null constructor if ptb_3db is off
35  // Get perturbed b-field
36  KOKKOS_INLINE_FUNCTION void get_delta_b(const Simulation<Device> &sml, const Grid<Device> &grid, const Simd<double>& fld_phi, const Simd<int>& itr, const SimdGridVec &p, SimdVector &tdb) const;
38 };
40 #include "perturbed_B_field.tpp"
41 #endif
double r
Definition: perturbed_B_field.hpp:5
Definition: globals.hpp:59
Definition: perturbed_B_field.hpp:12
double phi
Definition: perturbed_B_field.hpp:7
int rampup_time
Number of time steps over which the perturbed field is ramped up.
Definition: perturbed_B_field.hpp:19
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_im
perturbed magnetic field on XGC mesh, imaginary part
Definition: perturbed_B_field.hpp:26
Definition: perturbed_B_field.hpp:4
Definition: sml.hpp:8
double z
Definition: perturbed_B_field.hpp:6
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:25
int rampup_interval
Number of time steps over which the perturbed field is constant during ramp-up.
Definition: perturbed_B_field.hpp:18
Definition: grid.hpp:10
Kokkos::View< int *, Kokkos::LayoutRight, Device > ntor
Array to store the toroidal mode numbers.
Definition: perturbed_B_field.hpp:23
int num_ntor
Number of toroidal mode numbers (&lt;= sml_nphi_total)
Definition: perturbed_B_field.hpp:17
Definition: grid_structs.hpp:7
Definition: perturbed_B_field.hpp:33
bool rampup_vac
(.true.) Ramp up perturbed field slowly, (.false.) turn on perturbed field abruptly ...
Definition: perturbed_B_field.hpp:16
KOKKOS_INLINE_FUNCTION void get_delta_b(const Simulation< Device > &sml, const Grid< Device > &grid, const Simd< double > &fld_phi, const Simd< int > &itr, const SimdGridVec &p, SimdVector &tdb) const
Definition: perturbed_B_field.tpp:32
int start_time
Time step in which perturbed field is switched on.
Definition: perturbed_B_field.hpp:20
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_re
perturbed magnetic field on XGC mesh, real part
Definition: perturbed_B_field.hpp:27
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_im_vac
perturbed vacuum field on XGC mesh, imaginary part
Definition: perturbed_B_field.hpp:24