static void project(rvec *x, /* positions to project */
t_edpar *edi) /* edi data set */
{
- /* It is not more work to subtract the average position in every s
- * ubroutine again, because these routines are rarely used simultanely */
+ /* It is not more work to subtract the average position in every
+ * subroutine again, because these routines are rarely used simultanely */
project_to_eigvectors(x, &edi->vecs.mon , edi);
project_to_eigvectors(x, &edi->vecs.linfix, edi);
project_to_eigvectors(x, &edi->vecs.linacc, edi);
}
-static void ed_apply_constraints(rvec *xcoll, t_edpar *edi, int step, t_commrec *cr)
+static void ed_apply_constraints(rvec *xcoll, t_edpar *edi, gmx_large_int_t step, t_commrec *cr)
{
int i;
void do_edsam(t_inputrec *ir,
- int step,
+ gmx_large_int_t step,
t_mdatoms *md,
t_commrec *cr,
rvec xs[], /* The local current positions on this processor */
}
/* update radsam references, when required */
- if (do_per_step(step,edi->maxedsteps) && step > edi->presteps)
+ if (do_per_step(step,edi->maxedsteps) && step >= edi->presteps)
{
project(buf->xcoll, edi);
rad_project(edi, buf->xcoll, &edi->vecs.radacc, cr);
}
/* update radacc references, when required */
- if (do_per_step(step,iupdate) && step > edi->presteps)
+ if (do_per_step(step,iupdate) && step >= edi->presteps)
{
edi->vecs.radacc.radius = calc_radius(&edi->vecs.radacc);
if (edi->vecs.radacc.radius - buf->oldrad < edi->slope)
}
/* apply the constraints */
- if (step > edi->presteps && ed_constraints(ed->eEDtype, edi))
- ed_apply_constraints(buf->xcoll, edi, step, cr);
+ if (step >= edi->presteps && ed_constraints(ed->eEDtype, edi))
+ {
+ /* ED constraints should be applied already in the first MD step
+ * (which is step 0), therfore we pass step+1 to the routine */
+ ed_apply_constraints(buf->xcoll, edi, step+1 - ir->init_step, cr);
+ }
/* write to edo, when required */
if (do_per_step(step,edi->outfrq))