|
faunus
|
Cell list class templates implementation. More...
Cell list class templates implementation.
A minimal interface to be used in other header files is provided in "celllist.h" file.
A cell list allow to organize members, e.g., particles, into a grid cells hence allowing fast determination of their approximate location in space. Cell lists can be used to quickly compute distances or interaction only between close members. The granuality of distance is determined by the cell size and ussualy arise from some sort of cut off distance.
Each cell list is composed of a grid and a container by double inheritence. The grid (Grid) is responsible for the cell indexing and the container (Container) holds he members assigned to respective cells. The class template CellListBase is a bare-bone implementation with the the essential functionality only. It should be extended using templated mixin to insert features as needed.
The GridType defines basic data types, GridBase calculates the cell index from the cell coordinates and vice versa, generally assuming fixed boundaries. Respective outer classes (FixedBoundaryGrid, PeriodicBoundaryGrid) wrapps boundary conditions.
The convenient template aliases GridBoundary, Grid3DBoundary, Grid3DFixed and Grid3DPeriodic are provided. A simple structure GridOffsets3D contains commonly used neighbours' offsets.
Containers holds the members and allow a simple manipulation (insertion and deletion). A dense (using a vector) and sparse (using a map) implementations are provided.
1.8.13