Improve analysis nbsearch grid mapping
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 23 Aug 2014 03:27:24 +0000 (06:27 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 29 Oct 2014 18:45:20 +0000 (19:45 +0100)
commite16a45d7cf4668ec98b07b1db00bf5da0d973dc3
treee07576cd74a764e5a2deef3956cca0b7831c16c0
parent5ebcf43349202bce19234e7d3cdec43888e8bafa
Improve analysis nbsearch grid mapping

Now the analysis neighborhood search implements its own version of
put_atoms_in_triclinic_unitcell().  While computing the index of the
correct grid cell, it is relatively easy to produce also the coordinates
that lay within that cell instead of using a separate call.  This
provides two benefits:
 - It avoids rare rounding problems if put_atoms_in_triclinic_unitcell()
   would put the atom right at the edge of the box, but the mapping code
   would consider it outside the box, causing out-of-range grid cell
   index to be generated.
 - It allows to customize the grid mapping more freely (e.g., to create
   grids that are not periodic).

Backported from master with minor changes, fixes #1611.  Kept commit
message the same; the second point will be only relevant for master.

Change-Id: Ib7602fa49a1b8f7882a63843322786b3e51e8e32
(cherry-picked from b3e2e82 in master)
src/gromacs/selection/nbsearch.cpp