Hipace
|
Basic helper functions that can be used for both plasma and beam species. More...
Functions | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | get_position_unit_cell (amrex::Real *r, const amrex::IntVect &nppc, int i_part, const amrex::RandomEngine &engine, const amrex::GpuArray< int, 3 > rand) |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | get_position_unit_cell (amrex::Real *r, const amrex::IntVect &nppc, int i_part) |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | get_position_unit_cell_fine (amrex::Real *r, bool &do_init, int i_part, const amrex::Array< int, 2 > &nppc_coarse, const amrex::Array< int, 2 > &nppc_fine, const int n_fine_transition_cells, const int i_fine_transition_cells) |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | get_gaussian_random_momentum (amrex::Real *u, const amrex::RealVect u_mean, const amrex::RealVect u_std, const amrex::RandomEngine &engine) |
Basic helper functions that can be used for both plasma and beam species.
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ParticleUtil::get_gaussian_random_momentum | ( | amrex::Real * | u, |
const amrex::RealVect | u_mean, | ||
const amrex::RealVect | u_std, | ||
const amrex::RandomEngine & | engine | ||
) |
Return momentum of 1 particle from a Gaussian random draw.
[in,out] | u | 3D momentum of 1 particle, modified by this function |
[in] | u_mean | Mean value of the random distribution in each dimension |
[in] | u_std | standard deviation of the random distribution in each dimension |
[in] | engine | random number engine |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ParticleUtil::get_position_unit_cell | ( | amrex::Real * | r, |
const amrex::IntVect & | nppc, | ||
int | i_part | ||
) |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ParticleUtil::get_position_unit_cell | ( | amrex::Real * | r, |
const amrex::IntVect & | nppc, | ||
int | i_part, | ||
const amrex::RandomEngine & | engine, | ||
const amrex::GpuArray< int, 3 > | rand | ||
) |
During particles initialization, we loop over nppc particles in 1 cell. This function returns the position, in cell size unit, of particle number i_part so that particles are distributed uniformly within the cell.
[in,out] | r | position of the particle, modified by the function |
[in] | nppc | number of particles per cell in each direction |
[in] | i_part | index of current particle, between 0 and nppc-1 |
[in] | engine | random engine |
[in] | rand | whether to randomize position in each cell, per dimension |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ParticleUtil::get_position_unit_cell_fine | ( | amrex::Real * | r, |
bool & | do_init, | ||
int | i_part, | ||
const amrex::Array< int, 2 > & | nppc_coarse, | ||
const amrex::Array< int, 2 > & | nppc_fine, | ||
const int | n_fine_transition_cells, | ||
const int | i_fine_transition_cells | ||
) |