ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
 
Loading...
Searching...
No Matches
orb5x::MassMatrix Class Reference

Constructs small element-local B-spline overlap operators. More...

#include "mass_matrix.hpp"

Static Public Member Functions

static void compute_1d_mass_matrix (int nidbas, Real dx, Kokkos::View< Real ** > &mass_mat)
 Compute \(M_{ij}=\int B_i(x)B_j(x)\,dx\) on one uniform cell.
 
static void compute_2d_mass_matrix (int nidbas_s, int nidbas_chi, Real ds, Real dchi, Kokkos::View< Real **** > &mass_mat_2d)
 Form the tensor product of radial and poloidal 1-D mass matrices.
 
static void compute_inverse_mass_fourier (const Kokkos::View< Complex * > &mass_fourier, Kokkos::View< Complex * > &inv_mass_fourier, int nphi)
 Compute a guarded reciprocal for each Fourier coefficient.
 
static void compute_mass_matrix_toroidal_deriv (int nidbas, Real dx, Kokkos::View< Real ** > &mass_mat_deriv)
 Compute \(D_{ij}=\int B_i(x)\,dB_j/dx\,dx\) on one cell.
 
static void project_to_fourier (const Kokkos::View< Real ** > &mass_bspl, Kokkos::View< Complex * > &mass_fourier, int nphi)
 Populate per-mode coefficients from a B-spline mass matrix.
 

Detailed Description

Constructs small element-local B-spline overlap operators.

These helpers create host-computed Kokkos views used to map between local B-spline coefficients and integral weights. They are separate from the production distributed matrices assembled by MatrixCoeff/SolverModule. Quadratic coefficients and Fourier projection in this utility are currently approximate, as stated by the implementation.

Member Function Documentation

◆ compute_1d_mass_matrix()

static void orb5x::MassMatrix::compute_1d_mass_matrix ( int  nidbas,
Real  dx,
Kokkos::View< Real ** > &  mass_mat 
)
static

Compute \(M_{ij}=\int B_i(x)B_j(x)\,dx\) on one uniform cell.

Parameters
[in]nidbasB-spline degree; explicit coefficients exist for 1–3.
[in]dxCoordinate-space cell width; the matrix has the same units.
[in,out]mass_matOutput (nidbas+1)^2 device view, allocated when empty.
Note
Unsupported degrees produce a diagonal matrix scaled by dx.

◆ compute_2d_mass_matrix()

static void orb5x::MassMatrix::compute_2d_mass_matrix ( int  nidbas_s,
int  nidbas_chi,
Real  ds,
Real  dchi,
Kokkos::View< Real **** > &  mass_mat_2d 
)
static

Form the tensor product of radial and poloidal 1-D mass matrices.

Parameters
[in]nidbas_sRadial B-spline degree.
[in]nidbas_chiPoloidal B-spline degree.
[in]dsRadial cell width in normalized s coordinates.
[in]dchiPoloidal cell width [rad].
[in,out]mass_mat_2dFour-index tensor, allocated when empty.

◆ compute_inverse_mass_fourier()

static void orb5x::MassMatrix::compute_inverse_mass_fourier ( const Kokkos::View< Complex * > &  mass_fourier,
Kokkos::View< Complex * > &  inv_mass_fourier,
int  nphi 
)
static

Compute a guarded reciprocal for each Fourier coefficient.

Parameters
[in]mass_fourierComplex mode coefficients.
[in,out]inv_mass_fourierOutput reciprocals, allocated when empty.
[in]nphiNumber of coefficients to process.
Note
Magnitudes at or below 1e-12 map to zero.

◆ compute_mass_matrix_toroidal_deriv()

static void orb5x::MassMatrix::compute_mass_matrix_toroidal_deriv ( int  nidbas,
Real  dx,
Kokkos::View< Real ** > &  mass_mat_deriv 
)
static

Compute \(D_{ij}=\int B_i(x)\,dB_j/dx\,dx\) on one cell.

Parameters
[in]nidbasB-spline degree.
[in]dxCell width; retained for interface parity although the implemented degree 1–3 reference coefficients are dimensionless.
[in,out]mass_mat_derivOutput square device view.

◆ project_to_fourier()

static void orb5x::MassMatrix::project_to_fourier ( const Kokkos::View< Real ** > &  mass_bspl,
Kokkos::View< Complex * > &  mass_fourier,
int  nphi 
)
static

Populate per-mode coefficients from a B-spline mass matrix.

Parameters
[in]mass_bsplSquare local mass matrix.
[in,out]mass_fourierComplex output of length nphi, allocated when empty.
[in]nphiNumber of toroidal Fourier modes.
Warning
The current implementation assigns the same element average to every mode; it is not a full discrete Fourier transform.

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