Add tests for selection mass evaluation and fix it.
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 8 Feb 2013 13:26:47 +0000 (15:26 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 13 Feb 2013 21:27:13 +0000 (22:27 +0100)
commit9edd19d5572de6c38ddf03b9ce64266d76d10f5d
tree0a35b2cec2be9e758647b30d4f2539ad68b34c94
parent0c77aae90fbf9e0528d017cae45179a9a9982acf
Add tests for selection mass evaluation and fix it.

Removed unnecessary and at times incorrect precalculation of total
masses and charges for selected positions. Evaluate them again for each
frame if they may have changed.

Noticed when adding some tests for this behavior; the tests are also
added here.

Also store the masses and charges again in continuous arrays in
preparation for exposing those arrays.

Fixes #1145.

Change-Id: Ifa23d042706d9f2a0b8aa142338812f055f6f60a
src/gromacs/selection/evaluate.cpp
src/gromacs/selection/selection.cpp
src/gromacs/selection/selection.h
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_ComputesMassesAndCharges.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_ComputesMassesAndChargesWithoutTopology.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesCharge.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesMass.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/referencedata.xsl
src/gromacs/selection/tests/selectioncollection.cpp