XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
Tricub< Device > Class Template Reference

#include <tricub.hpp>

Public Member Functions

 Tricub (const View< double *, HostType > &r, const View< double *, HostType > &z, const View< double *, HostType > &phi, const View< double ***, CLayout, HostType > &val, bool keep_positive=false)
 
template<class Device2 >
Tricub< Device2 > mirror () const
 
 Tricub ()
 
KOKKOS_INLINE_FUNCTION void der_zero (double x, double y, double z, double &f000) const
 
KOKKOS_INLINE_FUNCTION void der_one (double x, double y, double z, double &f000, double &f100, double &f010, double &f001) const
 

Private Types

enum  { J0 = 0, J1 = 1, J2 = 2, J3 = 3 }
 
enum  { K0 = 0, K1 = 1, K2 = 2, K3 = 3 }
 

Private Member Functions

KOKKOS_INLINE_FUNCTION void eval_tricub_0 (double x, double y, double z, double xc, double yc, double zc, const double(&acoeff)[4][4][4], double &f000) const
 
KOKKOS_INLINE_FUNCTION void eval_tricub_1 (double x, double y, double z, double xc, double yc, double zc, const double(&acoeff)[4][4][4], double &f000, double &f100, double &f010, double &f001) const
 
template<>
 Tricub (const View< double *, HostType > &r, const View< double *, HostType > &z, const View< double *, HostType > &p, const View< double ***, CLayout, HostType > &val, bool keep_positive)
 

Static Private Member Functions

static KOKKOS_INLINE_FUNCTION
double 
interp_1d (const double(&coeff1d)[4], double dx)
 
static KOKKOS_INLINE_FUNCTION
double 
slope_1d (const double(&coeff1d)[4], double dx)
 
static KOKKOS_INLINE_FUNCTION
double 
interp_2d (const double(&coeff2d)[4][4], double dx, double dy)
 

Private Attributes

int nr
 
int nz
 
int np
 Number of points in r and z directions. More...
 
double rmin
 
double zmin
 
double pmin
 First r and z point. More...
 
double dr_inv
 
double dz_inv
 
double dp_inv
 Inverse of the cell size. More...
 
Kokkos::View< double
*, Kokkos::LayoutRight, Device > 
rc
 Array containing the r coordinates of the grid points. More...
 
Kokkos::View< double
*, Kokkos::LayoutRight, Device > 
zc
 Array containing the z coordinates of the grid points. More...
 
Kokkos::View< double
*, Kokkos::LayoutRight, Device > 
pc
 Array containing the phi coordinates of the grid points. More...
 
Kokkos::View< TricubCoeff
***, Kokkos::LayoutRight,
Device > 
acoeff_all
 The field for interpolation. More...
 

Friends

template<class Device2 >
class Tricub
 

Member Enumeration Documentation

template<class Device>
anonymous enum
private
Enumerator
J0 
J1 
J2 
J3 
template<class Device>
anonymous enum
private
Enumerator
K0 
K1 
K2 
K3 

Constructor & Destructor Documentation

template<class Device>
Tricub< Device >::Tricub ( const View< double *, HostType > &  r,
const View< double *, HostType > &  z,
const View< double *, HostType > &  phi,
const View< double ***, CLayout, HostType > &  val,
bool  keep_positive = false 
)
template<class Device>
Tricub< Device >::Tricub ( )
inline
template<>
Tricub< HostType >::Tricub ( const View< double *, HostType > &  r,
const View< double *, HostType > &  z,
const View< double *, HostType > &  p,
const View< double ***, CLayout, HostType > &  val,
bool  keep_positive 
)
private

Here is the call graph for this function:

Member Function Documentation

template<class Device >
KOKKOS_INLINE_FUNCTION void Tricub< Device >::der_one ( double  x,
double  y,
double  z,
double &  f000,
double &  f100,
double &  f010,
double &  f001 
) const

Determine nearest interpolation grid points, then get first derivatives

Parameters
[in]xLocation in r
[in]yLocation in z
[in]zLocation in p
[out]f000f(x,y)
[out]f100df/dx
[out]f010df/dy
[out]f001df/dz

Here is the call graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void Tricub< Device >::der_zero ( double  x,
double  y,
double  z,
double &  f000 
) const

Determine nearest interpolation grid points, then get first derivatives

Parameters
[in]xLocation in r
[in]yLocation in z
[in]zLocation in phi
[out]f000f(x,y)

Here is the call graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void Tricub< Device >::eval_tricub_0 ( double  x,
double  y,
double  z,
double  xc,
double  yc,
double  zc,
const double(&)  acoeff[4][4][4],
double &  f000 
) const
private

Evaluate tricubic polynomial f(x,y)

Parameters
[in]xLocation in r
[in]yLocation in z
[in]xcOffset or center of box in x
[in]ycOffset or center of box in y
[in]acoeffData to interpolate from
[out]f000f(x,y,z)

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void Tricub< Device >::eval_tricub_1 ( double  x,
double  y,
double  z,
double  xc,
double  yc,
double  zc,
const double(&)  acoeff[4][4][4],
double &  f000,
double &  f100,
double &  f010,
double &  f001 
) const
private

Evaluate tricubic polynomial f(x,y) and first derivatives

Parameters
[in]xLocation in r
[in]yLocation in z
[in]zLocation in phi
[in]xcOffset or center of box in x
[in]ycOffset or center of box in y
[in]zcOffset or center of box in z
[in]acoeffData to interpolate from
[out]f000f(x,y,z)
[out]f100df/dx
[out]f010df/dy
[out]f001df/dz

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION double Tricub< Device >::interp_1d ( const double(&)  coeff1d[4],
double  dx 
)
staticprivate

Compute the interpolated position from a a set of spline coefficients

Parameters
[in]coeff1dAn array of 4 spline coefficients
[in]dxThe distance to interpolate returns the interpolated position

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION double Tricub< Device >::interp_2d ( const double(&)  coeff2d[4][4],
double  dx,
double  dy 
)
staticprivate

Compute the interpolated position from a a set of spline coefficients

Parameters
[in]coeff2dAn array of 4x4 spline coefficients
[in]dxThe distance to interpolate in contiguous dimension
[in]dxThe distance to interpolate in second dimension returns the interpolated position

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device>
template<class Device2 >
Tricub<Device2> Tricub< Device >::mirror ( ) const
inline

Here is the call graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION double Tricub< Device >::slope_1d ( const double(&)  coeff1d[4],
double  dx 
)
staticprivate

Compute the interpolated slope from a a set of spline coefficients

Parameters
[in]coeff1dAn array of 4 spline coefficients
[in]dxThe distance to interpolate returns the interpolated position

Here is the caller graph for this function:

Friends And Related Function Documentation

template<class Device>
template<class Device2 >
friend class Tricub
friend

Member Data Documentation

template<class Device>
Kokkos::View<TricubCoeff***,Kokkos::LayoutRight,Device> Tricub< Device >::acoeff_all
private

The field for interpolation.

template<class Device>
double Tricub< Device >::dp_inv
private

Inverse of the cell size.

template<class Device>
double Tricub< Device >::dr_inv
private
template<class Device>
double Tricub< Device >::dz_inv
private
template<class Device>
int Tricub< Device >::np
private

Number of points in r and z directions.

template<class Device>
int Tricub< Device >::nr
private
template<class Device>
int Tricub< Device >::nz
private
template<class Device>
Kokkos::View<double*,Kokkos::LayoutRight,Device> Tricub< Device >::pc
private

Array containing the phi coordinates of the grid points.

template<class Device>
double Tricub< Device >::pmin
private

First r and z point.

template<class Device>
Kokkos::View<double*,Kokkos::LayoutRight,Device> Tricub< Device >::rc
private

Array containing the r coordinates of the grid points.

template<class Device>
double Tricub< Device >::rmin
private
template<class Device>
Kokkos::View<double*,Kokkos::LayoutRight,Device> Tricub< Device >::zc
private

Array containing the z coordinates of the grid points.

template<class Device>
double Tricub< Device >::zmin
private

The documentation for this class was generated from the following files: