XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
initialize_particles.cpp File Reference
#include "rng_seed.hpp"
#include "globals.hpp"
#include "basic_physics.hpp"
#include "linear_1d_interpolation.hpp"
#include "sml.hpp"
#include "magnetic_field.hpp"
#include "grid.hpp"
#include "plasma.hpp"
#include "get_current_triangles.hpp"
#include "grid_field_pack.hpp"
#include "getf0.hpp"
#include "shift.hpp"
Include dependency graph for initialize_particles.cpp:

Classes

struct  ParticleLoadingParams
 
struct  LoadingFactor
 
struct  InitialWeights
 

Functions

double * get_grid_qsafety_loc ()
 
double * get_grid_theta_loc ()
 
int * get_grid_psi_surf_map_loc ()
 
template<GeometryType GT>
KOKKOS_INLINE_FUNCTION double r_distribution (double rdim, double roffset, double rand)
 
template<>
KOKKOS_INLINE_FUNCTION double r_distribution< GeometryType::CylindricalLimit > (double rdim, double roffset, double rand)
 
template<>
KOKKOS_INLINE_FUNCTION double r_distribution< GeometryType::Toroidal > (double rdim, double roffset, double rand)
 
void uniform_spatial_distribution (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const DomainDecomposition< DeviceType > &pol_decomp, const ParticleLoadingParams &input_params, const LoadingFactor &loading_factor, double &marker_den, const View< double *, DeviceType > &marker_den_tri, Species< DeviceType > &species)
 
KOKKOS_INLINE_FUNCTION void get_v_and_dist (RandGen &rand_gen, double va, double vc, double w, double &v, double &g)
 
KOKKOS_INLINE_FUNCTION void load_flat_v_single (RandGen &rand_gen, const ParticleLoadingParams &input_params, double t_ev_mk, double up, double b, double mass, double charge, double normalization, double &rho, double &mu, double &v_marker_den)
 
KOKKOS_INLINE_FUNCTION void load_maxwellian_v_single (RandGen &rand_gen, const ParticleLoadingParams &input_params, double t_ev, double t_ev_virtual, double up, double b, double mass, double charge, double &rho, double &mu, double &v_marker_den)
 
View< double *, CLayout,
DeviceType
remapped_qsafety (const Grid< DeviceType > &grid)
 
void velocity_distribution (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const ParticleLoadingParams &input_params, double marker_den, const View< double *, DeviceType > &marker_den_tri, const InitialWeights &initial_weights, Species< DeviceType > &species)
 
void adjust_initial_distribution (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Species< DeviceType > &species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp)
 
void load_single_particle (NLReader::NamelistReader &nlr, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const DomainDecomposition< DeviceType > &pol_decomp, const VelocityGrid &vgrid, Plasma &plasma)
 
void initialize_particles (NLReader::NamelistReader &nlr, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const DomainDecomposition< DeviceType > &pol_decomp, const VelocityGrid &vgrid, Plasma &plasma)
 

Variables

constexpr double LOAD_MAXE = 12.0
 

Function Documentation

void adjust_initial_distribution ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Species< DeviceType > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp 
)

Here is the call graph for this function:

int* get_grid_psi_surf_map_loc ( )
double* get_grid_qsafety_loc ( )
double* get_grid_theta_loc ( )
KOKKOS_INLINE_FUNCTION void get_v_and_dist ( RandGen rand_gen,
double  va,
double  vc,
double  w,
double &  v,
double &  g 
)

Here is the caller graph for this function:

void initialize_particles ( NLReader::NamelistReader nlr,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const DomainDecomposition< DeviceType > &  pol_decomp,
const VelocityGrid vgrid,
Plasma plasma 
)

Load particles

Here is the call graph for this function:

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void load_flat_v_single ( RandGen rand_gen,
const ParticleLoadingParams input_params,
double  t_ev_mk,
double  up,
double  b,
double  mass,
double  charge,
double  normalization,
double &  rho,
double &  mu,
double &  v_marker_den 
)

Here is the call graph for this function:

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void load_maxwellian_v_single ( RandGen rand_gen,
const ParticleLoadingParams input_params,
double  t_ev,
double  t_ev_virtual,
double  up,
double  b,
double  mass,
double  charge,
double &  rho,
double &  mu,
double &  v_marker_den 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void load_single_particle ( NLReader::NamelistReader nlr,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const DomainDecomposition< DeviceType > &  pol_decomp,
const VelocityGrid vgrid,
Plasma plasma 
)

Here is the call graph for this function:

Here is the caller graph for this function:

template<GeometryType GT>
KOKKOS_INLINE_FUNCTION double r_distribution ( double  rdim,
double  roffset,
double  rand 
)

Returns an r coordinate distribution for even distribution in volume. In the cylindrical limit, this means an even r distribution. For toroidal geometry, this means larger r values are sampled more.

Parameters
[in]rdimis the width of the r range
[in]roffsetis the minimum r
[in]randis a random number from 0.0 to 1.0
Returns
double is the sampled r value
template<>
KOKKOS_INLINE_FUNCTION double r_distribution< GeometryType::CylindricalLimit > ( double  rdim,
double  roffset,
double  rand 
)
template<>
KOKKOS_INLINE_FUNCTION double r_distribution< GeometryType::Toroidal > ( double  rdim,
double  roffset,
double  rand 
)
View<double*, CLayout,DeviceType> remapped_qsafety ( const Grid< DeviceType > &  grid)

Here is the call graph for this function:

Here is the caller graph for this function:

void uniform_spatial_distribution ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const DomainDecomposition< DeviceType > &  pol_decomp,
const ParticleLoadingParams input_params,
const LoadingFactor loading_factor,
double &  marker_den,
const View< double *, DeviceType > &  marker_den_tri,
Species< DeviceType > &  species 
)

Load particles

Here is the call graph for this function:

Here is the caller graph for this function:

void velocity_distribution ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const ParticleLoadingParams input_params,
double  marker_den,
const View< double *, DeviceType > &  marker_den_tri,
const InitialWeights initial_weights,
Species< DeviceType > &  species 
)

Load particles with velocity

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

constexpr double LOAD_MAXE = 12.0