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 "sml.hpp"
#include "magnetic_field.hpp"
#include "grid.hpp"
#include "plasma.hpp"
Include dependency graph for initialize_particles.cpp:

Classes

struct  ParticleLoadingParams
 
struct  LoadingFactor
 

Functions

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, double up, double b, double mass, double charge, double &rho, double &mu, double &w0_adjust)
 
KOKKOS_INLINE_FUNCTION double w0_adjustment (double en_ev, double t_ev, double t_ev_virtual, double maxe, double load_maxe)
 
KOKKOS_INLINE_FUNCTION void load_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 &w0_adjust)
 
void maxwellian_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, Species< DeviceType > &species)
 
void initialize_particles (NLReader::NamelistReader &nlr, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const DomainDecomposition< DeviceType > &pol_decomp, Plasma &plasma)
 

Variables

constexpr double LOAD_MAXE = 12.0
 

Function Documentation

KOKKOS_INLINE_FUNCTION void get_v_and_dist ( RandGen rand_gen,
double  va,
double  vc,
double  w,
double &  v,
double &  g 
)
void initialize_particles ( NLReader::NamelistReader nlr,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const DomainDecomposition< DeviceType > &  pol_decomp,
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,
double  up,
double  b,
double  mass,
double  charge,
double &  rho,
double &  mu,
double &  w0_adjust 
)

Here is the call graph for this function:

KOKKOS_INLINE_FUNCTION void load_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 &  w0_adjust 
)

Here is the call graph for this function:

void maxwellian_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,
Species< DeviceType > &  species 
)

Load particles

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 
)
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:

KOKKOS_INLINE_FUNCTION double w0_adjustment ( double  en_ev,
double  t_ev,
double  t_ev_virtual,
double  maxe,
double  load_maxe 
)

Here is the caller graph for this function:

Variable Documentation

constexpr double LOAD_MAXE = 12.0