Use analysis nbsearch for surface area calculation
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 20 Dec 2014 08:13:42 +0000 (10:13 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 6 Jan 2015 11:20:42 +0000 (12:20 +0100)
commit77b02a685affcea37c43d35f8ed0368c6f98d098
treec1941c63e59b83c48db25d6f09bbc6d10f7b1294
parentfa60bf2620de49b0b202fea6d04a978f358312a6
Use analysis nbsearch for surface area calculation

This improves the code in several ways:
 - Amount of code that does the actual computation is reduced by about
   75%, making it significantly easier to follow.
 - Computation with PBC no longer does an all-pairs search.
 - The grid search is correct for triclinic cells (the old
   implementation would not have given correct results if the bug that
   caused an all-pairs search would not have been there).
 - All optimizations in the generic nbsearch code benefit also this
   algorithm: it is no longer limited to using grid cells that are
   larger than the cutoff, reducing the search volume considerably.

Also remove some other micro-optimizations to make the code clearer.
These can be reintroduced if they have a measurable effect on the
performance; a TODO in the code explains what they were.

Change-Id: I8f68c56992305e4b82c128d33cac50315b9d2824
src/gromacs/trajectoryanalysis/modules/sasa.cpp
src/gromacs/trajectoryanalysis/modules/surfacearea.cpp
src/gromacs/trajectoryanalysis/modules/surfacearea.h
src/gromacs/trajectoryanalysis/tests/surfacearea.cpp