C++ interface for surface area calculation
commit4f1d4748e2f1de0d45cc167befde4179362b1ae4
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 29 Nov 2014 04:58:51 +0000 (29 06:58 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sun, 14 Dec 2014 15:37:01 +0000 (14 16:37 +0100)
tree17cad591bc0094b679bc0caf6239c722522e5444
parent71490dd65b42210c404919b7a4a648a7f0c8456d
C++ interface for surface area calculation

Convert nsc_dclm_pbc() to a C++ class that provides the same interface,
except that the number of surface dots is specified separately, not for
each calculation.  The internal implementation is still mainly the same,
but the new interface makes it possible to get rid of the global
variables storing the unit sphere surface dots.  This in turn is
requires for making the algorithm thread-safe.

Clean up the implementation a bit by making internal functions static
(they will later become members of the Impl class), and replacing some
error-handling-by-writing-to-stderr-using-global-variables with asserts
or silent proper behavior.

Add tests for all the different paths of the unit sphere surface dot
generation.  These help ensure that the algorithm stays unmodified when
it gets refactored for thread safety.

Change-Id: Icf39eb4d105555b2eafdfd70b219a73c294900af
src/gromacs/trajectoryanalysis/modules/sasa.cpp
src/gromacs/trajectoryanalysis/modules/surfacearea.cpp
src/gromacs/trajectoryanalysis/modules/surfacearea.h
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints12.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints122.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints32.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints42.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/surfacearea.cpp