tree_d_3d.kernels.pair_energy.pair_energy_numpy
The NumPy version of the pair_energy kernel, for machines without Pyccel.
Vectorized over blocks of particles against the later ones; the same arguments and results as pair_energy_pyccel.py.
Attributes
| Name | Description |
|---|---|
CHUNK | No description. |
Functions
| Name | Description |
|---|---|
pair_energy | Add the exact sum of q_i q_j / sqrt(r2 + eps2) over pairs, without |
CHUNKattributemodule attribute#
CHUNK = 256pair_energyfunction#
def pair_energy(pos: np.ndarray, charge: np.ndarray, softening: float, status: np.ndarray, energy: np.ndarray) -> NoneAdd the exact sum of q_i q_j / sqrt(r2 + eps2) over pairs, without
k_e, to energy[0]; status[0] is 1 for coincident unsoftened charges.