XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
distribute_f0g.cpp File Reference
#include "timer_macro.hpp"
#include "send_particles.hpp"
#include "distribute_f0g.hpp"
Include dependency graph for distribute_f0g.cpp:

Functions

template<class Device >
KOKKOS_INLINE_FUNCTION void distribute_f0g_c (const TmpSpecies< Device > &tmp_species, 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, const Kokkos::View< double ****, Kokkos::LayoutRight, DeviceType > &df0g, const Kokkos::View< double ****, Kokkos::LayoutRight, DeviceType > &n, const Kokkos::View< double ***, Kokkos::LayoutRight, DeviceType > &df0g_delete, int iw0, int nw, int i_item)
 
double * get_grid_vol_loc ()
 
void pre_distribute_f0g (int sp_type, double *df0g_h, double *n_h, int *iw0, int *nw)
 
void post_distribute_f0g (int sp_type, double *df0g_h, double *df0g_delete_h)
 
void distribute_f0g (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Species< DeviceType > &species, const TmpSpecies< DeviceType > &tmp_species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, int isp_non_ad)
 
void all_species_distribute_f0g (FortranPtr spall_fptr, const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, std::vector< Species< DeviceType >> &all_species, TmpSpecies< DeviceType > &tmp_species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp)
 

Function Documentation

void all_species_distribute_f0g ( FortranPtr  spall_fptr,
const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
std::vector< Species< DeviceType >> &  all_species,
TmpSpecies< DeviceType > &  tmp_species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp 
)

Loops over all non-adiabatic species and adjusts particle weight to distribute f0g distribution function to particles

Parameters
[in,out]spall_fptris the array of Fortran species objects
[in]smlcontains simulation control parameters
[in]gridis the spatial grid
[in]magnetic_fieldis the magnetic field
[in]all_speciesis the vector of species objects
[in,out]tmp_speciescontains the particle data
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

void distribute_f0g ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Species< DeviceType > &  species,
const TmpSpecies< DeviceType > &  tmp_species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
int  isp_non_ad 
)

Copies f0 data to device, then adjusts particle weight to distribute f0g distribution function to particles

Parameters
[in]smlcontains simulation control parameters
[in]gridis the spatial grid
[in]magnetic_fieldis the magnetic field
[in]speciescontains species parameters
[in,out]tmp_speciescontains the particle data
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]isp_non_adis a separate index tracking non-adiabatic species since if electrons are adiabatic, the Fortran arrays will start at 1 instead of 0 and the pointers need to account for that
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 distribute_f0g_c ( const TmpSpecies< Device > &  tmp_species,
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,
const Kokkos::View< double ****, Kokkos::LayoutRight, DeviceType > &  df0g,
const Kokkos::View< double ****, Kokkos::LayoutRight, DeviceType > &  n,
const Kokkos::View< double ***, Kokkos::LayoutRight, DeviceType > &  df0g_delete,
int  iw0,
int  nw,
int  i_item 
)

Adjusts particle weight to distribute f0g distribution function to particles, and marks cells for deletion if a particle is found there

Parameters
[in,out]tmp_speciescontains the particle data
[in]smlcontains simulation control parameters
[in]gridis the spatial grid
[in]magnetic_fieldis the magnetic field
[in]speciescontains species parameters
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]df0gis the part of the distribution function being transferred to particles
[in]nis the normalization for mesh-particle interpolation
[out]df0g_deletetracks which cells successfully transferred their distribution to particles
[in]iw0and nw are indices to manage how averaging works with XGCA vs XGC1
[in]nwand iw0 are indices to manage how averaging works with XGCA vs XGC1
[in]i_itemis the particle or particle vector index
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

double* get_grid_vol_loc ( )

Here is the caller graph for this function:

void post_distribute_f0g ( int  sp_type,
double *  df0g_h,
double *  df0g_delete_h 
)
void pre_distribute_f0g ( int  sp_type,
double *  df0g_h,
double *  n_h,
int *  iw0,
int *  nw 
)