Introduce virtual sites test
authorPascal Merz <pascal.merz@me.com>
Tue, 16 Feb 2021 08:47:10 +0000 (08:47 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 16 Feb 2021 08:47:10 +0000 (08:47 +0000)
commit07d0b72febae030e9bd8b4eb14599ae6150c773e
tree65aa99322f705d1983337bcca822a910d5531664
parent5aeff9a01073814d8757ae842c7abb8bed08e854
Introduce virtual sites test

The virtual site tests contain two parts:

1. A reference implementation. The virtual sites code in mdrun is
   difficult to unit-test, since the function calls require data
   structures which are not available in our current testing
   framework. To circumvent that problem, a reference implementation
   is introduced in the tests. The reference implementation can be
   unit-tested, and can be compared to end-to-end mdrun output,
   which leads to a situation comparable to having unit and end-to-end
   tests for the virtual sites implementation. Additionally, the
   reference implementation is simplified and kept close to the
   analytical formulas, which makes verification by eye easier. The
   current unit tests compare the position calculation to the velocity
   calculation, ensuring that the latter is indeed the derivative of
   the first. Additional unit tests could be addded.

2. End-to-end tests. This ensures that all virtual site types can be
   run, and that the trajectory of the virtual site matches the
   trajectory of the real sites, using the reference implementation.
   These tests check that the mdrun implementation agrees with the
   reference implementation, and that real and virtual site reporting
   does not get out of sync.

Note that the reference implementation also includes virtual velocities,
which are, however, not used to test simulation output yet. This will
be introduced once the new velocity definitions are implemented in
mdrun.

Refs #3866
src/programs/mdrun/tests/CMakeLists.txt
src/programs/mdrun/tests/virtualsites.cpp [new file with mode: 0644]
src/testutils/simulationdatabase.cpp
src/testutils/simulationdatabase/vsite_test.gro [new file with mode: 0644]
src/testutils/simulationdatabase/vsite_test.ndx [new file with mode: 0644]
src/testutils/simulationdatabase/vsite_test.top [new file with mode: 0644]