Skip to content
Projects

tree_d_3d.kernels.soften_pairs.soften_pairs_numpy

The NumPy version of the soften_pairs kernel, for machines without Pyccel.

Vectorized over the listed pairs; the same arguments and results as soften_pairs_pyccel.py.

Attributes

NameDescription
CHUNKNo description.

Functions

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

CHUNKattributemodule attribute#

CHUNK = 256

soften_pairsfunction#

def soften_pairs(pos: np.ndarray, charge: np.ndarray, pairs: np.ndarray, eps2: float, with_potential: int, phi: np.ndarray, field: np.ndarray, status: np.ndarray) -> 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.