XGCa
|
Functions related to thermal bath computations. More...
#include "coarse_graining.hpp"
#include "flux_surface_average.hpp"
#include "toroidal_average.hpp"
#include "thermal_bath.hpp"
Functions | |
template<class Device > | |
KOKKOS_INLINE_FUNCTION void | prepare_bin_information (const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const DomainDecomposition< Device > &pol_decomp, const View< double **, CLayout, DeviceType > &bin_f0, const View< double **, CLayout, DeviceType > &bin_df, int i_item, int n_energy, double vmax) |
Computes bin information for particles to be binned on velocity grid. More... | |
template<class Device > | |
KOKKOS_INLINE_FUNCTION void | thermal_bath_for_the_weights (const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const DomainDecomposition< Device > &pol_decomp, const ThermalBath &thermal_bath, const View< double **, CLayout, DeviceType > &bin_f0, const View< double **, CLayout, DeviceType > &bin_df, const View< double **, CLayout, DeviceType > &bin_df_den, const View< double **, CLayout, DeviceType > &bin_df_flow, const View< double **, CLayout, DeviceType > &bin_df_energy, const View< double **, CLayout, DeviceType > &bin_df_count, const View< double *, CLayout, DeviceType > &bin_df_countout, int i_item, double rate) |
Updates weights based on heating to maintain a fixed background. More... | |
void | normalize_by_volume (const Grid< DeviceType > &grid, const Species< DeviceType > &species, const MagneticField< DeviceType > &magnetic_field, View< double **, CLayout, DeviceType > &density, View< double **, CLayout, DeviceType > &flow, View< double **, CLayout, DeviceType > &energy, View< double **, CLayout, DeviceType > &count) |
Normalizes values by volume. More... | |
void | thermal_bath_for_one_species (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Plasma &plasma, Species< DeviceType > &species, const DomainDecomposition< DeviceType > &pol_decomp, const ThermalBath &thermal_bath, View< double **, CLayout, DeviceType > &bin_f0, View< double **, CLayout, DeviceType > &bin_df, View< double **, CLayout, DeviceType > &bin_df_den, View< double **, CLayout, DeviceType > &bin_df_flow, View< double **, CLayout, DeviceType > &bin_df_energy, View< double **, CLayout, DeviceType > &bin_df_count, View< double *, CLayout, DeviceType > &bin_df_countout, const double rate) |
Computes thermal bath for one species. More... | |
void | thermal_bath_for_all_species (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Plasma &plasma, const DomainDecomposition< DeviceType > &pol_decomp, const ThermalBath &thermal_bath, double rate) |
Computes thermal bath for all species. Heat the weights of all non-adiabatic species by [df = df - gamma_k f0 dn/n0. More... | |
Functions related to thermal bath computations.
void normalize_by_volume | ( | const Grid< DeviceType > & | grid, |
const Species< DeviceType > & | species, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
View< double **, CLayout, DeviceType > & | density, | ||
View< double **, CLayout, DeviceType > & | flow, | ||
View< double **, CLayout, DeviceType > & | energy, | ||
View< double **, CLayout, DeviceType > & | count | ||
) |
Normalizes values by volume.
grid | Grid object. |
species | Species object. |
magnetic_field | Magnetic field object. |
density | View of density values. |
flow | View of flow values. |
energy | View of energy values. |
count | View of count values. |
KOKKOS_INLINE_FUNCTION void prepare_bin_information | ( | const Grid< Device > & | grid, |
const MagneticField< Device > & | magnetic_field, | ||
const Species< Device > & | species, | ||
const DomainDecomposition< Device > & | pol_decomp, | ||
const View< double **, CLayout, DeviceType > & | bin_f0, | ||
const View< double **, CLayout, DeviceType > & | bin_df, | ||
int | i_item, | ||
int | n_energy, | ||
double | vmax | ||
) |
Computes bin information for particles to be binned on velocity grid.
Device | Device type. |
grid | Grid object. |
magnetic_field | Magnetic field object. |
species | Species object. |
pol_decomp | Domain decomposition object. |
bin_f0 | View of bin f0 values. |
bin_df | View of bin df values. |
i_item | Index of particle/vector. |
n_energy | Number of energy bins. |
vmax_n | Maximum normalized velocity. |
void thermal_bath_for_all_species | ( | const Grid< DeviceType > & | grid, |
const MagneticField< DeviceType > & | magnetic_field, | ||
Plasma & | plasma, | ||
const DomainDecomposition< DeviceType > & | pol_decomp, | ||
const ThermalBath & | thermal_bath, | ||
double | rate | ||
) |
Computes thermal bath for all species. Heat the weights of all non-adiabatic species by [df = df - gamma_k f0 dn/n0.
grid | Grid object. |
magnetic_field | Magnetic field object. |
plasma | Plasma object. |
pol_decomp | Domain decomposition object. |
thermal_bath | Thermal bath parameters. |
rate | Heating rate. |
void thermal_bath_for_one_species | ( | const Grid< DeviceType > & | grid, |
const MagneticField< DeviceType > & | magnetic_field, | ||
Plasma & | plasma, | ||
Species< DeviceType > & | species, | ||
const DomainDecomposition< DeviceType > & | pol_decomp, | ||
const ThermalBath & | thermal_bath, | ||
View< double **, CLayout, DeviceType > & | bin_f0, | ||
View< double **, CLayout, DeviceType > & | bin_df, | ||
View< double **, CLayout, DeviceType > & | bin_df_den, | ||
View< double **, CLayout, DeviceType > & | bin_df_flow, | ||
View< double **, CLayout, DeviceType > & | bin_df_energy, | ||
View< double **, CLayout, DeviceType > & | bin_df_count, | ||
View< double *, CLayout, DeviceType > & | bin_df_countout, | ||
const double | rate | ||
) |
Computes thermal bath for one species.
grid | Grid object. |
magnetic_field | Magnetic field object. |
plasma | Plasma object. |
species | Species object. |
pol_decomp | Domain decomposition object. |
thermal_bath | Thermal bath parameters. |
bin_f0 | View of bin f0 values. |
bin_df | View of bin df values. |
bin_df_den | View of bin df density values. |
bin_df_flow | View of bin df flow values. |
bin_df_energy | View of bin df energy values. |
bin_df_count | View of bin df count values. |
bin_df_countout | View of bin df countout values. |
rate | Heating rate. |
KOKKOS_INLINE_FUNCTION void thermal_bath_for_the_weights | ( | const Grid< Device > & | grid, |
const MagneticField< Device > & | magnetic_field, | ||
const Species< Device > & | species, | ||
const DomainDecomposition< Device > & | pol_decomp, | ||
const ThermalBath & | thermal_bath, | ||
const View< double **, CLayout, DeviceType > & | bin_f0, | ||
const View< double **, CLayout, DeviceType > & | bin_df, | ||
const View< double **, CLayout, DeviceType > & | bin_df_den, | ||
const View< double **, CLayout, DeviceType > & | bin_df_flow, | ||
const View< double **, CLayout, DeviceType > & | bin_df_energy, | ||
const View< double **, CLayout, DeviceType > & | bin_df_count, | ||
const View< double *, CLayout, DeviceType > & | bin_df_countout, | ||
int | i_item, | ||
double | rate | ||
) |
Updates weights based on heating to maintain a fixed background.
Device | Device type. |
grid | Grid object. |
magnetic_field | Magnetic field object. |
species | Species object. |
pol_decomp | Domain decomposition object. |
thermal_bath | Thermal bath parameters. |
bin_f0 | View of bin f0 values. |
bin_df | View of bin df values. |
bin_df_den | View of bin df density values. |
bin_df_flow | View of bin df flow values. |
bin_df_energy | View of bin df energy values. |
bin_df_count | View of bin df count values. |
bin_df_countout | View of bin df countout values. |
i_item | Index of particle/vector. |
rate | Heating rate. |