XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vgrid_weights.hpp
Go to the documentation of this file.
1 #ifndef VGRID_WEIGHTS_HPP
2 #define VGRID_WEIGHTS_HPP
3 
4 #include "linear_weights.hpp"
5 
6 // Struct containing indices and weights on velocity grid
7 struct VGridWeights{
8  int i_vr;
9  int i_vz;
10  double w_00;
11  double w_01;
12  double w_10;
13  double w_11;
14 
15  KOKKOS_INLINE_FUNCTION VGridWeights(const LinearWeights& vr_wt, const LinearWeights& vz_wt)
16  : i_vr(vr_wt.i),
17  i_vz(vz_wt.i),
18  w_00(vr_wt.w[0]*vz_wt.w[0]),
19  w_01(vr_wt.w[0]*vz_wt.w[1]),
20  w_10(vr_wt.w[1]*vz_wt.w[0]),
21  w_11(vr_wt.w[1]*vz_wt.w[1])
22  {}
23 
24  // Reuse i_vr as indicator of validity
25  KOKKOS_INLINE_FUNCTION VGridWeights()
26  : i_vr(-1)
27  {}
28 
29  KOKKOS_INLINE_FUNCTION bool is_valid(){
30  return (i_vr==-1) ? false : true;
31  }
32 };
33 
34 #endif
KOKKOS_INLINE_FUNCTION VGridWeights()
Definition: vgrid_weights.hpp:25
KOKKOS_INLINE_FUNCTION bool is_valid()
Definition: vgrid_weights.hpp:29
double w_00
Definition: vgrid_weights.hpp:10
Definition: linear_weights.hpp:8
double w_01
Definition: vgrid_weights.hpp:11
double w_11
Definition: vgrid_weights.hpp:13
int i_vr
Definition: vgrid_weights.hpp:8
int i_vz
Definition: vgrid_weights.hpp:9
Definition: vgrid_weights.hpp:7
KOKKOS_INLINE_FUNCTION VGridWeights(const LinearWeights &vr_wt, const LinearWeights &vz_wt)
Definition: vgrid_weights.hpp:15
double w_10
Definition: vgrid_weights.hpp:12