]> hackdaworld.org Git - physik/posic.git/commitdiff
fixed virial calc in new albe pot
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 18 Aug 2008 11:51:31 +0000 (13:51 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 18 Aug 2008 11:51:31 +0000 (13:51 +0200)
potentials/albe.c

index e8aee74d4be12cf9abc3821acb5abb064b12fbc2..9d8336e7ca99e7b1fedcaba8803aa8d735196f9a 100644 (file)
@@ -448,7 +448,7 @@ printf("    t: %.15f %.15f %.15f\n",aj->f.x,aj->f.y,aj->f.z);
 #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;
@@ -464,6 +464,9 @@ printf("    t: %.15f %.15f %.15f\n",aj->f.x,aj->f.y,aj->f.z);
 }
 #endif
 
+       /* virial */
+       virial_calc(ai,&force,dist);
+
        v3_scale(&force,&force,-1.0);
        v3_add(&(ai->f),&(ai->f),&force);
 
@@ -474,9 +477,6 @@ printf("    t: %.15f %.15f %.15f\n",ai->f.x,ai->f.y,ai->f.z);
 }
 #endif
 
-       /* virial */
-       virial_calc(ai,&force,dist);
-
        /* reset k counter for second k loop */
        exchange->kcnt=0;
                
@@ -520,6 +520,9 @@ printf("    t: %.15f %.15f %.15f\n",ak->f.x,ak->f.y,ak->f.z);
 }
 #endif
 
+       /* virial */
+       virial_calc(ai,&force,&(exchange->dist[k]));
+
        v3_scale(&force,&force,-1.0);
        v3_add(&(ai->f),&(ai->f),&force);
 
@@ -531,9 +534,6 @@ printf("  ## %f\n",exchange->d[k]);
 }
 #endif
 
-       /* virial */
-       virial_calc(ai,&force,&(exchange->dist[k]));
-
        /* increase k counter */
        exchange->kcnt+=1;