|
ImpactX
|
#include <InitDistribution.H>
Public Member Functions | |
| InitSingleParticleSpin (distribution::SpinvMF spinv, amrex::ParticleReal *AMREX_RESTRICT part_sx, amrex::ParticleReal *AMREX_RESTRICT part_sy, amrex::ParticleReal *AMREX_RESTRICT part_sz) | |
| InitSingleParticleSpin ()=delete | |
| InitSingleParticleSpin (InitSingleParticleSpin const &)=default | |
| InitSingleParticleSpin (InitSingleParticleSpin &&)=default | |
| ~InitSingleParticleSpin ()=default | |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void | operator() (amrex::Long i, amrex::RandomEngine const &engine) const |
Private Attributes | |
| distribution::SpinvMF const | m_spinv |
| amrex::ParticleReal *const AMREX_RESTRICT | m_part_sx |
| amrex::ParticleReal *const AMREX_RESTRICT | m_part_sy |
| amrex::ParticleReal *const AMREX_RESTRICT | m_part_sz |
Initialize a single particle's spin using the SpinvMF distribution
Note: we usually would just write a C++ lambda below in ParallelForRNG. 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
|
inline |
Constructor taking in pointers to particle data
| spinv | spin distribution function to call |
| part_sx | the array to the particle spin in x (sx) |
| part_sy | the array to the particle spin in y (sy) |
| part_sz | the array to the particle spin in z (sz) |
|
delete |
|
default |
|
default |
|
default |
|
inline |
Initialize the spin for a single particle
| i | particle index in the current box |
| engine | a random number engine (with associated state) |
|
private |
|
private |
|
private |
|
private |