v3_add(&(aj->f),&(aj->f),&force);
/* virial */
- virial_calc(aj,&force,&(exchange->dist_ij));
+ virial_calc(ai,&force,&(exchange->dist_ij));
#ifdef DEBUG
if(moldyn->time>DSTART&&moldyn->time<DEND) {
exchange=&(params->exchange);
kcount=exchange->kcount;
- if(kcount>ALBE_MAXN)
+ if(kcount>ALBE_ORIG_MAXN)
printf("FATAL: neighbours!\n");
/* d_ik2 */
}
#endif
+ /* virial */
+ virial_calc(ai,&force,&dist_ij);
+
/* force contribution to atom i */
v3_scale(&force,&force,-1.0);
v3_add(&(ai->f),&(ai->f),&force);
- /* virial */
- virial_calc(ai,&force,&dist_ij);
-
/* derivative wrt k */
v3_scale(&force,&dist_ik,-1.0*dfcg); // dri rik = - drk rik
v3_scale(&tmp,&dcosdrk,fcdg);
}
#endif
+ /* virial */
+ virial_calc(ai,&force,&dist_ik);
+
/* force contribution to atom i */
v3_scale(&force,&force,-1.0);
v3_add(&(ai->f),&(ai->f),&force);
- /* virial */
- virial_calc(ai,&force,&dist_ik);
-
/* increase k counter */
exchange->kcount++;