]> hackdaworld.org Git - physik/posic.git/commitdiff
fixed virial (for albe pot)
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 18 Aug 2008 12:09:55 +0000 (14:09 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 18 Aug 2008 12:09:55 +0000 (14:09 +0200)
potentials/albe.c

index c01ab15106d51834980fed6f9c0836c9336efcb1..02c254fd745aa863ea3a0cb843c086de0fcddc5e 100644 (file)
@@ -355,7 +355,7 @@ int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
        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) {
@@ -479,13 +479,13 @@ if(moldyn->time>DSTART&&moldyn->time<DEND) {
 }
 #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);
@@ -507,13 +507,13 @@ if(moldyn->time>DSTART&&moldyn->time<DEND) {
 }
 #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++;