From: hackbard Date: Mon, 18 Aug 2008 11:51:31 +0000 (+0200) Subject: fixed virial calc in new albe pot X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=520d9dd22e61fb0b303733421d760da609dd1b3c;p=physik%2Fposic.git fixed virial calc in new albe pot --- diff --git a/potentials/albe.c b/potentials/albe.c index e8aee74..9d8336e 100644 --- a/potentials/albe.c +++ b/potentials/albe.c @@ -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;