tree_d_3d.kernels.dual_traverse.dual_traverse_pyccel
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).
Functions
| Name | Description |
|---|---|
dual_traverse | Pairs (target cell, source cell) from (root, root), depth first. |
dual_traversefunction#
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[:]) -> NonePairs (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).