# tree_d_3d.kernels.dual_traverse.dual_traverse_pyccel

*module*

The Pyccel version (CPU) of the ``dual_traverse`` kernel of the FMM at targets.

``dual_traverse_numpy.py`` next to this file is the version for machines without Pyccel,
with the same arguments; the folder's ``__init__.py`` declares the kernel (see
`tree_d_3d.kernels`).

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

## tree_d_3d.kernels.dual_traverse.dual_traverse_pyccel.dual_traverse

*function*

```python
def dual_traverse(t_center: float[:, :], t_half: float[:], t_start: int64[:], t_end: int64[:], t_child: int64[:], s_center: float[:, :], s_half: float[:], s_start: int64[:], s_end: int64[:], s_child: int64[:], theta: float, stack: int64[:, :], m2l: int64[:, :], p2p: int64[:, :], counts: int64[:]) -> None
```

Pairs (target cell, source cell) from (root, root), depth first.

A pair is an M2L pair if ``sqrt(2) (h_t + h_s) < theta d`` (``d`` the centre
distance), a P2P pair if both are leaves, and otherwise splits the larger cell
(the one that is not a leaf). Empty cells are dropped (the lists depend on the cells only,
not on the charges). ``counts`` holds the numbers of M2L and P2P pairs; a
full list or stack sets ``counts[2] = 1`` and the lists are incomplete (``counts``
still count every pair met, a hint for the sizes).

[View source](https://github.com/max-models/tree-d-3d/blob/devel/src/tree_d_3d/kernels/dual_traverse/dual_traverse_pyccel.py#L14-L86)
