X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=potentials%2Ftersoff_orig.c;h=431cfebf5d6343ca597360b481b82200fbf67ac2;hb=HEAD;hp=90121f26bb1cda4855e75abb27a418c66089a177;hpb=0b96eb313c9bfec6272b1f8de0d99c4ce26d1686;p=physik%2Fposic.git diff --git a/potentials/tersoff_orig.c b/potentials/tersoff_orig.c index 90121f2..431cfeb 100644 --- a/potentials/tersoff_orig.c +++ b/potentials/tersoff_orig.c @@ -310,7 +310,7 @@ int tersoff_mult_post_2bp(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) { else { tmp=betaini*pow(zeta,ni-1.0); /* beta^n * zeta^n-1 */ b=(1+zeta*tmp); /* 1 + beta^n zeta^n */ - db=chi*pow(b,-1.0/(2*ni)-1); /* x(...)^(-1/2n - 1) */ + db=chi*pow(b,-1.0/(2.0*ni)-1); /* x(...)^(-1/2n - 1) */ b=db*b; /* b_ij */ db*=-0.5*tmp; /* db_ij */ v3_scale(&force,&(exchange->dzeta_ij),f_a*db); @@ -629,7 +629,7 @@ int tersoff_mult_3bp(t_moldyn *moldyn,t_atom *ai,t_atom *aj,t_atom *ak,u8 bc) { v3_sub(&temp1,&temp1,&temp2); /* there is a minus! */ v3_scale(&temp1,&temp1,-2.0*frac*h_cos/d2_h_cos2); /* dg */ - /* store dg in temp2 and use it for dVjk later */ + /* store dg for use in dV_jk */ v3_copy(&temp2,&temp1); /* f_c_jk + {d,}zeta contribution (df_c_jk = 0) */ @@ -670,8 +670,19 @@ int tersoff_mult_3bp(t_moldyn *moldyn,t_atom *ai,t_atom *aj,t_atom *ak,u8 bc) { // dzeta_jk is simply dg, which is stored in temp2 } /* betajnj * zeta_jk ^ nj-1 */ +printf("FATAL db_jk calc!\n"); +printf("(z1 + z2 + z3 ...)^n != z1^n + z2^n + z3^n + ...\n"); +printf("st00pid me => tersoff_orig is obsolete!\n"); tmp=exchange->betajnj*pow(zeta,(n-1.0)); tmp=-chi/2.0*pow((1+tmp*zeta),(-1.0/(2.0*n)-1))*tmp; +#ifdef DEBUG + if((ai->tag==0)&(aj->tag==864)) { // &(ak->tag==23)) { + printf("\n\n"); + printf("db: ni zeta = %f %f\n", + n,zeta); + printf("\n\n"); + } +#endif v3_scale(&temp2,&temp2,tmp*B*exp(-mu*d_jk)*f_c_jk*0.5); v3_add(&(ai->f),&(ai->f),&temp2); /* -1 skipped in f_a calc ^ */ /* scaled with 0.5 ^ */