# tree_d_3d.kernels.soften_pairs.soften_pairs_pyccel

*module*

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`.

[View source](https://github.com/max-models/tree-d-3d/blob/devel/src/tree_d_3d/kernels/soften_pairs/soften_pairs_pyccel.py#L1-L1)

## tree_d_3d.kernels.soften_pairs.soften_pairs_pyccel.soften_pairs

*function*

```python
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(r**2 + eps**2), 2 q d / (r**2 + eps**2)) and the bare kernel, to
both partners. ``status[0]`` becomes 1 + a pair index at zero separation.

[View source](https://github.com/max-models/tree-d-3d/blob/devel/src/tree_d_3d/kernels/soften_pairs/soften_pairs_pyccel.py#L15-L51)
