XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
lagrange_weights Struct Reference

This struct contains interpolation weights for 1D Lagrange interpolating polynomials of arbitrary order on a uniform 1D grid. More...

#include <lagrange_weights.hpp>

Public Member Functions

KOKKOS_INLINE_FUNCTION lagrange_weights ()
 
KOKKOS_INLINE_FUNCTION lagrange_weights (double var, double inv_d, int order)
 
KOKKOS_INLINE_FUNCTION void set (double var, double inv_d, int order)
 
KOKKOS_INLINE_FUNCTION void set_idx (int new_idx)
 

Public Attributes

int idx = 0
 The lower cell index on the grid where one cell comprises order+1 grid points. More...
 
double w [LAGRANGE_MAX_ORDER] = { 0.0 }
 Stores the Lagrange weights of the grid points i, i+1, i+2, ..., i+order in one cell. More...
 

Detailed Description

This struct contains interpolation weights for 1D Lagrange interpolating polynomials of arbitrary order on a uniform 1D grid.

The basis functions \(S_k(\xi)\) for \(k=0,1,...,\mathrm{order}\) are given by

\[S_k(\xi)=\prod_{j=0,j{\neq}k}^{\mathrm{order}}\frac{\xi-j\Delta}{k\Delta-j\Delta}\]

for \(\xi\in\left[0,1\right]\) and with \(\Delta=1/\mathrm{order}\). If order is 0 then nearest neighbor interpolation weights are used.

Constructor & Destructor Documentation

KOKKOS_INLINE_FUNCTION lagrange_weights::lagrange_weights ( )
inline
KOKKOS_INLINE_FUNCTION lagrange_weights::lagrange_weights ( double  var,
double  inv_d,
int  order 
)
inline

Here is the call graph for this function:

Member Function Documentation

KOKKOS_INLINE_FUNCTION void lagrange_weights::set ( double  var,
double  inv_d,
int  order 
)
inline

Calculates and sets the Lagrange weights

Parameters
[in]varis the coordinate on the grid.
[in]inv_dis the inverse distance between two neighboring grid points.
[in]orderis the interpolation order (0 = nearest neighbor), (1 = linear), (2 = quadratic), (3 = cubic), ....
Returns
void

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void lagrange_weights::set_idx ( int  new_idx)
inline

Here is the caller graph for this function:

Member Data Documentation

lagrange_weights::idx = 0

The lower cell index on the grid where one cell comprises order+1 grid points.

member 'idx' contains the lower cell index on the grid where one cell comprises order+1 grid points.

lagrange_weights::w = { 0.0 }

Stores the Lagrange weights of the grid points i, i+1, i+2, ..., i+order in one cell.

member 'w' contains the weights used for interpolating to the grid points i, i+1, i+2, ..., i+order in one cell.


The documentation for this struct was generated from the following file: