]> hackdaworld.org Git - physik/posic.git/commitdiff
fixed tersoff virial calc
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Wed, 28 May 2008 12:51:35 +0000 (14:51 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Wed, 28 May 2008 12:51:35 +0000 (14:51 +0200)
potentials/tersoff.c

index 3a0ed1846967e159430cde751d250e2c5347a901..5039ff7dd76a6ceb11108172fa61408f6abb5242 100644 (file)
@@ -485,7 +485,8 @@ int tersoff_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
        scale=-0.5*(f_c*(df_r+b*df_a)+df_c*(f_r+b*df_a));
        v3_scale(&force,&(exchange->dist_ij),scale);
        v3_add(&(ai->f),&(ai->f),&force);
-       v3_sub(&(aj->f),&(aj->f),&force); // dri rij = - drj rij
+       v3_scale(&force,&force,-1.0); // dri rij = - drj rij
+       v3_add(&(aj->f),&(aj->f),&force);
 
 #ifdef DEBUG
        if((ai==&(moldyn->atom[0]))|(aj==&(moldyn->atom[0]))) {
@@ -501,6 +502,9 @@ int tersoff_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
        }
 #endif
 
+       /* virial */
+       virial_calc(aj,&force,&(exchange->dist_ij));
+
        /* dzeta prefactor = - 0.5 f_c f_a db */
        exchange->pre_dzeta=-0.5*f_a*f_c*db;