From: hackbard Date: Tue, 2 Oct 2007 13:42:12 +0000 (+0200) Subject: changed signes -> more intuitive! X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=684bf7c398cdfa98549b0c7a1fa37e6dc5b35bea;p=physik%2Fposic.git changed signes -> more intuitive! --- diff --git a/moldyn.h b/moldyn.h index 13f4e9b..36e701e 100644 --- a/moldyn.h +++ b/moldyn.h @@ -327,7 +327,7 @@ typedef struct s_moldyn { #define ALBE_R_SI (2.82-0.14) #define ALBE_S_SI (2.82+0.14) #define ALBE_A_SI (3.24*EV/0.842) -#define ALBE_B_SI (1.842*3.24*EV/0.842) +#define ALBE_B_SI (-1.842*3.24*EV/0.842) #define ALBE_R0_SI 2.232 #define ALBE_LAMBDA_SI (1.4761*sqrt(2.0*1.842)) #define ALBE_MU_SI (1.4761*sqrt(2.0/1.842)) @@ -341,7 +341,7 @@ typedef struct s_moldyn { #define ALBE_R_C (2.00-0.15) #define ALBE_S_C (2.00+0.15) #define ALBE_A_C (6.00*EV/1.167) -#define ALBE_B_C (2.167*6.00*EV/1.167) +#define ALBE_B_C (-2.167*6.00*EV/1.167) #define ALBE_R0_C 1.4276 #define ALBE_LAMBDA_C (2.0099*sqrt(2.0*2.167)) #define ALBE_MU_C (2.0099*sqrt(2.0/2.167)) @@ -355,7 +355,7 @@ typedef struct s_moldyn { #define ALBE_R_SIC (2.40-0.20) #define ALBE_S_SIC (2.40+0.20) #define ALBE_A_SIC (4.36*EV/0.847) -#define ALBE_B_SIC (1.847*4.36*EV/0.847) +#define ALBE_B_SIC (-1.847*4.36*EV/0.847) #define ALBE_R0_SIC 1.79 #define ALBE_LAMBDA_SIC (1.6991*sqrt(2.0*1.847)) #define ALBE_MU_SIC (1.6991*sqrt(2.0/1.847)) diff --git a/potentials/albe.c b/potentials/albe.c index 28008b0..688712d 100644 --- a/potentials/albe.c +++ b/potentials/albe.c @@ -98,7 +98,7 @@ int albe_mult_3bp_j1(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) { /* albe 3 body potential function (first k loop) */ int albe_mult_3bp_k1(t_moldyn *moldyn, - t_atom *ai,t_atom *aj,t_atom *ak,u8 bc) { + t_atom *ai,t_atom *aj,t_atom *ak,u8 bc) { t_albe_mult_params *params; t_albe_exchange *exchange; @@ -284,7 +284,7 @@ int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) { } /* force contribution */ - scale=-0.5*(f_c*(df_r+b*df_a)+df_c*(f_r+b*f_a)); + scale=-0.5*(f_c*(df_r-b*df_a)+df_c*(f_r-b*f_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 @@ -306,11 +306,11 @@ int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) { /* virial */ virial_calc(ai,&force,&(exchange->dist_ij)); - /* dzeta prefactor = - 0.5 f_c f_a db */ - exchange->pre_dzeta=-0.5*f_a*f_c*db; + /* dzeta prefactor = - f_c f_a db, (* -0.5 due to force calc) */ + exchange->pre_dzeta=0.5*f_a*f_c*db; /* energy contribution */ - energy=0.5*f_c*(f_r+b*f_a); + energy=0.5*f_c*(f_r-b*f_a); moldyn->energy+=energy; ai->e+=energy; @@ -322,7 +322,7 @@ int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) { /* albe 3 body potential function (second k loop) */ int albe_mult_3bp_k2(t_moldyn *moldyn, - t_atom *ai,t_atom *aj,t_atom *ak,u8 bc) { + t_atom *ai,t_atom *aj,t_atom *ak,u8 bc) { t_albe_mult_params *params; t_albe_exchange *exchange;