From: hackbard Date: Tue, 5 Dec 2006 16:44:36 +0000 (+0000) Subject: func2b is now again real func2b ... still -> nan! :/ X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d3e2be6625c7076a7b9243d922195c499e0bf4d;p=physik%2Fposic.git func2b is now again real func2b ... still -> nan! :/ --- diff --git a/moldyn.c b/moldyn.c index 2631d6a..6af2dff 100644 --- a/moldyn.c +++ b/moldyn.c @@ -141,7 +141,7 @@ int set_potential2b(t_moldyn *moldyn,pf_func2b func,void *params) { int set_potential2b_post(t_moldyn *moldyn,pf_func2b_post func,void *params) { - moldyn->func2b=func; + moldyn->func2b_post=func; moldyn->pot2b_params=params; return 0; @@ -784,7 +784,6 @@ int velocity_verlet(t_moldyn *moldyn) { /* forces depending on chosen potential */ potential_force_calc(moldyn); - //moldyn->potential_force_function(moldyn); for(i=0;ifunc3b(moldyn,&(itom[i]),jtom,ktom,bc_ijk); -//printf("Debug: atom %d after 3bp: %08x %08x %08x | %.15f %.15f %.15f\n",i,&itom[i],jtom,ktom,itom[i].r.x,itom[i].f.x,itom[i].v.x); } while(list_next(that)!=\ L_NO_NEXT_ELEMENT); @@ -952,10 +949,13 @@ int potential_force_calc(t_moldyn *moldyn) { } while(list_next(this)!=L_NO_NEXT_ELEMENT); /* 2bp post function */ - if(moldyn->func2b_post) + if(moldyn->func2b_post) { +printf("before 2bp post: %.15f %.15f %.15f\n",itom[i].f.x,itom[i].r.x,itom[i].v.x); moldyn->func2b_post(moldyn, &(itom[i]), jtom,bc_ij); +printf("after 2bp post: %.15f %.15f %.15f\n",itom[i].f.x,itom[i].r.x,itom[i].v.x); + } } } @@ -1186,7 +1186,6 @@ int tersoff_mult_2bp(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) { mu=params->mu_m; params->exchange.chi=params->chi; } - if(d_ij>S) return 0; @@ -1419,15 +1418,12 @@ int tersoff_mult_3bp(t_moldyn *moldyn,t_atom *ai,t_atom *aj,t_atom *ak,u8 bc) { bracket=0.0; bracket_n_1=0.0; bracket_n=0.0; - //printf("Foo -> 0: "); } else { bracket=f_c_ik*g; bracket_n_1=pow(bracket,n-1.0); bracket_n=bracket_n_1*bracket; - //printf("Foo -> 1: "); } -//printf("%.15f %.15f %.15f\n",bracket_n_1,bracket_n,bracket); /* calc of db_ij and the 2 sums */ exchange->sum1_3bp+=bracket_n; diff --git a/moldyn.h b/moldyn.h index 1145f8a..b2f7522 100644 --- a/moldyn.h +++ b/moldyn.h @@ -73,8 +73,7 @@ typedef struct s_moldyn { int (*func1b)(struct s_moldyn *moldyn,t_atom *ai); void *pot1b_params; int (*func2b)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc); - void (*func2b_post)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj, - u8 bc); + int (*func2b_post)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc); void *pot2b_params; int (*func3b)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,t_atom *ak, u8 bck); diff --git a/sic.c b/sic.c index 26bb8c8..d6e85fb 100644 --- a/sic.c +++ b/sic.c @@ -106,7 +106,6 @@ int main(int argc,char **argv) { printf("[sic] creating atoms\n"); create_lattice(&md,DIAMOND,LC_SI,SI,M_SI, ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB, - //ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP, //ATOM_ATTR_2BP|ATOM_ATTR_HB, 0,5,5,5);