Particle sampling
GEMPIC.ParticleSampler — TypeParticleSampler{D,V}( sampling_type, symmetric, dims, n_particles)Particle initializer class with various functions to initialize a particle.
sampling_type::randomor:sobolsymmetric:trueorfalsen_particles: number of particles
GEMPIC.sample! — Methodsample!( pg, ps, df, mesh)Sample from a Particle sampler
pg: Particle groupps: Particle samplerdf: Distribution functionxmin: lower bound of the domaindimx: length of the domain.
GEMPIC.sample_all — Methodsample_all( ps, pg, df, mesh )Helper function for pure sampling
GEMPIC.sample_sym — Methodsample_sym( ps, pg, df, mesh )Helper function for antithetic sampling in 1d2v
Special case of the Landau Damping
GEMPIC.LandauDamping — TypeLandau( α, kx)Test structure to initialize a particles distribtion for Landau damping test case in 1D1V and 1D2V
GEMPIC.sample! — Methodsample!(d, pg)Sampling from a probability distribution to initialize a Landau damping in 1D2V space.
\[f_0(x,v,t) = \frac{n_0}{2π v_{th}^2} ( 1 + \alpha cos(k_x x)) exp( - \frac{v_x^2+v_y^2}{2 v_{th}^2})\]
The newton function solves the equation $P(x)-r=0$ with Newton’s method
\[x^{n+1} = x^n – (P(x)-(2\pi r / k)/f(x) \]
with
\[P(x) = \int_0^x (1 + \alpha cos(k_x y)) dy = x + \frac{\alpha}{k_x} sin(k_x x)\]
Spin version
GEMPIC.sample! — Methodsample!( pg, ps, df, mesh)Sample from a Particle sampler
pg: Particle groupps: Particle samplerdf: Distribution functionxmin: lower bound of the domainLx: length of the domain.