]> hackdaworld.org Git - physik/posic.git/commitdiff
fixed virial calc!
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 18 Aug 2008 10:16:20 +0000 (12:16 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 18 Aug 2008 10:16:20 +0000 (12:16 +0200)
potentials/albe_orig.c

index 46e160630cf160dfec4a912f27796d444e84d2b6..908f6ddb3639fe381126ba0016ae709170f8b7b4 100644 (file)
@@ -372,7 +372,7 @@ int albe_orig_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) {
@@ -430,7 +430,7 @@ int albe_orig_mult_3bp_k2(t_moldyn *moldyn,
        exchange=&(params->exchange);
        kcount=exchange->kcount;
 
-       if(kcount>ALBE_MAXN)
+       if(kcount>ALBE_ORIG_MAXN)
                printf("FATAL: neighbours!\n");
 
        /* d_ik2 */
@@ -500,13 +500,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);
@@ -528,13 +528,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++;