Skip to content
Projects

tree_d_3d.kernels.soften_pairs.soften_pairs_pyccel

The Pyccel version (CPU) of the soften_pairs kernel of the Barnes-Hut and FMM solvers.

soften_pairs_cuda.cu next to this file is the CUDA version (GPU) and soften_pairs_numpy.py the version for machines without Pyccel, all with the same arguments; the folder’s __init__.py declares the kernel (see :mod:tree_d_3d.kernels). The flat quadtree is described in :mod:tree_d_3d.flat_tree.

Functions

NameDescription
soften_pairsReplace the bare line-charge kernel by the softened one for listed pairs.

soften_pairsfunction#

def soften_pairs(pos: float[:, :], charge: float[:], pairs: int64[:, :], eps2: float, with_potential: int, phi: float[:], field: float[:, :], status: int64[:]) -> None

Replace the bare line-charge kernel by the softened one for listed pairs.

Adds, for each pair, the difference between the softened (-q ln(r2 + eps2), 2 q d / (r2 + eps2)) and the bare kernel, to both partners. status[0] becomes 1 + a pair index at zero separation.