Skip to content

num::cell_list_3d

Defined in header <spatial/cell_list_3d.hpp>

template <field scalar>
class cell_list_3d;

Particles sorted into cubic cells of a 3D grid.

Members

member description
cell_list_3d(scalar cell_size, scalar xmin, scalar xmax, scalar ymin, scalar ymax, scalar zmin, scalar zmax) Construct cells of side cell_size over the bounding box.
template <position_accessor_2d<scalar> PosAccessor> void build(PosAccessor &&get_pos, int n) Sort the particles into cells again, by counting sort.
template <typename F> void query(scalar px, scalar py, scalar pz, F &&f) const Call f(j) for each particle that may be near \((p_x, p_y, p_z)\).
template <typename F> void iterate_pairs(F &&f) const Call f(i, j) once for each pair of particles that may be near each other.
int nx() const noexcept Return the grid dimensions and the number of particles.
int ny() const noexcept
int nz() const noexcept
int n_particles() const noexcept