XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
charge.hpp
Go to the documentation of this file.
1 #ifndef CHARGE_HPP
2 #define CHARGE_HPP
3 #include "space_settings.hpp"
4 #include "electric_field.hpp"
5 #include "perturbed_B_field.hpp"
6 
7 // Charge class
8 template<class Device>
9 class Charge {
10  public:
11 
12  // Constructor
13  Charge(int nnode,int npsi00,int nrho,int nlarmor, int ntor, int nthreads);
14  Charge(int nnode,int npsi00,int nrho,int nlarmor, int ntor,int npsi_adj_eden, int nthreads);
15 
16  // Default constructor
17  Charge(){}
18 
19  bool adjust_eden;
20 
21  // Arrays for particle-to-grid operations
22 #ifdef XGC1
23  Kokkos::View<double***,Kokkos::LayoutRight,Device> edensity;
24 #ifdef EXPLICIT_EM
25  Kokkos::View<double***,Kokkos::LayoutRight,Device> ejpar;
26  Kokkos::View<double****,Kokkos::LayoutRight,Device> ijpar;
27 #endif
28  Kokkos::View<double****,Kokkos::LayoutRight,Device> idensity;
29 #else
30  Kokkos::View<double**,Kokkos::LayoutRight,Device> edensity;
31  Kokkos::View<double***,Kokkos::LayoutRight,Device> ejpar_re;
32  Kokkos::View<double***,Kokkos::LayoutRight,Device> ejpar_im;
33 
34  Kokkos::View<double***,Kokkos::LayoutRight,Device> idensity;
35  Kokkos::View<double***,Kokkos::LayoutRight,Device> ijpar_re;
36  Kokkos::View<double***,Kokkos::LayoutRight,Device> ijpar_im;
37 #endif
38 
39  Kokkos::View<double**,Kokkos::LayoutRight,Device> adj_eden_rad_flux;
40  Kokkos::View<double**,Kokkos::LayoutRight,Device> adj_eden_wall_loss;
41 
42  KOKKOS_INLINE_FUNCTION void adjust_eden_port(const Grid<Device> &grid, const MagneticField<Device> &magnetic_field, const SimdParticles &part, const Simd<double> *vd) const ;
43  KOKKOS_INLINE_FUNCTION void adjust_eden_wall_loss_port(const Grid<Device> &grid, const MagneticField<Device> &magnetic_field, const Simd<bool>& lost_ptl, const SimdParticles &part, const Simd<double>& dw1) const ;
44 
45  void reset_charge() const;
46  void reset_adj_eden() const;
47 
48  void reset_ion_charge() const;
49 };
50 
51 template<class Device>
52 KOKKOS_INLINE_FUNCTION void adjust_eden_c(const TmpSpecies<Device>& tmp_species, const Grid<Device> &grid,
53  const MagneticField<Device> &magnetic_field, const ElectricField<Device> &electric_field,
54  const Charge<Device> &charge, const Simulation<Device> &sml, const Species<Device> &species,
55  const PerturbedBField<Device> &perturbed_B_field, int);
56 
57 #include "charge.tpp"
58 
59 #endif
Definition: perturbed_B_field.hpp:12
Kokkos::View< double **, Kokkos::LayoutRight, Device > adj_eden_wall_loss
Adjustment.
Definition: charge.hpp:40
Definition: sml.hpp:8
void reset_charge() const
Definition: charge.tpp:48
Definition: magnetic_field.hpp:9
Definition: electric_field.hpp:35
Definition: grid.hpp:10
Kokkos::View< double ***, Kokkos::LayoutRight, Device > ejpar_re
Definition: charge.hpp:31
Kokkos::View< double **, Kokkos::LayoutRight, Device > adj_eden_rad_flux
Adjustment.
Definition: charge.hpp:39
KOKKOS_INLINE_FUNCTION void adjust_eden_wall_loss_port(const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Simd< bool > &lost_ptl, const SimdParticles &part, const Simd< double > &dw1) const
Definition: charge.tpp:167
Kokkos::View< double ***, Kokkos::LayoutRight, Device > ejpar_im
Definition: charge.hpp:32
Kokkos::View< double ***, Kokkos::LayoutRight, Device > ijpar_im
Definition: charge.hpp:36
Kokkos::View< double ***, Kokkos::LayoutRight, Device > idensity
Ion density distribution.
Definition: charge.hpp:34
Kokkos::View< double ***, Kokkos::LayoutRight, Device > ijpar_re
Definition: charge.hpp:35
void reset_ion_charge() const
Definition: charge.tpp:63
void reset_adj_eden() const
Definition: charge.tpp:78
Definition: particles.hpp:31
bool adjust_eden
Determines whether to do the adjustment to electron density.
Definition: charge.hpp:19
Kokkos::View< double **, Kokkos::LayoutRight, Device > edensity
Electron density distribution.
Definition: charge.hpp:30
Definition: magnetic_field.F90:1
KOKKOS_INLINE_FUNCTION void adjust_eden_port(const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const SimdParticles &part, const Simd< double > *vd) const
Definition: charge.tpp:122
Definition: species.hpp:13
Definition: charge.hpp:9
Charge()
Definition: charge.hpp:17
Definition: species.hpp:71
KOKKOS_INLINE_FUNCTION void adjust_eden_c(const TmpSpecies< Device > &tmp_species, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const ElectricField< Device > &electric_field, const Charge< Device > &charge, const Simulation< Device > &sml, const Species< Device > &species, const PerturbedBField< Device > &perturbed_B_field, int)
Definition: charge.tpp:89