Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana::Grid::Spline< 5 > Struct Reference

Quintic. Defined on the primal grid. More...

#include <Cabana_Grid_Splines.hpp>

Static Public Member Functions

template<class Scalar>
static KOKKOS_INLINE_FUNCTION Scalar mapToLogicalGrid (const Scalar xp, const Scalar rdx, const Scalar low_x)
 Map a physical location to the logical space of the primal grid in a single dimension.
 
static KOKKOS_INLINE_FUNCTION void offsets (int indices[num_knot])
 Get the logical space stencil offsets of the spline. The stencil defines the offsets into a grid field about a logical coordinate.
 
template<class Scalar>
static KOKKOS_INLINE_FUNCTION void stencil (const Scalar x0, int indices[num_knot])
 Compute the stencil indices for a given logical space location.
 
template<typename Scalar>
static KOKKOS_INLINE_FUNCTION void value (const Scalar x0, Scalar values[num_knot])
 Calculate the value of the spline at all knots.
 
template<typename Scalar>
static KOKKOS_INLINE_FUNCTION void gradient (const Scalar x0, const Scalar rdx, Scalar gradients[num_knot])
 Calculate the value of the gradient of the spline in the physical frame.
 

Static Public Attributes

static constexpr int order = 5
 Order.
 
static constexpr int num_knot = 6
 The number of non-zero knots in the spline.
 

Detailed Description

Quintic. Defined on the primal grid.

Member Function Documentation

◆ gradient()

template<typename Scalar>
static KOKKOS_INLINE_FUNCTION void Cabana::Grid::Spline< 5 >::gradient ( const Scalar x0,
const Scalar rdx,
Scalar gradients[num_knot] )
inlinestatic

Calculate the value of the gradient of the spline in the physical frame.

Parameters
x0The coordinate at which to evaluate the spline in the logical grid space.
rdxThe inverse of the physical distance between grid locations.
gradientsBasis gradient values at the knots in the physical frame. Ordered from lowest to highest in terms of knot location.

◆ mapToLogicalGrid()

template<class Scalar>
static KOKKOS_INLINE_FUNCTION Scalar Cabana::Grid::Spline< 5 >::mapToLogicalGrid ( const Scalar xp,
const Scalar rdx,
const Scalar low_x )
inlinestatic

Map a physical location to the logical space of the primal grid in a single dimension.

Parameters
xpThe coordinate to map to the logical space.
rdxThe inverse of the physical distance between grid locations.
low_xThe physical location of the low corner of the primal grid.
Returns
The coordinate in the logical primal grid space.
Note
Casting this result to an integer yields the index at the center of the stencil.
A quintic spline uses the primal grid.

◆ offsets()

static KOKKOS_INLINE_FUNCTION void Cabana::Grid::Spline< 5 >::offsets ( int indices[num_knot])
inlinestatic

Get the logical space stencil offsets of the spline. The stencil defines the offsets into a grid field about a logical coordinate.

Parameters
indicesThe stencil index offsets.

◆ stencil()

template<class Scalar>
static KOKKOS_INLINE_FUNCTION void Cabana::Grid::Spline< 5 >::stencil ( const Scalar x0,
int indices[num_knot] )
inlinestatic

Compute the stencil indices for a given logical space location.

Parameters
x0The coordinate at which to evaluate the spline stencil.
indicesThe indices of the stencil.

◆ value()

template<typename Scalar>
static KOKKOS_INLINE_FUNCTION void Cabana::Grid::Spline< 5 >::value ( const Scalar x0,
Scalar values[num_knot] )
inlinestatic

Calculate the value of the spline at all knots.

Parameters
x0The coordinate at which to evaluate the spline in the logical grid space.
valuesBasis values at the knots. Ordered from lowest to highest in terms of knot location.

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