X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fposic.git;a=blobdiff_plain;f=potentials%2Falbe.c;h=d157bae1f744935d33736cf835aefc07294aa51a;hp=677d6e3b6315d48226a4b3da950378b1c0fa865a;hb=a32468230b319b32819f1b20fd28aa9659574d45;hpb=da2d9866e05b1b7a408ecda2b1695e07c30b0533 diff --git a/potentials/albe.c b/potentials/albe.c index 677d6e3..d157bae 100644 --- a/potentials/albe.c +++ b/potentials/albe.c @@ -275,11 +275,17 @@ int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) { db=-0.5*b/(1.0+exchange->zeta_ij); } - /* force contribution */ + /* force contribution for atom i */ scale=-0.5*(f_c*(df_r-b*df_a)+df_c*(f_r-b*f_a)); // - in albe formalism 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 + + /* force contribution for atom j */ + v3_scale(&force,&force,-1.0); // dri rij = - drj rij + v3_add(&(aj->f),&(aj->f),&force); + + /* virial */ + virial_calc(aj,&force,&(exchange->dist_ij)); #ifdef DEBUG if(moldyn->time>DSTART&&moldyn->timetime>DSTART&&moldyn->timedist_ij)); - /* dzeta prefactor = - f_c f_a db, (* -0.5 due to force calc) */ exchange->pre_dzeta=0.5*f_a*f_c*db;