ImpactX
|
#include <InitDistribution.H>
Public Member Functions | |
InitSingleParticleData (T_Distribution distribution, amrex::ParticleReal *AMREX_RESTRICT part_x, amrex::ParticleReal *AMREX_RESTRICT part_y, amrex::ParticleReal *AMREX_RESTRICT part_t, amrex::ParticleReal *AMREX_RESTRICT part_px, amrex::ParticleReal *AMREX_RESTRICT part_py, amrex::ParticleReal *AMREX_RESTRICT part_pt) | |
InitSingleParticleData ()=delete | |
InitSingleParticleData (InitSingleParticleData const &)=default | |
InitSingleParticleData (InitSingleParticleData &&)=default | |
~InitSingleParticleData ()=default | |
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void | operator() (amrex::Long i, amrex::RandomEngine const &engine) const |
Private Attributes | |
T_Distribution const | m_distribution |
amrex::ParticleReal *const AMREX_RESTRICT | m_part_x |
amrex::ParticleReal *const AMREX_RESTRICT | m_part_y |
amrex::ParticleReal *const AMREX_RESTRICT | m_part_t |
amrex::ParticleReal *const AMREX_RESTRICT | m_part_px |
amrex::ParticleReal *const AMREX_RESTRICT | m_part_py |
amrex::ParticleReal *const AMREX_RESTRICT | m_part_pt |
Initialize a single particle's data using the given distribution
Note: we usually would just write a C++ lambda below in ParallelFor. But, due to restrictions in NVCC as of 11.5, we cannot write a lambda in a lambda as we also std::visit the element types of our lattice elements list. error #3206-D: An extended device lambda cannot be defined inside a generic lambda expression("operator()"). Thus, we fall back to writing a C++ functor here, instead of nesting two lambdas.
Nvidia bug report: 3458976 Minimal demonstrator: https://cuda.godbolt.org/z/39e4q53Ye
T_Distribution | This can be a |
|
inline |
Constructor taking in pointers to particle data
distribution | the type of distribution function to call |
part_x | the array to the particle position (x) |
part_y | the array to the particle position (y) |
part_t | the array to the particle position (t) |
part_px | the array to the particle momentum (x) |
part_py | the array to the particle momentum (y) |
part_pt | the array to the particle momentum (t) |
|
delete |
|
default |
|
default |
|
default |
|
inline |
Initialize the data for a single particle
i | particle index in the current box |
engine | a random number engine (with associated state) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |