desc.particles.SurfaceParticleInitializer
- class desc.particles.SurfaceParticleInitializer(surface, N, E=3500000.0, m=4, q=2, xi_min=-1, xi_max=1, grid=None, seed=0, is_surface_from_eq=False)Source
Randomly sample particles starting on a surface.
Sampling will done on the nodes of the grid based on the surface area represented by |e_theta x e_zeta| at each node. Higher the area, more likely a node will be chosen to spawn a particle. Multiple particles can be initialized at the same node.
- Parameters:
surface (desc.geometry.Surface) – Surface object to initialize samples on.
N (int) – Number of particles to generate.
E (float) – Initial particle kinetic energy, in eV
m (float) – Mass of particles, in proton masses.
q (float) – charge of particles, in units of elementary charge.
xi_min (float) – Minimum and maximum values for randomly sampled normalized parallel velocity. xi = vpar/v.
xi_max (float) – Minimum and maximum values for randomly sampled normalized parallel velocity. xi = vpar/v.
grid (Grid) – Grid used to discretize curve. Default is LinearGrid(M=surface.M, N=surface.N)
seed (int) – Seed for rng.
is_surface_from_eq (bool) – Whether user ensures the given surface is obtained through
eq.get_surface_at(rho=...). If True, additional coordinate mapping is not performed, and particles are initialized directly on the flux surface. Defaults to False. Before setting this to True, make sure the surface and Equilibrium have the same theta and rho definitions.
Methods
copy([deepcopy])Return a (deep)copy of this object.
equiv(other)Compare equivalence between DESC objects.
init_particles(model, field, **kwargs)Initialize particles for a given trajectory model.
load(load_from[, file_format])Initialize from file.
save(file_name[, file_format, file_mode])Save the object.