}
debug_gmx();
-
- /* Calculate center of mass velocity if necessary, also parallellized */
- if (bStopCM && !bRerunMD && bEner)
- {
- calc_vcm_grp(fplog,mdatoms->start,mdatoms->homenr,mdatoms,
- state->x,state->v,vcm);
- }
}
- if (bTemp || bPres || bEner || bConstrain)
+ /* Calculate center of mass velocity if necessary, also parallellized */
+ if (bStopCM)
+ {
+ calc_vcm_grp(fplog,mdatoms->start,mdatoms->homenr,mdatoms,
+ state->x,state->v,vcm);
+ }
+
+ if (bTemp || bStopCM || bPres || bEner || bConstrain)
{
if (!bGStat)
{
wallcycle_start(wcycle,ewcMoveE);
GMX_MPE_LOG(ev_global_stat_start);
global_stat(fplog,gstat,cr,enerd,force_vir,shake_vir,mu_tot,
- ir,ekind,constr,vcm,
+ ir,ekind,constr,bStopCM ? vcm : NULL,
gs != NULL ? eglsNR : 0,gs_buf,
top_global,state,
*bSumEkinhOld,flags);
mdatoms->massT,mdatoms->tmass,ekind->ekin);
}
- if (bEner) {
- /* Do center of mass motion removal */
- if (bStopCM && !bRerunMD) /* is this correct? Does it get called too often with this logic? */
- {
- check_cm_grp(fplog,vcm,ir,1);
- do_stopcm_grp(fplog,mdatoms->start,mdatoms->homenr,mdatoms->cVCM,
- state->x,state->v,vcm);
- inc_nrnb(nrnb,eNR_STOPCM,mdatoms->homenr);
- }
+ /* Do center of mass motion removal */
+ if (bStopCM)
+ {
+ check_cm_grp(fplog,vcm,ir,1);
+ do_stopcm_grp(fplog,mdatoms->start,mdatoms->homenr,mdatoms->cVCM,
+ state->x,state->v,vcm);
+ inc_nrnb(nrnb,eNR_STOPCM,mdatoms->homenr);
+ }
+ if (bEner)
+ {
/* Calculate the amplitude of the cosine velocity profile */
ekind->cosacc.vcos = ekind->cosacc.mvcos/mdatoms->tmass;
}