From: hackbard Date: Mon, 9 Jun 2003 19:47:33 +0000 (+0000) Subject: added -W, -C X-Git-Tag: fpb~43 X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eedf79d33f24f1163cdadea0eb27c8f0b75c1d92;p=physik%2Fnlsop.git added -W, -C --- diff --git a/TODO b/TODO index a251e3b..e0417fd 100644 --- a/TODO +++ b/TODO @@ -2,14 +2,10 @@ nlsop TODO ---------- IMPORTANT: -- ueberpruefe b_ap=0 verhalten -- ueberpruefe code generell !! - durchdenke/checke diffusion -- p(cryst->amorph)~druckspannung~c(C) in amorphen gebiet - start mit anfangsbedingungen (beschreibung aus file) - dfb optional (cluster mode) -- -C: convert binary savrfile to gnuplot file - opengl visualisierung parameter: diff --git a/nlsop.c b/nlsop.c index c4fc825..81f408d 100644 --- a/nlsop.c +++ b/nlsop.c @@ -2,9 +2,10 @@ * nlsop.c * * this program tries helping to understand the amorphous depuration - * and recrystallization of SiCx while ion implanation. hopefully the program - * will simulate the stabilization of the selforganizing structure in the - * observed behaviour. + * and recrystallization of SiCx while ion implantation at temperatures + * below 400 degree celsius. + * hopefully the program will simulate the stabilization of the + * selforganizing lamella structure in the observed behaviour. * * refs: * - J. K. N. Lindner. Habilationsschrift, Universitaet Augsburg. @@ -36,8 +37,8 @@ int usage(void) printf("-a \t slope of nuclear energy loss (default %f)\n",A_EL); printf("-b \t nuclear energy loss offset (default %f)\n",B_EL); printf("-x \t # x cells (default %d)\n",X); - printf("-y \t # x cells (default %d)\n",Y); - printf("-z \t # x cells (default %d)\n",Z); + printf("-y \t # y cells (default %d)\n",Y); + printf("-z \t # z cells (default %d)\n",Z); /* printf("-X \t display x (default %d)\n",X/2-1); printf("-Y \t display y (default %d)\n",Y/2-1); @@ -54,6 +55,8 @@ int usage(void) printf("-C \t initial c concentration (default %d)\n",CC); */ printf("-D \t diffusion rate from cryst to amorph cells (default %f)\n",D_R); + printf("-W \t write every steps to save file (default %d)\n",RESAVE); + puts("-C \t convert file to gnuplot format"); puts("-L \t load from file"); puts("-S \t save to file"); puts("-R \t read from random file"); @@ -66,6 +69,7 @@ int process_cell(d3_lattice *d3_l,u32 x,u32 y,u32 z,int r,double a,double b,int unsigned char *thiz; int *conc; int i,j; + int off; double p; thiz=d3_l->status+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y; @@ -77,25 +81,19 @@ int process_cell(d3_lattice *d3_l,u32 x,u32 y,u32 z,int r,double a,double b,int { if(!(i==0 && j==0)) { - if(*(d3_l->status+((x+d3_l->max_x+i)%d3_l->max_x)+((y+d3_l->max_y+j)%d3_l->max_x)*d3_l->max_x+z*d3_l->max_x*d3_l->max_y)&AMORPH) p+=a*URAND_MAX/(i*i+j*j); + off=((x+d3_l->max_x+i)%d3_l->max_x)+((y+d3_l->max_y+j)%d3_l->max_x)*d3_l->max_x+z*d3_l->max_x*d3_l->max_y; + if(*(d3_l->status+off)&AMORPH) p+=a*(*(d3_l->extra+off))*URAND_MAX/(i*i+j*j); } } } + // printf("debug: p = %f\n",p); if(!(*thiz&AMORPH)) { - if(get_rand(URAND_MAX)<=p) - { - MAKE_AMORPH(thiz); - // *t_c=*t_c+1-*conc; - } // else *t_c+=1; + if(get_rand(URAND_MAX)<=p) MAKE_AMORPH(thiz); } else { /* assume 1-p probability */ - if(get_rand(URAND_MAX)>p) - { - MAKE_CRYST(thiz); - // *t_c=*t_c+1+*conc; - } // else *t_c+=1; + if(get_rand(URAND_MAX)>p) MAKE_CRYST(thiz); } *t_c+=1; @@ -133,10 +131,15 @@ int distrib_c(d3_lattice *d3_l,double d_r,double a,double b) if(c!=0) { off=((i+d3_l->max_x+c)%d3_l->max_x)+j*d3_l->max_x+k*d3_l->max_x*d3_l->max_y; + carry=0; /* case neighbour not amorph */ if(!(*(d3_l->status+off)&AMORPH)) carry=(int)(d_r*(*(d3_l->extra+off))); /* case neighbour amorph */ + /* + * no diffusion between amorphous cells + * else carry=(*(d3_l->extra+off)-*(d3_l->extra+offset))/2; + */ if(carry!=0) { *(d3_l->extra+offset)+=carry; @@ -149,10 +152,16 @@ int distrib_c(d3_lattice *d3_l,double d_r,double a,double b) if(c!=0) { off=i+((j+c+d3_l->max_y)%d3_l->max_y)*d3_l->max_x+k*d3_l->max_x*d3_l->max_y; + carry=0; /* case neighbour not amorph */ if(!(*(d3_l->status+off)&AMORPH)) carry=(int)(d_r*(*(d3_l->extra+off))); /* case neighbour amorph */ + /* + * + * no diffusion between amorphous cells + * else carry=(*(d3_l->extra+off)-*(d3_l->extra+offset))/2; + */ if(carry!=0) { *(d3_l->extra+offset)+=carry; @@ -169,6 +178,7 @@ int distrib_c(d3_lattice *d3_l,double d_r,double a,double b) if(c!=0) { off=i+((j+c+d3_l->max_y)%d3_l->max_y)*d3_l->max_x+k*d3_l->max_x*d3_l->max_y; + carry=0; /* case neighbour not amorph */ if(!(*(d3_l->status+off)&AMORPH)) { @@ -331,13 +341,42 @@ int load_from_file(char *lf,d3_lattice *d3_l,info *my_inf) return 1; } +int convert_file(char *cf,d3_lattice *d3_l) +{ + int x,y,z; + int c_fd; + + if((c_fd=open(cf,O_WRONLY|O_CREAT))<0) + { + puts("cannot open convert file"); + return -1; + } + dprintf(c_fd,"# created by nlsop (gnuplot format)\n"); + for(x=0;xmax_x;x++) + { + for(y=0;ymax_y;y++) + { + for(z=0;zmax_z;z++) + { + if(*(d3_l->status+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y)&AMORPH) dprintf(c_fd,"%d %d %d\n",x,y,z); + } + } + } + close(c_fd); + + return 1; +} + int main(int argc,char **argv) { u32 max_x,max_y,max_z,x,y,z,x_c,y_c,z_c; int i,quit,escape,nowait; - int refresh; + int refresh,resave; char s_file[MAX_CHARS]; + char s_file_tmp[MAX_CHARS]; char l_file[MAX_CHARS]; + char c_file[MAX_CHARS]; + char convert; char r_file[MAX_CHARS]; char x_txt[MAX_TXT]; char y_txt[MAX_TXT]; @@ -366,6 +405,7 @@ int main(int argc,char **argv) my_info.steps=STEPS; my_info.range=RANGE; refresh=REFRESH; + resave=RESAVE; my_info.a_el=A_EL; my_info.b_el=B_EL; my_info.a_cd=A_CD; @@ -379,6 +419,8 @@ int main(int argc,char **argv) escape=0; strcpy(s_file,""); strcpy(l_file,""); + strcpy(c_file,""); + convert=0; strcpy(r_file,""); for(i=1;i