#endif
/* virial */
- virial_calc(aj,&force,dist);
+ virial_calc(ai,&force,dist);
/* dzeta prefactor = - f_c f_a db, (* -0.5 due to force calc) */
exchange->pre_dzeta=0.5*f_a*f_c*db;
}
#endif
+ /* virial */
+ virial_calc(ai,&force,dist);
+
v3_scale(&force,&force,-1.0);
v3_add(&(ai->f),&(ai->f),&force);
}
#endif
- /* virial */
- virial_calc(ai,&force,dist);
-
/* reset k counter for second k loop */
exchange->kcnt=0;
}
#endif
+ /* virial */
+ virial_calc(ai,&force,&(exchange->dist[k]));
+
v3_scale(&force,&force,-1.0);
v3_add(&(ai->f),&(ai->f),&force);
}
#endif
- /* virial */
- virial_calc(ai,&force,&(exchange->dist[k]));
-
/* increase k counter */
exchange->kcnt+=1;