You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Euler-Lagrange collisions: pair detection is O(n^2) per rank per stage; use a cell (linked-cell) list #2394
In the EL collision work (#2171), s_detect_el_collisions tests all particle pairs on a rank every Runge-Kutta stage, and its lookup table can reach about 192 MB. That is fine for hundreds of particles per rank and expensive at 10^4 or more (10^8 pair tests per stage).
Proposal
Bin particles into cells at least as large as the contact distance (a counting sort on the GPU: histogram with atomics plus a prefix sum), then test only the particle's own and neighbouring cells (3^d): O(n) at bounded density, O(1) per particle. A Verlet skin list rebuilds only when the largest displacement exceeds half the skin. When particles are smaller than a grid cell, the existing mesh cell index can serve as the bin key. Immersed-body detection on master is already linear in the number of ghost points (it scans the marker field within 2 cells), so this only concerns point particles.
Needs
The expected particle count per GPU, to decide when this matters.
Activity
sbryngelson commentedon Nov 22, 2026
Related pull requests: #2171 (EL collisions, open) and #2201 (IBM collision detection, merged).
AI-assisted (Claude Code).