Rectangular grid for analysis nbsearch
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 24 Oct 2014 17:45:21 +0000 (20:45 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 8 Dec 2014 23:00:07 +0000 (00:00 +0100)
commit422ca0b15348db545793987b5e6732124d50cbf3
tree5ced72734f7fc849f9454bbec989293cd6e6c3ec
parentc361bf2a7ce42c630660cda21acbc6cbbb31980e
Rectangular grid for analysis nbsearch

Previously, the grid-based analysis neighborhood search used triclinic
grid cells covering the triclinic unit cell.  This made PBC handling
easy, but all other math is more complicated, and the volume where pairs
are searched is sub-optimal for triclinic boxes.  Now, the grid is
composed of rectangular cells that cover the rectangular unit cell.

The most significant change to support this is that most computation for
what cells to loop over is now done in fractional cell coordinates to
support for non-integral shift of the cell grid at the edges of
triclinic boxes.  The fixed list of cell neighbors is replaced with
on-the-fly computation, since the non-integral shifts mean that the list
of neighbors is not always the same.  This approach also allows the list
of cells in the loop to easily depend on the test position.  Any cells
that are completely outside the cutoff from the current test position
are skipped completely, improving the efficiency also for rectangular
boxes.

Currently, the list of cells looped over is still a rectangular
box, but with rectangular cells, the math to exclude corners should be
straightforward to add in subsequent changes.

Change-Id: I8bd4fa67e26e282cd5bd82dee5edfaf651e59a19
src/gromacs/selection/nbsearch.cpp