|
ImpactX
|
#include <SpinvMF.H>
Public Member Functions | |
| SpinvMF (amrex::ParticleReal mux, amrex::ParticleReal muy, amrex::ParticleReal muz) | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | operator() (amrex::ParticleReal &AMREX_RESTRICT sx, amrex::ParticleReal &AMREX_RESTRICT sy, amrex::ParticleReal &AMREX_RESTRICT sz, amrex::RandomEngine const &engine) const |
Static Public Member Functions | |
| AMREX_GPU_HOST static AMREX_FORCE_INLINE amrex::ParticleReal | inverse_Langevin (amrex::ParticleReal pmag) |
Public Attributes | |
| amrex::ParticleReal | m_muX |
| amrex::ParticleReal | m_muY |
| amrex::ParticleReal | m_muZ |
| amrex::ParticleReal | m_kappa |
| components of a unit vector specifying the mean direction | |
|
inline |
A von Mises-Fisher (vMF) distribution on the unit 2-sphere.
This is used for initializing particle spin. There is a natural bijective correspondence between vMF distributions and mean (polarization) vectors.
The algorithm used here is a simplification of the algorithm described in: C. Pinzon and K. Jung, "Fast Python sampler of the von Mises Fisher distribution", in the special case of the 2-sphere. Additional references used include:
K. V. Mardia and P. E. Jupp, Directional Statistics, Wiley, 1999; S. Kang and H-S. Oh, "Novel sampling method for the von Mises-Fisher distribution", Stat. and Comput. 34, 106 (2024), https://doi.org/10.1007/s11222-024-10419-3.
Return sampling from a vMF distribution.
| mux,muy,muz | components of a unit vector specifying the mean direction |
|
inlinestatic |
This function evaluates the inverse Langevin function, in order to return the value of concentration (kappa) required to produce a given polarization magnitude. It is used to prepare for spin sampling using the vMF distribution.
Here, we use an approximate expression due to R. Petrosyan. See: R. Petrosyan, Rheologica Acta 56, 21-26, 2016; doi:10.1007/s00397-016-0977-9 R. Jedynak, Mathematics and Mechanics of Solids 24, 1-25, 2018; doi:10.1177/1081286518811395
| pmag | polarization magnitude |
|
inline |
Return 1 3D spin (unit) vector
| sx | particle spin component in x |
| sy | particle spin component in y |
| sz | particle spin component in z |
| engine | a random number engine (with associated state) |
| amrex::ParticleReal impactx::distribution::SpinvMF::m_kappa |
components of a unit vector specifying the mean direction
| amrex::ParticleReal impactx::distribution::SpinvMF::m_muX |
| amrex::ParticleReal impactx::distribution::SpinvMF::m_muY |
| amrex::ParticleReal impactx::distribution::SpinvMF::m_muZ |