XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
update_f0.cpp File Reference
#include "timer_macro.hpp"
#include "globals.hpp"
#include "sml.hpp"
#include "magnetic_field.hpp"
#include "grid.hpp"
#include "particles.hpp"
#include "plasma.hpp"
#include "domain_decomposition.hpp"
#include "lagrange_weights.hpp"
#include <math.h>
#include "streamed_parallel_for.hpp"
#include "poloidal_sum.hpp"
#include "shift.hpp"
#include "update_f0.hpp"
Include dependency graph for update_f0.cpp:

Functions

template<class Device >
KOKKOS_INLINE_FUNCTION void f0_update_f0g (const Grid< Device > &grid, const Species< Device > &species, const VelocityGrid &vgrid, int node, double phi, double smu_n, double vp_n, double df0g, double df2, bool update_f_and_n, const VGridDistribution< DeviceType > &dist, const VGridDistribution< DeviceType > &norm, const VGridDistribution< DeviceType > &f0g)
 
template<class Device >
KOKKOS_INLINE_FUNCTION void f0_update_f0g_lagrange (const Grid< Device > &grid, const Species< Device > &species, const VelocityGrid &vgrid, int node, double phi, double smu_n, double vp_n, double df0g, double df2, bool update_f_and_n, int order, const VGridDistribution< DeviceType > &dist, const VGridDistribution< DeviceType > &norm, const VGridDistribution< DeviceType > &f0g)
 
template<class Device >
KOKKOS_INLINE_FUNCTION void f0_update_f0_n (const Grid< Device > &grid, const Species< Device > &species, const VelocityGrid &vgrid, int node, double smu_n, double vp_n, int order, const VGridDistribution< DeviceType > &norm, const VGridDistribution< DeviceType > &f0g)
 
template<class Device >
KOKKOS_INLINE_FUNCTION void update_f0_sp_c (const Simulation< Device > &sml, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const VelocityGrid &vgrid, const DomainDecomposition< Device > &pol_decomp, double alpha_in, bool update_f_and_n, bool f_source_on, int i_item, const VGridDistribution< DeviceType > &dist, const VGridDistribution< DeviceType > &norm, const VGridDistribution< DeviceType > &f0g)
 
template<class Device >
KOKKOS_INLINE_FUNCTION void update_f0_sp_c_pseudo_inv (const Simulation< Device > &sml, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const VelocityGrid &vgrid, const DomainDecomposition< Device > &pol_decomp, double alpha_in, bool update_f_and_n, bool f_source_on, const Pseudo_inverse< Device > &pseudo_inv, int i_item, const VGridDistribution< DeviceType > &dist, const VGridDistribution< DeviceType > &norm, const VGridDistribution< DeviceType > &f0g)
 
void f0_update (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Species< DeviceType > &species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, double alpha_in, bool f_source_on, Pseudo_inverse< DeviceType > &pseudo_inv, VGridDistribution< DeviceType > &dist, VGridDistribution< DeviceType > &norm, VGridDistribution< DeviceType > &f0g)
 
void f0_update_f0g_pseudo_inv (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const Species< DeviceType > &species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, bool update_f_and_n, DMWrapper &pseudo_inv_dm, Pseudo_inverse< DeviceType > &pseudo_inv, VGridDistribution< DeviceType > &dist, VGridDistribution< DeviceType > &f0g)
 
void update_f0_sp (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Species< DeviceType > &species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, double alpha_in, bool f_source_on, DMWrapper &pseudo_inv_dm, Pseudo_inverse< DeviceType > &pseudo_inv, VGridDistribution< HostType > &f0_f, VGridDistribution< HostType > &f0_n)
 
void all_species_update_f0 (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Plasma &plasma, const VelocityGrid &vgrid, DomainDecomposition< DeviceType > &pol_decomp, double alpha_in, bool f_source_on, DMWrapper &pseudo_inv_dm, Pseudo_inverse< DeviceType > &pseudo_inv, VGridDistribution< HostType > &f0_f, VGridDistribution< HostType > &f0_n)
 

Function Documentation

void all_species_update_f0 ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Plasma plasma,
const VelocityGrid vgrid,
DomainDecomposition< DeviceType > &  pol_decomp,
double  alpha_in,
bool  f_source_on,
DMWrapper pseudo_inv_dm,
Pseudo_inverse< DeviceType > &  pseudo_inv,
VGridDistribution< HostType > &  f0_f,
VGridDistribution< HostType > &  f0_n 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void f0_update ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Species< DeviceType > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
double  alpha_in,
bool  f_source_on,
Pseudo_inverse< DeviceType > &  pseudo_inv,
VGridDistribution< DeviceType > &  dist,
VGridDistribution< DeviceType > &  norm,
VGridDistribution< DeviceType > &  f0g 
)

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void f0_update_f0_n ( const Grid< Device > &  grid,
const Species< Device > &  species,
const VelocityGrid vgrid,
int  node,
double  smu_n,
double  vp_n,
int  order,
const VGridDistribution< DeviceType > &  norm,
const VGridDistribution< DeviceType > &  f0g 
)

Update velocity interpolation normalization factors. Uses Lagrange polynomials of the given order.

Parameters
[in]gridspatial grid object
[in]speciescontains species parameters
[in]vgridcontains the velocity grid dimensions
[in]nodegrid node of particle
[in]smu_nsmu_n [v_{perpendicular}/v_{thermal}] of particle
[in]vp_nparallel velocity of particle
[in]orderthe interpolation order (0 = nearest neighbor), (1 = linear), (2 = quadratic), (3 = cubic), ....
[in,out]normthe normalization coefficient used for the grid <–> particle interpolation
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void f0_update_f0g ( const Grid< Device > &  grid,
const Species< Device > &  species,
const VelocityGrid vgrid,
int  node,
double  phi,
double  smu_n,
double  vp_n,
double  df0g,
double  df2,
bool  update_f_and_n,
const VGridDistribution< DeviceType > &  dist,
const VGridDistribution< DeviceType > &  norm,
const VGridDistribution< DeviceType > &  f0g 
)

Interpolate weight of one particle to grid distribution bilinearly in velocity space.

Parameters
[in]gridspatial grid object
[in]speciescontains species parameters
[in]vgridcontains the velocity grid dimensions
[in]nodegrid node of particle
[in]phiphi of particle
[in]smu_nsqrt(mu) [v_{perpendicular}/v_{thermal}] of particle
[in]vp_nparallel velocity of particle
[in]df0gparticle weight multiplied by fraction transferred to distribution function every source time step: alpha*w1*w0
[in]df2particle weight: w1*w0
[in]update_f_and_nwhether to add particle weights in the distribution function used for the source routines
[in,out]distthe species distribution being added to the particle contributions
[in,out]normthe normalization coefficient used for the grid <–> particle interpolation
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void f0_update_f0g_lagrange ( const Grid< Device > &  grid,
const Species< Device > &  species,
const VelocityGrid vgrid,
int  node,
double  phi,
double  smu_n,
double  vp_n,
double  df0g,
double  df2,
bool  update_f_and_n,
int  order,
const VGridDistribution< DeviceType > &  dist,
const VGridDistribution< DeviceType > &  norm,
const VGridDistribution< DeviceType > &  f0g 
)

Interpolate weight of one particle to grid distribution in velocity space. Uses Lagrange polynomials of the given order.

Parameters
[in]gridspatial grid object
[in]speciescontains species parameters
[in]vgridcontains the velocity grid dimensions
[in]nodegrid node of particle
[in]phiphi of particle
[in]smu_nsqrt(mu) [v_{perpendicular}/v_{thermal}] of particle
[in]vp_nparallel velocity of particle
[in]df0gparticle weight multiplied by fraction transferred to distribution function every source time step: alpha*w1*w0
[in]df2particle weight: w1*w0
[in]update_f_and_nwhether to add particle weights in the distribution function used for the source routines
[in]orderthe interpolation order (0 = nearest neighbor), (1 = linear), (2 = quadratic), (3 = cubic), ....
[in,out]distthe species distribution being added to the particle contributions
[in,out]normthe normalization coefficient used for the grid <–> particle interpolation
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

void f0_update_f0g_pseudo_inv ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const Species< DeviceType > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
bool  update_f_and_n,
DMWrapper pseudo_inv_dm,
Pseudo_inverse< DeviceType > &  pseudo_inv,
VGridDistribution< DeviceType > &  dist,
VGridDistribution< DeviceType > &  f0g 
)

Loop over nodes and interpolate weights to grid distribution. This is pseudo-inverse version with particles -> velocity grid interpolation done with PETSc.

NOTE: This method is slower than the other but may be necessary for a PETSc collision operator.

Parameters
[in]gridspatial grid object
[in]magnetic_fieldmagnetic field object
[in]speciescontains species parameters
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]update_f_and_nwhether to add particle weights in the distribution function used for the source routines
[in]pseudo_inv_dmpseudo-inverse mesh object
[in]pseudo_invpseudo-inverse object (contains pseudo-inverse arrays)
[in,out]distthe species distribution being added to the particle contributions
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

void update_f0_sp ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Species< DeviceType > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
double  alpha_in,
bool  f_source_on,
DMWrapper pseudo_inv_dm,
Pseudo_inverse< DeviceType > &  pseudo_inv,
VGridDistribution< HostType > &  f0_f,
VGridDistribution< HostType > &  f0_n 
)

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void update_f0_sp_c ( const Simulation< Device > &  sml,
const Grid< Device > &  grid,
const MagneticField< Device > &  magnetic_field,
const Species< Device > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< Device > &  pol_decomp,
double  alpha_in,
bool  update_f_and_n,
bool  f_source_on,
int  i_item,
const VGridDistribution< DeviceType > &  dist,
const VGridDistribution< DeviceType > &  norm,
const VGridDistribution< DeviceType > &  f0g 
)

Loop over particles and interpolate weights to grid distribution.

Parameters
[in]smlcontains simulation control parameters
[in]gridspatial grid object
[in]magnetic_fieldmagnetic field object
[in]speciescontains species parameters and particles
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]alpha_infraction of particle weight transferred to distribution function every source time step
[in]update_f_and_nwhether to add particle weights in the distribution function used for the source routines
[in]f_source_onis this function ever called with this set to false?
[in]i_itemthe particle or particle vector index
[in,out]distthe species distribution being added to the particle contributions
[in,out]normthe normalization coefficient used for the grid <–> particle interpolation
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void update_f0_sp_c_pseudo_inv ( const Simulation< Device > &  sml,
const Grid< Device > &  grid,
const MagneticField< Device > &  magnetic_field,
const Species< Device > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< Device > &  pol_decomp,
double  alpha_in,
bool  update_f_and_n,
bool  f_source_on,
const Pseudo_inverse< Device > &  pseudo_inv,
int  i_item,
const VGridDistribution< DeviceType > &  dist,
const VGridDistribution< DeviceType > &  norm,
const VGridDistribution< DeviceType > &  f0g 
)

Loop over particles and interpolate weights to grid distribution. Pseudo-inverse version.

Parameters
[in]smlcontains simulation control parameters
[in]gridspatial grid object
[in]magnetic_fieldmagnetic field object
[in]speciescontains species parameters and particles
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]alpha_infraction of particle weight transferred to distribution function every source time step
[in]update_f_and_nwhether to add particle weights in the distribution function used for the source routines
[in]f_source_onis this function ever called with this set to false?
[in]pseudo_invpseudo-inverse object (contains pseudo-inverse arrays)
[in]i_itemthe particle or particle vector index
[in,out]distthe species distribution being added to the particle contributions
[in,out]normthe normalization coefficient used for the grid <–> particle interpolation
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function: