WarpX
|
Functor that returns 0 or 1 depending on a random draw per particle. More...
#include <FilterFunctors.H>
Public Member Functions | |
RandomFilter (bool a_is_active, amrex::Real a_fraction) | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator() (const SuperParticleType &p, const amrex::RandomEngine &engine) const noexcept |
draw random number, return 1 if number < m_fraction, 1 otherwise More... | |
Private Attributes | |
const bool | m_is_active |
const amrex::Real | m_fraction = 1.0 |
select all particles if false More... | |
Functor that returns 0 or 1 depending on a random draw per particle.
|
inline |
constructor
a_is_active | whether the test is active |
a_fraction | fraction of particles to select |
|
inlinenoexcept |
draw random number, return 1 if number < m_fraction, 1 otherwise
p | one particle |
engine | the random number state and factory |
|
private |
select all particles if false
|
private |