XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
VelocityGrid Struct Reference

#include <velocity_grid.hpp>

Public Member Functions

 VelocityGrid ()=default
 
 VelocityGrid (NLReader::NamelistReader &nlr)
 
KOKKOS_INLINE_FUNCTION double vpar_n (int ivz) const
 Returns the parallel velocity corresponding to a given grid index. More...
 
KOKKOS_INLINE_FUNCTION double vperp_n (int ivr) const
 Returns the perpendicular velocity corresponding to a given grid index. More...
 
KOKKOS_INLINE_FUNCTION double mu_vol_fac (int ivr) const
 Returns a volume factor to account for edge effects in the perpendicular velocity grid. More...
 
KOKKOS_INLINE_FUNCTION double vp_vol_fac (int ivz) const
 Returns a volume factor to account for edge effects in the parallel velocity grid. More...
 
KOKKOS_INLINE_FUNCTION VGridWeights get_weights (double smu, double vp) const
 Determines velocity grid weights based on input values of smu and vp. More...
 
KOKKOS_INLINE_FUNCTION void weight_by_inv_dsmu (VGridWeights &vgrid_wts) const
 Adjusts the perpendicular velocity grid weights by dividing by the dsmu value, considering edge effects. More...
 
KOKKOS_INLINE_FUNCTION void weight_by_vol (double vol, VGridWeights &vgrid_wts) const
 Adjusts velocity grid weights by multiplying with a volume factor, considering edge effects. More...
 
KOKKOS_INLINE_FUNCTION void weight_by_inv_vol (double inv_vol, VGridWeights &vgrid_wts) const
 Adjusts velocity grid weights by dividing by the inverse volume factor, considering edge effects. More...
 

Public Attributes

int nvp
 n points in parallel velocity (not including zero) More...
 
double vp_max
 max parallel velocity More...
 
double dvp
 grid spacing in parallel velocity More...
 
int nmu
 n points in mu (not including zero) More...
 
double smu_max
 max mu More...
 
double dsmu
 grid spacing in mu More...
 
double inv_mu0_factor = 1.0/3.0
 Set value of lowest mu in grid –> 1/mu0_factor. More...
 
int nvr
 full grid size (including zero) More...
 
int nvz
 full grid size (including negative and zero) More...
 
int element_order
 velocity grid finite element order (0 = nearest neighbor), (1 = linear), (2 = quadratic), (3 = cubic), .... More...
 
bool pseudo_inv_on
 whether pseudo-inverse interpolation is used in velocity space More...
 

Constructor & Destructor Documentation

VelocityGrid::VelocityGrid ( )
default
VelocityGrid::VelocityGrid ( NLReader::NamelistReader nlr)
inline

Here is the call graph for this function:

Member Function Documentation

KOKKOS_INLINE_FUNCTION VGridWeights VelocityGrid::get_weights ( double  smu,
double  vp 
) const
inline

Determines velocity grid weights based on input values of smu and vp.

This function computes the linear weights for both the perpendicular velocity (smu) and the parallel velocity (vp) based on the provided input values. It calculates the appropriate weights and handles edge cases where the indices fall outside the valid grid range.

Parameters
smuThe perpendicular velocity value used to compute the weight for the perpendicular direction.
vpThe parallel velocity value used to compute the weight for the parallel direction.
Returns
A VGridWeights object containing the calculated weights for the velocity grid, or an invalid VGridWeights if the indices are out of bounds.

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION double VelocityGrid::mu_vol_fac ( int  ivr) const
inline

Returns a volume factor to account for edge effects in the perpendicular velocity grid.

This function returns a factor to adjust the volume at the boundaries (edges) of the perpendicular velocity grid. The factor is set to 0.5 at the boundaries, and 1.0 elsewhere.

Parameters
ivrThe grid index for perpendicular velocity.
Returns
The volume factor for the given grid index.

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION double VelocityGrid::vp_vol_fac ( int  ivz) const
inline

Returns a volume factor to account for edge effects in the parallel velocity grid.

This function returns a factor to adjust the volume at the boundaries (edges) of the parallel velocity grid. The factor is set to 0.5 at the boundaries, and 1.0 elsewhere.

Parameters
ivzThe grid index for parallel velocity.
Returns
The volume factor for the given grid index.

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION double VelocityGrid::vpar_n ( int  ivz) const
inline

Returns the parallel velocity corresponding to a given grid index.

Given a grid index in the parallel velocity direction, this function computes the corresponding velocity by subtracting the base velocity and multiplying by the velocity step size.

Parameters
ivzThe grid index for parallel velocity.
Returns
The parallel velocity corresponding to the grid index.

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION double VelocityGrid::vperp_n ( int  ivr) const
inline

Returns the perpendicular velocity corresponding to a given grid index.

Given a grid index in the perpendicular velocity direction, this function computes the corresponding velocity by multiplying the grid index by the perpendicular velocity step size.

Parameters
ivrThe grid index for perpendicular velocity.
Returns
The perpendicular velocity corresponding to the grid index.

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void VelocityGrid::weight_by_inv_dsmu ( VGridWeights vgrid_wts) const
inline

Adjusts the perpendicular velocity grid weights by dividing by the dsmu value, considering edge effects.

This function modifies the perpendicular velocity grid weights by dividing them by dsmu and adjusts the values at the edges based on predefined factors determined by the velocity interpolation order (here: linear –> 1/3). The edges are weighted by inv_mu0_factor for the first index and a similar factor for the last index.

Parameters
vgrid_wtsThe VGridWeights object to be adjusted.

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void VelocityGrid::weight_by_inv_vol ( double  inv_vol,
VGridWeights vgrid_wts 
) const
inline

Adjusts velocity grid weights by dividing by the inverse volume factor, considering edge effects.

This function divides the grid weights by an inverse volume factor (inv_vol), with special handling for grid edges. At the edges, the weights are adjusted by multiplying with a factor of 2.0 for the boundary grid points, while for interior points, the factor is 1.0.

Parameters
inv_volThe inverse volume factor to divide the weights by.
vgrid_wtsThe VGridWeights object containing the current velocity grid weights to be adjusted.

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void VelocityGrid::weight_by_vol ( double  vol,
VGridWeights vgrid_wts 
) const
inline

Adjusts velocity grid weights by multiplying with a volume factor, considering edge effects.

This function multiplies the grid weights by the specified volume (vol), taking into account edge cases where the grid indices lie on the boundaries. The volume is adjusted using different factors at the edges to account for the smaller volume associated with edge grid points.

Parameters
volThe volume factor to multiply the weights by.
vgrid_wtsThe VGridWeights object containing the current velocity grid weights to be adjusted.

Here is the caller graph for this function:

Member Data Documentation

double VelocityGrid::dsmu

grid spacing in mu

double VelocityGrid::dvp

grid spacing in parallel velocity

int VelocityGrid::element_order

velocity grid finite element order (0 = nearest neighbor), (1 = linear), (2 = quadratic), (3 = cubic), ....

double VelocityGrid::inv_mu0_factor = 1.0/3.0

Set value of lowest mu in grid –> 1/mu0_factor.

int VelocityGrid::nmu

n points in mu (not including zero)

int VelocityGrid::nvp

n points in parallel velocity (not including zero)

int VelocityGrid::nvr

full grid size (including zero)

int VelocityGrid::nvz

full grid size (including negative and zero)

bool VelocityGrid::pseudo_inv_on

whether pseudo-inverse interpolation is used in velocity space

double VelocityGrid::smu_max

max mu

double VelocityGrid::vp_max

max parallel velocity


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