Skip to content
Projects

tree_d_3d.kernels.quadtree_moments_upward.quadtree_moments_upward_pyccel

The Pyccel version (CPU) of the quadtree_moments_upward kernel of the tree.

quadtree_moments_upward_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). The flat quadtree is described in tree_d_3d.flat_tree.

Functions

NameDescription
quadtree_moments_upwardSigned moments of every node about its centre; node_s is xx, xy, yy.

quadtree_moments_upwardfunction#

def quadtree_moments_upward(pos: float[:, :], charge: float[:], perm: int64[:], levels: int64[:], node_center: float[:, :], node_start: int64[:], node_end: int64[:], node_child: int64[:], node_q: float[:], node_qabs: float[:], node_p: float[:, :], node_s: float[:, :]) -> None

Signed moments of every node about its centre; node_s is xx, xy, yy.

levels[d]:levels[d + 1] are the nodes at depth d. Leaves sum their particles; a parent adds each child’s moments shifted by s = c_child - c: p += p_c + q_c s and S += S_c + p_c s^T + s p_c^T + q_c s s^T. Levels are done from the deepest up; the nodes of a level are independent.