Bug #1145
Masses are incorrectly evaluated for certain types of dynamic selections
Description
For dynamic selections that compute center-of-mass or center-of-geometry positions of more than one atom, the total mass and charge are incorrectly calculated if the set of atoms changes between frames. For example, the following selection can cause issues:
res_com of (y > 2)
The masses are reported for all frames as they were on the initial evaluation, i.e., in this case for the whole residue. They may be too big if not all atoms of the residue are selected by the
y > 2
condition for some particular frame.
Does not affect the behavior of g_select in 4.5 or 4.6, and is a relatively rare use case, so targeting the fix for 5.0 only.
Associated revisions
History
#1 Updated by Teemu Murtola almost 8 years ago
- Status changed from New to In Progress
#2 Updated by Teemu Murtola almost 8 years ago
- Status changed from In Progress to Closed
#3 Updated by Teemu Murtola over 7 years ago
- Category changed from analysis tools to selections
- Affected version set to 5.0
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