From 405cc128e748b0bae802262953df742abf955139 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Mon, 24 Nov 2014 15:36:13 +0100 Subject: [PATCH] Fixed twin-range + freeze + constraints With twin-range cut-offs, atoms which are both frozen and constrained would experience very large or NaN forces, leading to constraint warnings and errors. Fixes #1639. Change-Id: I1871a87054fec1149c9ed75872451df79a8ac2d2 --- src/gromacs/mdlib/update.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gromacs/mdlib/update.c b/src/gromacs/mdlib/update.c index 93b7f59c1e..c4bdfe3892 100644 --- a/src/gromacs/mdlib/update.c +++ b/src/gromacs/mdlib/update.c @@ -1515,6 +1515,10 @@ static void combine_forces(gmx_update_t upd, { xp[i][d] = state->x[i][d] + fac*f_lr[i][d]*md->invmass[i]; } + else + { + xp[i][d] = state->x[i][d]; + } } } constrain(NULL, FALSE, FALSE, constr, idef, ir, NULL, cr, step, 0, 1.0, md, -- 2.22.0