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
::random
or:sobol
symmetric
:true
orfalse
n_particles
: number of particles
GEMPIC.newton
— Method newton(r, α, k)
Function to solve $P(x) - r = 0$ where $r \in [0, 2π/k]$
where $P$ is the cdf of $f(x) = 1 + α \cos(k x)$
GEMPIC.sample!
— Methodsample!( pg::ParticleGroup{1,1}, α, k, σ, mesh::OneDGrid)
Sampling from a probability distribution to initialize a Landau damping in 1D1V space.
\[f_0(x,v,t) = \frac{n_0}{\sqrt{2π} v_{th}} ( 1 + \alpha cos(k_x x)) exp( - \frac{v^2}{2 v_{th}^2})\]
GEMPIC.sample!
— Methodsample!( pg::ParticleGroup{2,1}, α, k, σ, mesh::OneDGrid)
Sampling from a probability distribution to initialize a Landau damping in 1D1V space.
\[f_0(x,v,t) = \frac{n_0}{2π v_{th}^2} ( 1 + \alpha cos(k_x x)) exp( - \frac{v^2}{2 v_{th}^2})\]
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)\]