numerics
Loading...
Searching...
No Matches
num::CellList3D< Scalar > Class Template Reference

#include <cell_list_3d.hpp>

Public Member Functions

 CellList3D (Scalar cell_size, Scalar xmin, Scalar xmax, Scalar ymin, Scalar ymax, Scalar zmin, Scalar zmax)
 
template<typename PosAccessor >
void build (PosAccessor &&get_pos, int n)
 
template<typename F >
void query (Scalar px, Scalar py, Scalar pz, F &&f) const
 3x3x3 neighbourhood query around (px, py, pz).
 
template<typename F >
void iterate_pairs (F &&f) const
 
int nx () const noexcept
 
int ny () const noexcept
 
int nz () const noexcept
 
int n_particles () const noexcept
 

Detailed Description

template<typename Scalar>
class num::CellList3D< Scalar >

Definition at line 39 of file cell_list_3d.hpp.

Constructor & Destructor Documentation

◆ CellList3D()

template<typename Scalar >
num::CellList3D< Scalar >::CellList3D ( Scalar  cell_size,
Scalar  xmin,
Scalar  xmax,
Scalar  ymin,
Scalar  ymax,
Scalar  zmin,
Scalar  zmax 
)
inline
Parameters
cell_sizeWidth of one cell (use 2h – kernel support radius).

Definition at line 42 of file cell_list_3d.hpp.

Member Function Documentation

◆ build()

template<typename Scalar >
template<typename PosAccessor >
void num::CellList3D< Scalar >::build ( PosAccessor &&  get_pos,
int  n 
)
inline

Build in O(n + C). PosAccessor: callable int -> std::tuple<Scalar,Scalar,Scalar> (x,y,z)

Definition at line 60 of file cell_list_3d.hpp.

References num::ipow().

Referenced by physics::SpatialHash3D::build().

◆ iterate_pairs()

template<typename Scalar >
template<typename F >
void num::CellList3D< Scalar >::iterate_pairs ( F &&  f) const
inline

Newton's 3rd law pair traversal – 13 forward offsets. Calls f(int i, int j) for each unique unordered pair exactly once.

Definition at line 106 of file cell_list_3d.hpp.

References num::ipow().

Referenced by physics::SpatialHash3D::iterate_pairs().

◆ n_particles()

template<typename Scalar >
int num::CellList3D< Scalar >::n_particles ( ) const
inlinenoexcept

Definition at line 149 of file cell_list_3d.hpp.

◆ nx()

template<typename Scalar >
int num::CellList3D< Scalar >::nx ( ) const
inlinenoexcept

Definition at line 146 of file cell_list_3d.hpp.

◆ ny()

template<typename Scalar >
int num::CellList3D< Scalar >::ny ( ) const
inlinenoexcept

Definition at line 147 of file cell_list_3d.hpp.

◆ nz()

template<typename Scalar >
int num::CellList3D< Scalar >::nz ( ) const
inlinenoexcept

Definition at line 148 of file cell_list_3d.hpp.

◆ query()

template<typename Scalar >
template<typename F >
void num::CellList3D< Scalar >::query ( Scalar  px,
Scalar  py,
Scalar  pz,
F &&  f 
) const
inline

3x3x3 neighbourhood query around (px, py, pz).

Definition at line 82 of file cell_list_3d.hpp.

References num::ipow().

Referenced by physics::SpatialHash3D::query().


The documentation for this class was generated from the following file: