ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
orb5x::Pdespline Class Reference

Shared B-spline quadrature, projection, rebasing, and boundary support. More...

#include "pdespline.hpp"

Static Public Member Functions

static void analytical_rhs (Kokkos::View< Real *** > &rhs)
 Project the built-in Gaussian two-mode test field onto the basis.
 
static void destroyStaticViews ()
 Release all static Kokkos Views before Kokkos::finalize().
 
static int get_nbmatf ()
 Return the number of local field matrices.
 
static int get_width_f ()
 Return packed poloidal Fourier width per radial row.
 
static Kokkos::View< Real ** > get_zwavg ()
 Return flux-surface-average weights.
 
static void impose_bc (Kokkos::View< Complex ** > &v)
 Impose radial solver boundary rows on complex right-hand sides.
 
static void impose_bc_host (Kokkos::View< Complex ** >::HostMirror &v)
 Host-mirror implementation of impose_bc().
 
static void initpde (int nidbas, int ns_, Real ds_, Real smin_, int nchi_, Real dchi_, int nphip_, Real dphi_, const Kokkos::View< int ** > &mmin_, const Kokkos::View< int ** > &mmax_, int iquafor)
 Initialize spline, mesh, quadrature, and Fourier-mode metadata.
 
static void rebase_c1d (Kokkos::View< Complex * > &v, NSelWhichMat nsel_which_mat)
 Rebase a packed complex radial/Fourier vector in place.
 
static void rebase_c2d (Kokkos::View< Complex ** > &v, NSelWhichMat nsel_which_mat)
 Rebase every right-hand-side column of complex solver storage.
 
static void rebase_c2d_host (Kokkos::View< Complex ** >::HostMirror &v, NSelWhichMat nsel_which_mat)
 Host-mirror implementation of complex two-dimensional rebasing.
 
static void rebase_r1d (Kokkos::View< Real * > &v, NSelWhichMat nsel_which_mat)
 Rebase a real radial/poloidal vector through host staging.
 
static void rebase_r1d (Kokkos::View< Real *, Kokkos::HostSpace > &v, NSelWhichMat nsel_which_mat)
 Rebase an already host-resident real vector in place.
 
static void rebase_r1d_host_data (Real *data, int size, NSelWhichMat nsel_which_mat)
 Rebase contiguous host data as one real coefficient vector.
 
static void rebase_r2d (Kokkos::View< Real ** > &v, NSelWhichMat nsel_which_mat)
 Rebase every column of a real 2-D View through host staging.
 
static void rebase_r2d (Kokkos::View< Real **, Kokkos::HostSpace > &v, NSelWhichMat nsel_which_mat)
 Rebase every column of a host-resident real 2-D View.
 
static void rebase_r2d_host_data (Real *data, int size0, int size1, NSelWhichMat nsel_which_mat)
 Rebase columns of contiguous host matrix data.
 
static Kokkos::View< Real * > splines (Real z)
 Evaluate the active cell-local B-spline basis.
 

Detailed Description

Shared B-spline quadrature, projection, rebasing, and boundary support.

Pdespline prepares the uniform (s,chi,phi) spline basis used by field equation assembly. It caches basis values at grid and Gauss points, packed Fourier mode bounds, and flux-surface-average weights. Its rebase routines apply the radial boundary change of basis (T, T^T, or T^-1) before and after sparse solves. The module is process-global and must be initialized after field/equilibrium geometry but before matrix assembly.

Member Function Documentation

◆ analytical_rhs()

static void orb5x::Pdespline::analytical_rhs ( Kokkos::View< Real *** > &  rhs)
static

Project the built-in Gaussian two-mode test field onto the basis.

Parameters
[out]rhsIntegrated coefficients [ns+p][nchi+p][nphip+p].

Uses tensor-product Gaussian quadrature and the equilibrium Jacobian, folds poloidal periodic guards, then accumulates toroidal guard contributions across the spatial-domain communicator.

◆ destroyStaticViews()

static void orb5x::Pdespline::destroyStaticViews ( )
static

Release all static Kokkos Views before Kokkos::finalize().

◆ get_nbmatf()

static int orb5x::Pdespline::get_nbmatf ( )
inlinestatic

Return the number of local field matrices.

Returns
Matrix count owned by the current process.

◆ get_width_f()

static int orb5x::Pdespline::get_width_f ( )
inlinestatic

Return packed poloidal Fourier width per radial row.

Returns
Number of retained poloidal coefficients per radial row.

◆ get_zwavg()

static Kokkos::View< Real ** > orb5x::Pdespline::get_zwavg ( )
inlinestatic

Return flux-surface-average weights.

Returns
Shallow Kokkos View [chi][radial grid point] sharing module storage.

◆ impose_bc()

static void orb5x::Pdespline::impose_bc ( Kokkos::View< Complex ** > &  v)
static

Impose radial solver boundary rows on complex right-hand sides.

Parameters
[in,out]vCoefficients with (ns+p)*width_f in the first extent.

◆ impose_bc_host()

static void orb5x::Pdespline::impose_bc_host ( Kokkos::View< Complex ** >::HostMirror &  v)
static

Host-mirror implementation of impose_bc().

Parameters
[in,out]vHost coefficients modified in place.

◆ initpde()

static void orb5x::Pdespline::initpde ( int  nidbas,
int  ns_,
Real  ds_,
Real  smin_,
int  nchi_,
Real  dchi_,
int  nphip_,
Real  dphi_,
const Kokkos::View< int ** > &  mmin_,
const Kokkos::View< int ** > &  mmax_,
int  iquafor 
)
static

Initialize spline, mesh, quadrature, and Fourier-mode metadata.

Parameters
[in]nidbasB-spline degree p, supported from 0 through 3.
[in]ns_Number of radial intervals.
[in]ds_Uniform radial spacing in normalized s.
[in]smin_Lower radial coordinate in normalized s.
[in]nchi_Number of periodic poloidal intervals.
[in]dchi_Poloidal spacing [rad].
[in]nphip_Local toroidal interval count on this spatial rank.
[in]dphi_Toroidal spacing [rad].
[in]mmin_Lowest retained poloidal mode by radial row and local toroidal mode.
[in]mmax_Highest retained poloidal mode on the same layout.
[in]iquaforRequested Gauss–Legendre point count, clamped to 1–10.

◆ rebase_c1d()

static void orb5x::Pdespline::rebase_c1d ( Kokkos::View< Complex * > &  v,
NSelWhichMat  nsel_which_mat 
)
static

Rebase a packed complex radial/Fourier vector in place.

Parameters
[in,out]vFlattened storage of (ns+p)*width_f coefficients.
[in]nsel_which_matSelect boundary matrix operation.

◆ rebase_c2d()

static void orb5x::Pdespline::rebase_c2d ( Kokkos::View< Complex ** > &  v,
NSelWhichMat  nsel_which_mat 
)
static

Rebase every right-hand-side column of complex solver storage.

Parameters
[in,out]vFirst extent contains (ns+p)*width_f coefficients.
[in]nsel_which_matSelect boundary matrix operation.

◆ rebase_c2d_host()

static void orb5x::Pdespline::rebase_c2d_host ( Kokkos::View< Complex ** >::HostMirror &  v,
NSelWhichMat  nsel_which_mat 
)
static

Host-mirror implementation of complex two-dimensional rebasing.

Parameters
[in,out]vHost mirror modified in place.
[in]nsel_which_matSelect boundary matrix operation.

◆ rebase_r1d() [1/2]

static void orb5x::Pdespline::rebase_r1d ( Kokkos::View< Real * > &  v,
NSelWhichMat  nsel_which_mat 
)
static

Rebase a real radial/poloidal vector through host staging.

Parameters
[in,out]vFlattened storage of at least (ns+p)*nchi values.
[in]nsel_which_matSelect T, T^T, or T^-1.

◆ rebase_r1d() [2/2]

static void orb5x::Pdespline::rebase_r1d ( Kokkos::View< Real *, Kokkos::HostSpace > &  v,
NSelWhichMat  nsel_which_mat 
)
static

Rebase an already host-resident real vector in place.

Parameters
[in,out]vFlattened storage of at least (ns+p)*nchi values.
[in]nsel_which_matSelect T, T^T, or T^-1.

◆ rebase_r1d_host_data()

static void orb5x::Pdespline::rebase_r1d_host_data ( Real *  data,
int  size,
NSelWhichMat  nsel_which_mat 
)
static

Rebase contiguous host data as one real coefficient vector.

Parameters
[in,out]dataPointer to size values.
[in]sizeAvailable length; short buffers are warned about and unchanged.
[in]nsel_which_matSelect boundary matrix operation.

◆ rebase_r2d() [1/2]

static void orb5x::Pdespline::rebase_r2d ( Kokkos::View< Real ** > &  v,
NSelWhichMat  nsel_which_mat 
)
static

Rebase every column of a real 2-D View through host staging.

Parameters
[in,out]vFirst extent holds flattened radial/poloidal coefficients.
[in]nsel_which_matSelect T, T^T, or T^-1.

◆ rebase_r2d() [2/2]

static void orb5x::Pdespline::rebase_r2d ( Kokkos::View< Real **, Kokkos::HostSpace > &  v,
NSelWhichMat  nsel_which_mat 
)
static

Rebase every column of a host-resident real 2-D View.

Parameters
[in,out]vMatrix whose first extent is the coefficient vector.
[in]nsel_which_matSelect boundary matrix operation.

◆ rebase_r2d_host_data()

static void orb5x::Pdespline::rebase_r2d_host_data ( Real *  data,
int  size0,
int  size1,
NSelWhichMat  nsel_which_mat 
)
static

Rebase columns of contiguous host matrix data.

Parameters
[in,out]dataContiguous Kokkos-layout matrix storage.
[in]size0Coefficient-vector extent.
[in]size1Number of columns.
[in]nsel_which_matSelect boundary matrix operation.

◆ splines()

static Kokkos::View< Real * > orb5x::Pdespline::splines ( Real  z)
static

Evaluate the active cell-local B-spline basis.

Parameters
[in]zDimensionless cell coordinate, normally in [0,1].
Returns
Device View of p+1 dimensionless basis values.
Note
An unsupported degree aborts MPI_COMM_WORLD.

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