XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vgrid_distribution.hpp
Go to the documentation of this file.
1 #ifndef VGRID_DISTRIBUTION_HPP
2 #define VGRID_DISTRIBUTION_HPP
3 
4 #include "space_settings.hpp"
5 #include "velocity_grid.hpp"
6 #include "view_arithmetic.hpp"
7 #include "velocity_grid.hpp"
9 
10 template<class Device>
12  public:
13 
14  Kokkos::View<double****,Kokkos::LayoutRight, Device> f;
15 
16  // Make f private when possible - ALS
17  //public:
18 
19  double vp_max;
20  double dvp;
21  double smu_max;
22  double dsmu;
24 
26 
27  VGridDistribution(int nsp, const VelocityGrid& vgrid, const DomainDecomposition<DeviceType>& pol_decomp)
28  : f("f", nsp, vgrid.nvr, pol_decomp.nnodes, vgrid.nvz),
29  vp_max(vgrid.vp_max),
30  dvp(vgrid.dvp),
31  smu_max(vgrid.smu_max),
32  dsmu(vgrid.dsmu),
34  {}
35 
36  double& operator()(int isp, int ivr, int inode, int ivz){ return f(isp, ivr, inode, ivz);}
37  double operator()(int isp, int ivr, int inode, int ivz) const { return f(isp, ivr, inode, ivz);}
38 
39  double* data(){return f.data();}
40 
41  void add_ay(const VGridDistribution<Device>& dist2, double scalar){
42  host_add_ay_to_x(f, dist2.f, scalar);
43  }
44 
45  // Access dimensions
46  inline int n_species() const{
47  return f.extent(0);
48  }
49 
50  inline int n_vr() const {
51  return f.extent(1);
52  }
53 
54  inline int n_nodes() const{
55  return f.extent(2);
56  }
57 
58  inline int n_vz() const{
59  return f.extent(3);
60  }
61 
62  // Miscellaneous
63  inline double get_smu_n(int imu) const{
64  return (imu>0 ? dsmu*imu : dsmu*inv_mu0_factor);
65  }
66 };
67 
68 #endif
Definition: velocity_grid.hpp:7
double get_smu_n(int imu) const
Definition: vgrid_distribution.hpp:63
double smu_max
max mu
Definition: vgrid_distribution.hpp:21
void add_ay(const VGridDistribution< Device > &dist2, double scalar)
Definition: vgrid_distribution.hpp:41
double & operator()(int isp, int ivr, int inode, int ivz)
Definition: vgrid_distribution.hpp:36
double dvp
grid spacing in parallel velocity
Definition: vgrid_distribution.hpp:20
double inv_mu0_factor
Definition: vgrid_distribution.hpp:23
void host_add_ay_to_x(V1 &dest_view, const V2 &added_view, T coeff)
Definition: view_arithmetic.hpp:19
VGridDistribution()
Definition: vgrid_distribution.hpp:25
Kokkos::View< double ****, Kokkos::LayoutRight, Device > f
Definition: vgrid_distribution.hpp:14
VGridDistribution(int nsp, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp)
Definition: vgrid_distribution.hpp:27
Definition: vgrid_distribution.hpp:11
double dsmu
grid spacing in mu
Definition: vgrid_distribution.hpp:22
int n_vz() const
Definition: vgrid_distribution.hpp:58
double * data()
Definition: vgrid_distribution.hpp:39
int n_nodes() const
Definition: vgrid_distribution.hpp:54
double operator()(int isp, int ivr, int inode, int ivz) const
Definition: vgrid_distribution.hpp:37
int n_species() const
Definition: vgrid_distribution.hpp:46
int n_vr() const
Definition: vgrid_distribution.hpp:50
double vp_max
max parallel velocity
Definition: vgrid_distribution.hpp:19