XGC1
|
#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"
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... | |
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.
grid | Grid object containing information about the grid. |
magnetic_field | MagneticField object containing magnetic field information. |
plasma | Plasma object containing plasma data. |
vgrid | VelocityGrid object containing velocity grid information. |
pol_decomp | DomainDecomposition object containing domain decomposition information. |
rate | Coarse graining rate. |
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.
grid | Grid object containing information about the grid. |
magnetic_field | MagneticField object containing magnetic field information. |
plasma | Plasma object containing plasma data. |
species | Species object containing particle data. |
vgrid | VelocityGrid object containing velocity grid information. |
pol_decomp | DomainDecomposition object containing domain decomposition information. |
rate | Coarse graining rate. |
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.
Device | Type of the device (e.g., CPU or GPU). |
rate | Coarse graining rate. |
grid | Grid object containing information about the grid. |
magnetic_field | MagneticField object containing magnetic field information. |
species | Species object containing particle data. |
vgrid | VelocityGrid object containing velocity grid information. |
pol_decomp | DomainDecomposition object containing domain decomposition information. |
bin_weight | VGridDistribution object for bin weights. |
i_item | Particle index. |
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.
Device | Type of the device (e.g., CPU or GPU). |
grid | Grid object containing information about the grid. |
magnetic_field | MagneticField object containing magnetic field information. |
species | Species object containing particle data. |
vgrid | VelocityGrid object containing velocity grid information. |
pol_decomp | DomainDecomposition object containing domain decomposition information. |
bin_weight | VGridDistribution object for bin weights. |
bin_count | VGridDistribution object for bin counts. |
i_item | Particle index. |