XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cub_interp.hpp
Go to the documentation of this file.
1 #ifndef I_INTERP_HPP
2 #define I_INTERP_HPP
3 #include "space_settings.hpp"
4 
5 // An array of this struct contains the background magnetic field used for interpolation. Size 4 since it is 3rd-order spline
6 struct OneDCoeff {
7  double coeff[4];
8 };
9 
10 template<class Device>
11 class CubInterp {
12 
13  // Variables needed in the interp
14  double max_psi;
15  double min_psi;
17  int ncoeff;
18 
19  Kokkos::View<OneDCoeff*,Kokkos::LayoutRight,Device> one_d_cub_acoef;
20 
21  public:
22 
23  // Constructor
24  CubInterp(OneDCoeff *one_d_cub_acoef_in, int ncoeff_in, double max_psi_in, double min_psi_in, double one_d_cub_dpsi_inv_in);
25 
26  // Default constructor
28 
29  KOKKOS_INLINE_FUNCTION double value(double psi) const;
30  KOKKOS_INLINE_FUNCTION double derivative(double psi) const;
31 };
32 
33 #include "cub_interp.tpp"
34 
35 #endif
KOKKOS_INLINE_FUNCTION double derivative(double psi) const
Definition: cub_interp.tpp:41
Kokkos::View< OneDCoeff *, Kokkos::LayoutRight, Device > one_d_cub_acoef
I data for interpolation.
Definition: cub_interp.hpp:19
double one_d_cub_dpsi_inv
Increment dpsi on which one_d_cub_acoef is mapped.
Definition: cub_interp.hpp:16
KOKKOS_INLINE_FUNCTION double value(double psi) const
Definition: cub_interp.tpp:22
Definition: cub_interp.hpp:11
double coeff[4]
Definition: cub_interp.hpp:7
double max_psi
max psi cutoff for the interpolation
Definition: cub_interp.hpp:14
Definition: cub_interp.hpp:6
double min_psi
min psi cutoff for the interpolation
Definition: cub_interp.hpp:15
int ncoeff
Length of one_d_cub_acoef.
Definition: cub_interp.hpp:17
CubInterp()
Definition: cub_interp.hpp:27