Fixed a rare bug in selection position handling.
authorTeemu Murtola <teemu.murtola@cbr.su.se>
Wed, 16 Feb 2011 15:53:32 +0000 (17:53 +0200)
committerTeemu Murtola <teemu.murtola@cbr.su.se>
Wed, 16 Feb 2011 15:53:32 +0000 (17:53 +0200)
If the "whole" prefix was used on a position calculation that applied to
a static selection (e.g., "whole_res_com of name CA CB"), the block data
for the output positions was incorrect.

src/gmxlib/trajana/poscalc.c

index 9a319e6d6875106863f4e0696ac07d319f5951a8..81259fc1d6435c2a56c279d7576eeb419240a5f2 100644 (file)
@@ -1094,7 +1094,8 @@ void
 gmx_ana_poscalc_init_pos(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p)
 {
     gmx_ana_indexmap_init(&p->m, &pc->gmax, pc->coll->top, pc->itype);
-    if (!(pc->flags & POS_DYNAMIC))
+    /* Only do the static optimization when there is no completion */
+    if (!(pc->flags & POS_DYNAMIC) && pc->b.nra == pc->gmax.isize)
     {
         gmx_ana_indexmap_set_static(&p->m, &pc->b);
     }