# tree_d_3d.kernels.quadtree_quadrants.quadtree_quadrants_pyccel

*module*

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

``quadtree_quadrants_cuda.cu`` next to this file is the CUDA version (GPU) and
``quadtree_quadrants_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/quadtree_quadrants/quadtree_quadrants_pyccel.py#L1-L1)

## tree_d_3d.kernels.quadtree_quadrants.quadtree_quadrants_pyccel.quadtree_quadrants

*function*

```python
def quadtree_quadrants(pos: float[:, :], perm: int64[:], slot_node: int64[:], node_center: float[:, :], node_child: int64[:], quadrant: int64[:]) -> None
```

One level of the tree build: the child quadrant of every sorted particle.

Slot ``k`` holds particle ``perm[k]`` in node ``slot_node[k]``. ``quadrant[k]``
becomes -1 if that node does not split (``node_child`` < 0), and otherwise
0..3 for the upper left, upper right, lower left and lower right child.

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