All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Go to the documentation of this file.
1 #ifndef CPP_PTB_3DB_HPP
2 #define CPP_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 };
41 #endif
double r
Definition: cpp_perturbed_B_field.hpp:5
Definition: cpp_globals.hpp:59
Definition: cpp_perturbed_B_field.hpp:12
double phi
Definition: cpp_perturbed_B_field.hpp:7
int rampup_time
Number of time steps over which the perturbed field is ramped up.
Definition: cpp_perturbed_B_field.hpp:19
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_im
perturbed magnetic field on XGC mesh, imaginary part
Definition: cpp_perturbed_B_field.hpp:26
Definition: cpp_perturbed_B_field.hpp:4
Definition: cpp_sml.hpp:7
double z
Definition: cpp_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: cpp_perturbed_B_field.hpp:25
int rampup_interval
Number of time steps over which the perturbed field is constant during ramp-up.
Definition: cpp_perturbed_B_field.hpp:18
Definition: cpp_grid.hpp:38
Kokkos::View< int *, Kokkos::LayoutRight, Device > ntor
Array to store the toroidal mode numbers.
Definition: cpp_perturbed_B_field.hpp:23
int num_ntor
Number of toroidal mode numbers (&lt;= sml_nphi_total)
Definition: cpp_perturbed_B_field.hpp:17
Definition: cpp_grid.hpp:6
Definition: cpp_perturbed_B_field.hpp:33
bool rampup_vac
(.true.) Ramp up perturbed field slowly, (.false.) turn on perturbed field abruptly ...
Definition: cpp_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: cpp_perturbed_B_field.tpp:33
int start_time
Time step in which perturbed field is switched on.
Definition: cpp_perturbed_B_field.hpp:20
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_re
perturbed magnetic field on XGC mesh, real part
Definition: cpp_perturbed_B_field.hpp:27
Kokkos::View< PertVec **, Kokkos::LayoutRight, Device > bfield_im_vac
perturbed vacuum field on XGC mesh, imaginary part
Definition: cpp_perturbed_B_field.hpp:24