WarpX
Typedefs | Functions
ParticleUtils Namespace Reference

Typedefs

using ParticleType = WarpXParticleContainer::ParticleType
 
using ParticleTileType = WarpXParticleContainer::ParticleTileType
 
using ParticleBins = DenseBins< ParticleType >
 
using index_type = ParticleBins::index_type
 

Functions

ParticleBins findParticlesInEachCell (int const lev, MFIter const &mfi, ParticleTileType const &ptile)
 
amrex::DenseBins< WarpXParticleContainer::ParticleType > findParticlesInEachCell (int const lev, amrex::MFIter const &mfi, WarpXParticleContainer::ParticleTileType const &ptile)
 Find the particles and count the particles that are in each cell. More specifically this function returns an amrex::DenseBins object containing an offset array and a permutation array which can be used to loop over all the cells in a tile and apply an algorithm to particles of a given species present in each cell. Note that this does not rearrange particle arrays. More...
 
AMREX_GPU_HOST_DEVICE AMREX_INLINE void getRandomVector (amrex::Real &x, amrex::Real &y, amrex::Real &z, amrex::RandomEngine const &engine)
 Generate random unit vector in 3 dimensions https://mathworld.wolfram.com/SpherePointPicking.html. More...
 
AMREX_GPU_HOST_DEVICE AMREX_INLINE void RandomizeVelocity (amrex::ParticleReal &ux, amrex::ParticleReal &uy, amrex::ParticleReal &uz, const amrex::ParticleReal vp, amrex::RandomEngine const &engine)
 Function to perform scattering of a particle that results in a random velocity vector with given magnitude. This is used in collision events. More...
 

Typedef Documentation

◆ index_type

using ParticleUtils::index_type = typedef ParticleBins::index_type

◆ ParticleBins

using ParticleUtils::ParticleBins = typedef DenseBins<ParticleType>

◆ ParticleTileType

using ParticleUtils::ParticleTileType = typedef WarpXParticleContainer::ParticleTileType

◆ ParticleType

using ParticleUtils::ParticleType = typedef WarpXParticleContainer::ParticleType

Function Documentation

◆ findParticlesInEachCell() [1/2]

amrex::DenseBins<WarpXParticleContainer::ParticleType> ParticleUtils::findParticlesInEachCell ( int const  lev,
amrex::MFIter const &  mfi,
WarpXParticleContainer::ParticleTileType const &  ptile 
)

Find the particles and count the particles that are in each cell. More specifically this function returns an amrex::DenseBins object containing an offset array and a permutation array which can be used to loop over all the cells in a tile and apply an algorithm to particles of a given species present in each cell. Note that this does not rearrange particle arrays.

Parameters
[in]levthe index of the refinement level.
[in]mfithe MultiFAB iterator.
[in]ptilethe particle tile.

◆ findParticlesInEachCell() [2/2]

ParticleBins ParticleUtils::findParticlesInEachCell ( int const  lev,
MFIter const &  mfi,
ParticleTileType const &  ptile 
)

◆ getRandomVector()

AMREX_GPU_HOST_DEVICE AMREX_INLINE void ParticleUtils::getRandomVector ( amrex::Real &  x,
amrex::Real &  y,
amrex::Real &  z,
amrex::RandomEngine const &  engine 
)

Generate random unit vector in 3 dimensions https://mathworld.wolfram.com/SpherePointPicking.html.

Parameters
[out]xx-component of resulting random vector
[out]yy-component of resulting random vector
[out]zz-component of resulting random vector
[in]enginethe random-engine

◆ RandomizeVelocity()

AMREX_GPU_HOST_DEVICE AMREX_INLINE void ParticleUtils::RandomizeVelocity ( amrex::ParticleReal &  ux,
amrex::ParticleReal &  uy,
amrex::ParticleReal &  uz,
const amrex::ParticleReal  vp,
amrex::RandomEngine const &  engine 
)

Function to perform scattering of a particle that results in a random velocity vector with given magnitude. This is used in collision events.

Parameters