XGCa
|
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... | |
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.
|
inline |
|
inline |
|
inline |
Calculates and sets the Lagrange weights
[in] | var | is the coordinate on the grid. |
[in] | inv_d | is the inverse distance between two neighboring grid points. |
[in] | order | is the interpolation order (0 = nearest neighbor), (1 = linear), (2 = quadratic), (3 = cubic), .... |
|
inline |
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.