XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
coarse_graining.cpp File Reference
#include <Kokkos_Atomic.hpp>
#include "timer_macro.hpp"
#include "get_current_triangles.hpp"
#include "getf0.hpp"
#include "globals.hpp"
#include "sml.hpp"
#include "magnetic_field.hpp"
#include "grid.hpp"
#include "particles.hpp"
#include "plasma.hpp"
#include "vgrid_distribution.hpp"
#include "domain_decomposition.hpp"
#include "grid_field_pack.hpp"
#include "coarse_graining.hpp"
Include dependency graph for coarse_graining.cpp:

Functions

template<class Device >
KOKKOS_INLINE_FUNCTION void compute_bin_weight (const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const VelocityGrid &vgrid, const DomainDecomposition< Device > &pol_decomp, const VGridDistribution< Device > &bin_weight, const VGridDistribution< Device > &bin_count, const int i_item)
 Compute the node, imu, ivp, bin_weight, and bin_counter for particles. More...
 
template<class Device >
KOKKOS_INLINE_FUNCTION void coarse_graining_of_weights (const double rate, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const VelocityGrid &vgrid, const DomainDecomposition< Device > &pol_decomp, const VGridDistribution< Device > &bin_weight, int i_item)
 Update the weights based on coarse graining. More...
 
void coarse_graining_of_one_species (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Plasma &plasma, Species< DeviceType > &species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, const double rate)
 Coarse grain the weights of one species. More...
 
void coarse_graining_of_all_species (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Plasma &plasma, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, const double rate)
 Coarse grain the weights of all species. More...
 

Function Documentation

void coarse_graining_of_all_species ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Plasma plasma,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
const double  rate 
)

Coarse grain the weights of all species.

This function calculates and updates the weights of all non-adiabatic species based on coarse graining.

Parameters
gridGrid object containing information about the grid.
magnetic_fieldMagneticField object containing magnetic field information.
plasmaPlasma object containing plasma data.
vgridVelocityGrid object containing velocity grid information.
pol_decompDomainDecomposition object containing domain decomposition information.
rateCoarse graining rate.

Here is the call graph for this function:

Here is the caller graph for this function:

void coarse_graining_of_one_species ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Plasma plasma,
Species< DeviceType > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
const double  rate 
)

Coarse grain the weights of one species.

This function calculates and updates the weights of one species based on coarse graining.

Parameters
gridGrid object containing information about the grid.
magnetic_fieldMagneticField object containing magnetic field information.
plasmaPlasma object containing plasma data.
speciesSpecies object containing particle data.
vgridVelocityGrid object containing velocity grid information.
pol_decompDomainDecomposition object containing domain decomposition information.
rateCoarse graining rate.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void coarse_graining_of_weights ( const double  rate,
const Grid< Device > &  grid,
const MagneticField< Device > &  magnetic_field,
const Species< Device > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< Device > &  pol_decomp,
const VGridDistribution< Device > &  bin_weight,
int  i_item 
)

Update the weights based on coarse graining.

Coarse graining of weights using the given rate.

Template Parameters
DeviceType of the device (e.g., CPU or GPU).
Parameters
rateCoarse graining rate.
gridGrid object containing information about the grid.
magnetic_fieldMagneticField object containing magnetic field information.
speciesSpecies object containing particle data.
vgridVelocityGrid object containing velocity grid information.
pol_decompDomainDecomposition object containing domain decomposition information.
bin_weightVGridDistribution object for bin weights.
i_itemParticle index.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void compute_bin_weight ( const Grid< Device > &  grid,
const MagneticField< Device > &  magnetic_field,
const Species< Device > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< Device > &  pol_decomp,
const VGridDistribution< Device > &  bin_weight,
const VGridDistribution< Device > &  bin_count,
const int  i_item 
)

Compute the node, imu, ivp, bin_weight, and bin_counter for particles.

Bin for particles with the same node need to be binned on the velocity grid. bin_weight(node, imu, ivp, isp) where isp can be 1 for species.

Template Parameters
DeviceType of the device (e.g., CPU or GPU).
Parameters
gridGrid object containing information about the grid.
magnetic_fieldMagneticField object containing magnetic field information.
speciesSpecies object containing particle data.
vgridVelocityGrid object containing velocity grid information.
pol_decompDomainDecomposition object containing domain decomposition information.
bin_weightVGridDistribution object for bin weights.
bin_countVGridDistribution object for bin counts.
i_itemParticle index.

Here is the call graph for this function:

Here is the caller graph for this function: