# tree_d_3d.kernels.direct_sum.direct_sum_pyccel

*module*

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

``direct_sum_cuda.cu`` next to this file is the CUDA version (GPU) and ``direct_sum_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/direct_sum/direct_sum_pyccel.py#L1-L1)

## tree_d_3d.kernels.direct_sum.direct_sum_pyccel.direct_sum

*function*

```python
def direct_sum(targets: float[:, :], exclude: int64[:], pos: float[:, :], charge: float[:], softening: float, phi: float[:], field: float[:, :], status: int64[:]) -> None
```

All-pairs potential and field at targets; same conventions as the tree.

``status[0]`` becomes 1 + a target that met an unsoftened coincident charge.

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