ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
orb5x::spclibs::Spline1D Struct Reference

1-dimensional B-spline More...

#include "bsplines.hpp"

+ Collaboration diagram for orb5x::spclibs::Spline1D:

Public Member Functions

int degree () const
 
bool is_initialized () const
 
Real knot (int i) const
 Read a knot using the original signed Fortran index convention.
 
void set_knot (int i, Real val)
 Replace a knot using the original signed Fortran index convention.
 
 Spline1D ()=default
 Construct an uninitialized descriptor with empty Kokkos Views.
 

Public Attributes

Kokkos::View< Real * > bcoefs
 Spline coefficients.
 
int dim = 0
 Dimension of spline space = nints + order - 1.
 
std::vector< int > fmap
 Fine to coarse mesh mapping (for non-equidistant)
 
Kokkos::View< Real ** > gausw
 Gauss weights (ngauss x nints)
 
Kokkos::View< Real ** > gausx
 Gauss abscissas (ngauss x nints)
 
Real hinv = 0.0
 Inverse of mesh size (for equidistant grids)
 
Kokkos::View< Real * > intspl
 Integral of each spline.
 
Kokkos::View< Real * > knots
 Knot sequence (-p:nints+p in Fortran, size 2*p+nints+1)
 
Real lperiod = 0.0
 Period length (if periodic)
 
GBMat mat
 Interpolation matrix (non-periodic)
 
PeriodicMat matp
 Interpolation matrix (periodic)
 
int nints = 0
 Number of knot intervals.
 
bool nlequid = false
 Is the grid equidistant?
 
bool nlppform = true
 Use PPFORM for evaluation?
 
int order = 0
 Spline order = degree + 1.
 
bool period = false
 Is the grid periodic?
 
Kokkos::View< Real ** > ppform
 PPFORM coefficients.
 
Kokkos::View< Real *** > val0
 Pre-computed spline values at left boundaries (deriv, basis, interval)
 
Kokkos::View< Real ** > valc
 For periodic equidistant: translational invariant values.
 

Detailed Description

1-dimensional B-spline

Represents a B-spline defined on a 1D grid with:

  • Arbitrary order (degree + 1)
  • Equidistant or non-equidistant knot sequence
  • Optional periodic boundary conditions
  • Pre-computed Gauss quadrature points and weights
  • Band matrix for interpolation

Constructor & Destructor Documentation

◆ Spline1D()

orb5x::spclibs::Spline1D::Spline1D ( )
default

Construct an uninitialized descriptor with empty Kokkos Views.

Member Function Documentation

◆ degree()

int orb5x::spclibs::Spline1D::degree ( ) const
inline
Returns
Polynomial degree, equal to order-1.

References order.

◆ is_initialized()

bool orb5x::spclibs::Spline1D::is_initialized ( ) const
inline
Returns
true after setup assigns positive order and basis dimension.

References dim, and order.

Referenced by orb5x::spclibs::Spline2D::is_initialized(), and orb5x::spclibs::Spline2D1D::is_initialized().

◆ knot()

Real orb5x::spclibs::Spline1D::knot ( int  i) const

Read a knot using the original signed Fortran index convention.

Parameters
[in]iLogical knot index in [-degree(), nints+degree()].
Returns
Knot coordinate in the units of the setup grid.
Note
The View is staged to host and logical index i maps to i + order - 1 in C++ storage.

◆ set_knot()

void orb5x::spclibs::Spline1D::set_knot ( int  i,
Real  val 
)

Replace a knot using the original signed Fortran index convention.

Parameters
[in]iLogical knot index in [-degree(), nints+degree()].
[in]valNew coordinate in the units of the setup grid.
Note
This stages the complete knot View through host memory and does not recompute cached basis, quadrature, or matrix data.

Member Data Documentation

◆ bcoefs

Kokkos::View<Real*> orb5x::spclibs::Spline1D::bcoefs

Spline coefficients.

◆ dim

int orb5x::spclibs::Spline1D::dim = 0

Dimension of spline space = nints + order - 1.

Referenced by is_initialized().

◆ fmap

std::vector<int> orb5x::spclibs::Spline1D::fmap

Fine to coarse mesh mapping (for non-equidistant)

◆ gausw

Kokkos::View<Real**> orb5x::spclibs::Spline1D::gausw

Gauss weights (ngauss x nints)

◆ gausx

Kokkos::View<Real**> orb5x::spclibs::Spline1D::gausx

Gauss abscissas (ngauss x nints)

◆ hinv

Real orb5x::spclibs::Spline1D::hinv = 0.0

Inverse of mesh size (for equidistant grids)

◆ intspl

Kokkos::View<Real*> orb5x::spclibs::Spline1D::intspl

Integral of each spline.

◆ knots

Kokkos::View<Real*> orb5x::spclibs::Spline1D::knots

Knot sequence (-p:nints+p in Fortran, size 2*p+nints+1)

◆ lperiod

Real orb5x::spclibs::Spline1D::lperiod = 0.0

Period length (if periodic)

◆ mat

GBMat orb5x::spclibs::Spline1D::mat

Interpolation matrix (non-periodic)

◆ matp

PeriodicMat orb5x::spclibs::Spline1D::matp

Interpolation matrix (periodic)

◆ nints

int orb5x::spclibs::Spline1D::nints = 0

Number of knot intervals.

◆ nlequid

bool orb5x::spclibs::Spline1D::nlequid = false

Is the grid equidistant?

◆ nlppform

bool orb5x::spclibs::Spline1D::nlppform = true

Use PPFORM for evaluation?

◆ order

int orb5x::spclibs::Spline1D::order = 0

Spline order = degree + 1.

Referenced by degree(), and is_initialized().

◆ period

bool orb5x::spclibs::Spline1D::period = false

Is the grid periodic?

◆ ppform

Kokkos::View<Real**> orb5x::spclibs::Spline1D::ppform

PPFORM coefficients.

◆ val0

Kokkos::View<Real***> orb5x::spclibs::Spline1D::val0

Pre-computed spline values at left boundaries (deriv, basis, interval)

◆ valc

Kokkos::View<Real**> orb5x::spclibs::Spline1D::valc

For periodic equidistant: translational invariant values.


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