Skip to content
Snippets Groups Projects
Commit 430b6a9b authored by carlocamilloni's avatar carlocamilloni
Browse files

gmx5.1: this should make ENERGY always work

parent 7d2d64e6
No related branches found
No related tags found
No related merge requests found
...@@ -1055,7 +1055,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], ...@@ -1055,7 +1055,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
/* PLUMED HREX */ /* PLUMED HREX */
gmx_bool bHREX; gmx_bool bHREX;
bHREX= repl_ex_nst > 0 && (step>0) && !bLastStep && do_per_step(step,repl_ex_nst) && plumed_hrex; bHREX = bDoReplEx && plumed_hrex;
if(plumedswitch) if(bHREX){ if(plumedswitch) if(bHREX){
gmx_enerdata_t *hrex_enerd; gmx_enerdata_t *hrex_enerd;
...@@ -1249,6 +1249,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], ...@@ -1249,6 +1249,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
if(pversion>3) plumed_cmd(plumedmain,"doCheckPoint",&checkp); if(pversion>3) plumed_cmd(plumedmain,"doCheckPoint",&checkp);
plumed_cmd(plumedmain,"setForces",&f[0][0]); plumed_cmd(plumedmain,"setForces",&f[0][0]);
plumed_cmd(plumedmain,"isEnergyNeeded",&plumedNeedsEnergy); plumed_cmd(plumedmain,"isEnergyNeeded",&plumedNeedsEnergy);
if(plumedNeedsEnergy) force_flags |= (GMX_FORCE_ENERGY | GMX_FORCE_VIRIAL);
clear_mat(plumed_vir); clear_mat(plumed_vir);
plumed_cmd(plumedmain,"setVirial",&plumed_vir[0][0]); plumed_cmd(plumedmain,"setVirial",&plumed_vir[0][0]);
} }
...@@ -1270,11 +1271,9 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], ...@@ -1270,11 +1271,9 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
msmul(plumed_vir,0.5,plumed_vir); msmul(plumed_vir,0.5,plumed_vir);
m_add(force_vir,plumed_vir,force_vir); m_add(force_vir,plumed_vir,force_vir);
} }
if ((repl_ex_nst > 0) && (step > 0) && !bLastStep && if(bDoReplEx) plumed_cmd(plumedmain,"GREX savePositions",NULL);
do_per_step(step,repl_ex_nst)) plumed_cmd(plumedmain,"GREX savePositions",NULL);
if(plumedWantsToStop) ir->nsteps=step_rel+1; if(plumedWantsToStop) ir->nsteps=step_rel+1;
if(bHREX) if(bHREX) plumed_cmd(plumedmain,"GREX cacheLocalUNow",&enerd->term[F_EPOT]);
plumed_cmd(plumedmain,"GREX cacheLocalUNow",&enerd->term[F_EPOT]);
} }
/* END PLUMED */ /* END PLUMED */
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment