Fix reading of bonded tables
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 3 Mar 2016 15:04:16 +0000 (16:04 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 27 May 2016 10:15:26 +0000 (12:15 +0200)
commit1e8dec802b86078cd3710d06fc09309b1a5f7f28
treede32834addd7c5a9852d49eb49d3c170df5198ae
parentacd1df190381b1fe53f534480beac4b175f32b45
Fix reading of bonded tables

The old approach specified only a filename prefix, and init_forcerec
would expect to be able to append _b0 to generate the filename for the
zeroth bonded table, etc. This failed a check in early command-line
parsing when no file that matched just the prefix could be found.
Pairs are unaffected because there's only one table. Short-ranged
energy-group tables are not affected because they require that the
file with default name exists.

Command-line parsing now requires -tableb to name all tabulated bonded
interaction table files explicitly, and does the normal check that
they exist. init_forcerec will find any name in that list that matches
the required pattern. The concept of a default filename prefix for
tabulated bonded interactions no longer applies, but the old
'table_b0.xvg' naming still works. Added some comments and Doxygen to
explain what the old code was doing. Amended the user documentation
suitably.

One could add further checks e.g. that there are no table filenames
provided that are unused by the topology, but it is likely the need
for such checks will go away when the topology will name the files
directly.

Add some integration tests to show the functionality no longer
produces an error. Infrastructure to actually verify energies and
forces is waiting for review in Gerrit.

Expanded some string- and filename-handling infrastructure to meet
the new needs.

Improved the robustness of the check that the derivative column is
approximately the negative of the numerical derivative of the value
column.

Fixes #1913

Change-Id: If0a7cd69a40eb95fbda20eaaf4c3002782772f0e
16 files changed:
docs/manual/forcefield.tex
src/gromacs/fileio/filenm.c
src/gromacs/fileio/filenm.h
src/gromacs/legacyheaders/force.h
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/tables.c
src/gromacs/utility/stringutil.h
src/programs/mdrun/mdrun.cpp
src/programs/mdrun/runner.cpp
src/programs/mdrun/tests/CMakeLists.txt
src/programs/mdrun/tests/butane1.gro [new file with mode: 0644]
src/programs/mdrun/tests/butane1.ndx [new file with mode: 0644]
src/programs/mdrun/tests/butane_a0.xvg [new file with mode: 0644]
src/programs/mdrun/tests/butane_b0.xvg [new file with mode: 0644]
src/programs/mdrun/tests/butane_d0.xvg [new file with mode: 0644]
src/programs/mdrun/tests/tabulated_bonded_interactions.cpp [new file with mode: 0644]