Skip to content
Projects

tree_d_3d.kernels.pair_energy.pair_energy_pyccel

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

pair_energy_cuda.cu next to this file is the CUDA version (GPU) and pair_energy_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
pair_energyAdd the exact sum of q_i q_j / sqrt(r2 + eps2) over pairs, without

pair_energyfunction#

def pair_energy(pos: float[:, :], charge: float[:], softening: float, status: int64[:], energy: float[:]) -> None

Add the exact sum of q_i q_j / sqrt(r2 + eps2) over pairs, without k_e, to energy[0]; status[0] is 1 for coincident unsoftened charges.