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

#include <verlet_list.hpp>

Public Member Functions

 VerletList2D (Scalar cutoff, Scalar skin)
 
template<typename PosAccessor >
void build (PosAccessor &&get_pos, int n, const CellList2D< Scalar > &cl)
 Build the neighbour list using a pre-built CellList2D.
 
template<typename PosAccessor >
bool needs_rebuild (PosAccessor &&get_pos, int n) const
 Check whether any particle has moved far enough to invalidate the cached list. O(n), very cheap (just arithmetic, no memory allocation).
 
IntRange neighbors (int i) const noexcept
 Cached neighbours of particle i (within cutoff + skin).
 
Scalar cutoff () const noexcept
 
Scalar skin () const noexcept
 
Scalar ext_cutoff () const noexcept
 
int n_particles () const noexcept
 

Detailed Description

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

Definition at line 49 of file verlet_list.hpp.

Constructor & Destructor Documentation

◆ VerletList2D()

template<typename Scalar >
num::VerletList2D< Scalar >::VerletList2D ( Scalar  cutoff,
Scalar  skin 
)
inline
Parameters
cutoffInteraction cutoff (e.g. 2h for SPH).
skinSkin thickness added to cutoff for the cached list. Larger skin -> fewer rebuilds but more cache entries. Typical: 0.3*cutoff (molecular dynamics) or 0.5*cutoff (SPH, faster particle motion).

Definition at line 56 of file verlet_list.hpp.

Member Function Documentation

◆ build()

template<typename Scalar >
template<typename PosAccessor >
void num::VerletList2D< Scalar >::build ( PosAccessor &&  get_pos,
int  n,
const CellList2D< Scalar > &  cl 
)
inline

Build the neighbour list using a pre-built CellList2D.

The cell list must have been built with cell_size >= cutoff + skin so that a single 3x3 query covers the full extended cutoff.

PosAccessor: callable int -> std::pair<Scalar, Scalar>

Definition at line 68 of file verlet_list.hpp.

References num::ipow().

◆ cutoff()

template<typename Scalar >
Scalar num::VerletList2D< Scalar >::cutoff ( ) const
inlinenoexcept

Definition at line 119 of file verlet_list.hpp.

◆ ext_cutoff()

template<typename Scalar >
Scalar num::VerletList2D< Scalar >::ext_cutoff ( ) const
inlinenoexcept

Definition at line 121 of file verlet_list.hpp.

◆ n_particles()

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

Definition at line 122 of file verlet_list.hpp.

◆ needs_rebuild()

template<typename Scalar >
template<typename PosAccessor >
bool num::VerletList2D< Scalar >::needs_rebuild ( PosAccessor &&  get_pos,
int  n 
) const
inline

Check whether any particle has moved far enough to invalidate the cached list. O(n), very cheap (just arithmetic, no memory allocation).

Returns true if the cell list and Verlet list must be rebuilt before the next force evaluation.

Definition at line 99 of file verlet_list.hpp.

References num::ipow().

◆ neighbors()

template<typename Scalar >
IntRange num::VerletList2D< Scalar >::neighbors ( int  i) const
inlinenoexcept

Cached neighbours of particle i (within cutoff + skin).

Caller should still distance-filter to the true cutoff.

Definition at line 114 of file verlet_list.hpp.

References num::ipow().

◆ skin()

template<typename Scalar >
Scalar num::VerletList2D< Scalar >::skin ( ) const
inlinenoexcept

Definition at line 120 of file verlet_list.hpp.


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