From: hackbard Date: Fri, 18 Jul 2003 16:42:43 +0000 (+0000) Subject: - X-Git-Tag: fpb~24 X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad99308cf521a5906e05045b96715f4dc8d91ea7;p=physik%2Fnlsop.git - --- diff --git a/nlsop.c b/nlsop.c index c7d56e4..47f6869 100644 --- a/nlsop.c +++ b/nlsop.c @@ -84,6 +84,7 @@ int process_cell(d3_lattice *d3_l,u32 x,u32 y,u32 z,info *my_info) } } p+=*conc*my_info->a_cp*URAND_MAX; + printf("debug: %f - %u\n",p,URAND_MAX); if(!(*thiz&AMORPH)) { if(get_rand(URAND_MAX)<=p) MAKE_AMORPH(thiz); @@ -98,7 +99,7 @@ int process_cell(d3_lattice *d3_l,u32 x,u32 y,u32 z,info *my_info) return 1; } -int distrib_c(d3_lattice *d3_l,info *my_info) +int distrib_c(d3_lattice *d3_l,info *my_info,int step) { u32 x,y,z; int i,j,k,c; @@ -111,6 +112,9 @@ int distrib_c(d3_lattice *d3_l,info *my_info) z=get_rand_lgp(d3_l->max_z,my_info->a_cd,my_info->b_cd); *(d3_l->extra+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y)+=1; + if(step%my_info->diff_rate==0) + { + for(i=0;imax_x;i++) { for(j=0;jmax_y;j++) @@ -208,6 +212,8 @@ int distrib_c(d3_lattice *d3_l,info *my_info) } /* for y */ } /* for x */ + } /* if step modulo diff_rate == 0 */ + return 1; } @@ -606,7 +612,7 @@ int main(int argc,char **argv) x_c=get_rand(d3_l.max_x); y_c=get_rand(d3_l.max_y); z_c=get_rand_lgp(d3_l.max_z,my_info.a_el,my_info.b_el); - if(i%my_info.diff_rate==0) distrib_c(&d3_l,&my_info); + distrib_c(&d3_l,&my_info); process_cell(&d3_l,x_c,y_c,z_c,&my_info); #ifdef USE_DFB_API if(i%refresh==0)