tree_d_3d.kernels.log_moments_upward.log_moments_upward_pyccel
The Pyccel version (CPU) of the log_moments_upward kernel of the tree.
log_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
| Name | Description |
|---|---|
log_moments_upward | Complex multipole moments a_n = sum_j q_j (z_j - c)**n, n = 0 ... p, of every node. |
log_moments_upwardfunction#
def log_moments_upward(pos: float[:, :], charge: float[:], perm: int64[:], levels: int64[:], node_center: float[:, :], node_start: int64[:], node_end: int64[:], node_child: int64[:], binomial: float[:, :], node_qabs: float[:], moment_re: float[:, :], moment_im: float[:, :]) -> NoneComplex multipole moments a_n = sum_j q_j (z_j - c)**n, n = 0 … p, of every node.
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,
a_n += sum_m C(n, m) a_m(child) s**(n - m). Levels are done from the deepest
up; the nodes of a level are independent.