Skip to content
Projects

plasmacoll.kernels.coulomb_collide_intra.coulomb_collide_intra_numpy

The coulomb_collide_intra kernel without Pyccel: the Pyccel source run as Python.

The pairing and the scattering are sequential per cell, with random numbers drawn outside the kernel, so this version is the Pyccel one interpreted: identical results, slow (use it only on small cases and for checks).

Functions

NameDescription
coulomb_collide_intraCollide the markers of one species with each other, in random pairs per cell.

coulomb_collide_intrafunction#

def coulomb_collide_intra(coef: float[:], cell_start: int[:], velocities: float[:, :], weights: float[:], order: int[:], uniforms: float[:, :], mass: float, method: int) -> None

Collide the markers of one species with each other, in random pairs per cell.

The markers are sorted by cell: cell c holds markers cell_start[c] to cell_start[c + 1] - 1. Each cell’s markers are shuffled (Fisher-Yates with uniforms[0], the permutation written to order) and paired; an odd count starts with a triplet. A pair of relative speed u scatters with s = coef[c] / (2 sum_pairs min(w_i, w_j)) / u**3 (coef is q^4 lnL dt W^2 / (4 pi eps0^2 mu^2 V), W the cell’s weight, V its volume). The heavier marker of a pair changes with the probability w_light / w_heavy (Perez et al. 2012), so with equal weights each pair keeps its momentum and energy exactly. Pair k of a cell uses uniforms[1:5, cell_start[c] + k]; velocities is (3, N), uniforms (5, N); method 0 is Takizuka-Abe, 1 Nanbu.