From: hackbard Date: Mon, 14 Apr 2003 12:41:28 +0000 (+0000) Subject: z relaxation, fixed bug in random.c X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=8ce4b66631e6403dc019511c73a8ef24e6a6225d;p=physik%2Fmorpheus.git z relaxation, fixed bug in random.c --- diff --git a/main.c b/main.c index 2ac8d6a..d171490 100644 --- a/main.c +++ b/main.c @@ -134,14 +134,15 @@ int process_cell(cell *cell_p,u32 x,u32 y,u32 z,u32 x_max,u32 y_max,u32 z_max,in { for(j=-range;j<=range;j++) { - for(k=-range;k<=range;k++) - { - if(!(i==0 && j==0 && k==0)) + // z relaxation, no pressure in z direction + // for(k=-range;k<=range;k++) + // { + if(!(i==0 && j==0)) // && k==0)) { - // if((cell_p+((x+x_max+i)%x_max)+((y+j+y_max)%y_max)*x_max+((z+k+z_max)%z_max)*x_max*y_max)->status&AMORPH) pressure+=(cell_p+((x+x_max+i)%x_max)+((y+j+y_max)%y_max)*x_max+((z+k+z_max)%z_max)*x_max*y_max)->conc*faktor*URAND_2BYTE_MAX/(i*i+j*j+k*k); - if((cell_p+((x+x_max+i)%x_max)+((y+j+y_max)%y_max)*x_max+((z+k+z_max)%z_max)*x_max*y_max)->status&AMORPH) pressure+=faktor*URAND_2BYTE_MAX/(i*i+j*j+k*k); + // if((cell_p+((x+x_max+i)%x_max)+((y+j+y_max)%y_max)*x_max+((z+k+z_max)%z_max)*x_max*y_max)->status&AMORPH) pressure+=faktor*URAND_2BYTE_MAX/(i*i+j*j+k*k); + if((cell_p+((x+x_max+i)%x_max)+((y+j+y_max)%y_max)*x_max+z*x_max*y_max)->status&AMORPH) pressure+=faktor*URAND_2BYTE_MAX/(i*i+j*j); } - } + // } } } pressure*=this_cell->conc; diff --git a/random.c b/random.c index f9a88f5..81a0667 100644 --- a/random.c +++ b/random.c @@ -26,7 +26,7 @@ u32 rand_get(u32 max) printfd("debug: reading new random bytes\n"); if(read(random_fd,rand_buf,RAND_BUF_SIZE)!=RAND_BUF_SIZE) { - if(!strcmp(random_file,"")) + if(strcmp(random_file,"")) { puts("random file end, starting over ..."); lseek(random_fd,0,SEEK_SET);