num::cell_list_2d¶
Defined in header <spatial/cell_list.hpp>
template <field scalar>
class cell_list_2d;
Counting-sorted 2D spatial bins for local-neighbor iteration.
Members¶
| member | description |
|---|---|
cell_list_2d(scalar cell_size, scalar xmin, scalar xmax, scalar ymin, scalar ymax) |
Cover the bounding box with padded square cells. |
template <position_accessor_2d<scalar> PosAccessor> void build(PosAccessor &&get_pos, int n) |
Rebuild by counting-sort over cell ids. |
template <typename F> void query(scalar px, scalar py, F &&f) const |
Call f(j) for candidate particles near (px, py). |
template <typename F> void iterate_pairs(F &&f) const |
Visit each candidate pair once. |
integer_range cell_particles(int cx, int cy) const noexcept |
Return the particles stored in one cell. |
int nx() const noexcept |
|
int ny() const noexcept |
|
int n_particles() const noexcept |