gmx_bool bResetCountersHalfMaxH = FALSE;
gmx_bool bVV, bIterativeCase, bFirstIterate, bTemp, bPres, bTrotter;
gmx_bool bUpdateDoLR;
- real mu_aver = 0, dvdl;
+ real mu_aver = 0, dvdl_constr;
int a0, a1, gnx = 0, ii;
atom_id *grpindex = NULL;
char *grpname;
bOK = TRUE;
if (!bRerunMD || rerun_fr.bV || bForceUpdate) /* Why is rerun_fr.bV here? Unclear. */
{
- dvdl = 0;
-
- update_constraints(fplog, step, &dvdl, ir, ekind, mdatoms,
+ update_constraints(fplog, step, NULL, ir, ekind, mdatoms,
state, fr->bMolPBC, graph, f,
&top->idef, shake_vir, NULL,
cr, nrnb, wcycle, upd, constr,
if (bTrotter && !bInitStep)
{
- enerd->term[F_DVDL_BONDED] += dvdl; /* only add after iterations */
copy_mat(shake_vir, state->svir_prev);
copy_mat(force_vir, state->fvir_prev);
if (IR_NVT_TROTTER(ir) && ir->eI == eiVV)
copy_rvecn(cbuf, state->v, 0, state->natoms);
}
- if (fr->bSepDVDL && fplog && do_log)
- {
- fprintf(fplog, sepdvdlformat, "Constraint", 0.0, dvdl);
- }
- enerd->term[F_DVDL_BONDED] += dvdl;
-
GMX_MPE_LOG(ev_timestep1);
}
/* if we have constraints, we have to remove the kinetic energy parallel to the bonds */
if (constr && bIfRandomize)
{
- update_constraints(fplog, step, &dvdl, ir, ekind, mdatoms,
+ update_constraints(fplog, step, NULL, ir, ekind, mdatoms,
state, fr->bMolPBC, graph, f,
&top->idef, tmp_vir, NULL,
cr, nrnb, wcycle, upd, constr,
copy_mat(state->box, lastbox);
bOK = TRUE;
+ dvdl_constr = 0;
+
if (!(bRerunMD && !rerun_fr.bV && !bForceUpdate))
{
wallcycle_start(wcycle, ewcUPDATE);
- dvdl = 0;
/* UPDATE PRESSURE VARIABLES IN TROTTER FORMULATION WITH CONSTRAINTS */
if (bTrotter)
{
ekind, M, wcycle, upd, bInitStep, etrtPOSITION, cr, nrnb, constr, &top->idef);
wallcycle_stop(wcycle, ewcUPDATE);
- update_constraints(fplog, step, &dvdl, ir, ekind, mdatoms, state,
+ update_constraints(fplog, step, &dvdl_constr, ir, ekind, mdatoms, state,
fr->bMolPBC, graph, f,
&top->idef, shake_vir, force_vir,
cr, nrnb, wcycle, upd, constr,
* to numerical errors, or are they important
* physically? I'm thinking they are just errors, but not completely sure.
* For now, will call without actually constraining, constr=NULL*/
- update_constraints(fplog, step, &dvdl, ir, ekind, mdatoms,
+ update_constraints(fplog, step, NULL, ir, ekind, mdatoms,
state, fr->bMolPBC, graph, f,
&top->idef, tmp_vir, force_vir,
cr, nrnb, wcycle, upd, NULL,
if (fr->bSepDVDL && fplog && do_log)
{
- fprintf(fplog, sepdvdlformat, "Constraint dV/dl", 0.0, dvdl);
+ fprintf(fplog, sepdvdlformat, "Constraint dV/dl", 0.0, dvdl_constr);
}
- enerd->term[F_DVDL_BONDED] += dvdl;
+ enerd->term[F_DVDL_CONSTR] += dvdl_constr;
}
else if (graph)
{
}
/* only add constraint dvdl after constraints */
- enerd->term[F_DVDL_BONDED] += dvdl;
+ enerd->term[F_DVDL_CONSTR] += dvdl_constr;
if (!bVV || bRerunMD)
{
/* sum up the foreign energy and dhdl terms for md and sd. currently done every step so that dhdl is correct in the .edr */
gmx_mdoutf_t **outf, t_mdebin **mdebin)
{
int start, homenr, i;
- real dvdlambda;
+ real dvdl_constr;
if (fplog)
{
if (!ir->bContinuation)
{
/* Constrain the starting coordinates */
- dvdlambda = 0;
+ dvdl_constr = 0;
constrain(PAR(cr) ? NULL : fplog, TRUE, TRUE, constr, &(*top)->idef,
ir, NULL, cr, -1, 0, mdatoms,
ems->s.x, ems->s.x, NULL, fr->bMolPBC, ems->s.box,
- ems->s.lambda[efptFEP], &dvdlambda,
+ ems->s.lambda[efptFEP], &dvdl_constr,
NULL, NULL, nrnb, econqCoord, FALSE, 0, 0);
}
}
int i;
int start, end;
rvec *x1, *x2;
- real dvdlambda;
+ real dvdl_constr;
s1 = &ems1->s;
s2 = &ems2->s;
if (constr)
{
wallcycle_start(wcycle, ewcCONSTR);
- dvdlambda = 0;
+ dvdl_constr = 0;
constrain(NULL, TRUE, TRUE, constr, &top->idef,
ir, NULL, cr, count, 0, md,
s1->x, s2->x, NULL, bMolPBC, s2->box,
- s2->lambda[efptBONDED], &dvdlambda,
+ s2->lambda[efptBONDED], &dvdl_constr,
NULL, NULL, nrnb, econqCoord, FALSE, 0, 0);
wallcycle_stop(wcycle, ewcCONSTR);
}
gmx_bool bNS;
int nabnsb;
tensor force_vir, shake_vir, ekin;
- real dvdlambda, prescorr, enercorr, dvdlcorr;
+ real dvdl_constr, prescorr, enercorr, dvdlcorr;
real terminate = 0;
/* Set the time to the initial time, the time does not change during EM */
{
/* Project out the constraint components of the force */
wallcycle_start(wcycle, ewcCONSTR);
- dvdlambda = 0;
+ dvdl_constr = 0;
constrain(NULL, FALSE, FALSE, constr, &top->idef,
inputrec, NULL, cr, count, 0, mdatoms,
ems->s.x, ems->f, ems->f, fr->bMolPBC, ems->s.box,
- ems->s.lambda[efptBONDED], &dvdlambda,
+ ems->s.lambda[efptBONDED], &dvdl_constr,
NULL, &shake_vir, nrnb, econqForceDispl, FALSE, 0, 0);
if (fr->bSepDVDL && fplog)
{
- fprintf(fplog, sepdvdlformat, "Constraints", t, dvdlambda);
+ fprintf(fplog, sepdvdlformat, "Constraints", t, dvdl_constr);
}
- enerd->term[F_DVDL_BONDED] += dvdlambda;
+ enerd->term[F_DVDL_CONSTR] += dvdl_constr;
m_add(force_vir, shake_vir, vir);
wallcycle_stop(wcycle, ewcCONSTR);
}
gmx_global_stat_t gstat;
t_graph *graph;
real stepsize, constepsize;
- real ustep, dvdlambda, fnormn;
+ real ustep, fnormn;
gmx_mdoutf_t *outf;
t_mdebin *mdebin;
gmx_bool bDone, bAbort, do_x, do_f;