From: hackbard Date: Wed, 28 May 2008 12:51:35 +0000 (+0200) Subject: fixed tersoff virial calc X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=363a96903678ec6598706a799ba5d7726faa484f;p=physik%2Fposic.git fixed tersoff virial calc --- diff --git a/potentials/tersoff.c b/potentials/tersoff.c index 3a0ed18..5039ff7 100644 --- a/potentials/tersoff.c +++ b/potentials/tersoff.c @@ -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;