X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=potentials%2Ftersoff_orig.c;h=431cfebf5d6343ca597360b481b82200fbf67ac2;hb=acdd9a6aa72f3692ccd03cc0df20e3d60555f555;hp=69b67ace63e630a7a0b6fe623aae269e57094f17;hpb=57847266c05bc38218bf162efdb08e8dd40894d7;p=physik%2Fposic.git diff --git a/potentials/tersoff_orig.c b/potentials/tersoff_orig.c index 69b67ac..431cfeb 100644 --- a/potentials/tersoff_orig.c +++ b/potentials/tersoff_orig.c @@ -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 ^ */