Avoid cross product with zero vector in rotational pulling.
authorCarsten Kutzner <ckutzne@gwdg.de>
Wed, 12 Mar 2014 15:14:04 +0000 (16:14 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 14 Mar 2014 18:02:14 +0000 (19:02 +0100)
commitb207685897ed4ab3cea11008c29d4b6005cf324d
treeabba1c114d674ac903ac5bfe257f7706f7e4b642
parent352dc4376697bd3fa0c3a043f31ac406e316007f
Avoid cross product with zero vector in rotational pulling.

Fixes #1431 (rotation/flex-t regression test failing on BG/Q)

In do_flex_lowlevel() we checked (by mistake!) for xj-xcn being
zero, although we need to check for yj0-ycn being zero, since
we use yj0-ycn in a cross product in the following lines of code.
I now also replaced the direct check (0 == norm(...)) by checking
what gmx_numzero(norm(...)) returns. The latter replacement
was also applied in the do_flex2_lowlevel() routine. Note that there
the check for small xj-xcn was and is actually correct.

Change-Id: I972b6d67a81e30f297db286cd2224f66753a20aa
src/mdlib/pull_rotation.c