From: hackbard Date: Wed, 28 Jul 2004 15:35:08 +0000 (+0000) Subject: removed linear pprox of c distr and nel profile X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=1ef7284c9e6ba47a6e4a907bff427f741b951d9f;p=physik%2Fnlsop.git removed linear pprox of c distr and nel profile --- diff --git a/nlsop.c b/nlsop.c index 0cdecc4..7603876 100644 --- a/nlsop.c +++ b/nlsop.c @@ -55,8 +55,6 @@ int usage(void) puts("-n \t\t no user interaction"); puts("-Z \t\t cryst -> amorph c diffusion in z direction"); puts("-i \t\t no cryst to cryst diffusion"); - 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 # y cells (default %d)\n",Y); printf("-z \t # z cells (default %d)\n",Z); @@ -66,8 +64,6 @@ int usage(void) printf("-f \t pressure = * 1/distance^2 (default %f)\n",A_AP); printf("-p \t pressure offset (default %f)\n",B_AP); printf("-F \t proportionality constant between c conc and ability to get amorphous (default %f)\n",A_CP); - printf("-A \t slope of linear c distribution (default %f)\n",A_CD); - printf("-B \t linear c distribution offset (default %f)\n",B_CD); printf("-D \t diffusion rate from cryst to amorph cells (default %f)\n",DR_AC); printf("-c \t diffusion rate in cryst cells (default %f)\n",DR_CC); printf("-e \t do diffusion every steps (default %d)\n",DIFF_RATE); @@ -85,7 +81,7 @@ int usage(void) return 1; } -int process_cell(d3_lattice *d3_l,u32 x,u32 y,u32 z,info *my_info) +int process_cell(d3_lattice *d3_l,u32 x,u32 y,u32 z,info *my_info,u32 nel_z) { unsigned char *thiz; int *conc; @@ -95,7 +91,7 @@ int process_cell(d3_lattice *d3_l,u32 x,u32 y,u32 z,info *my_info) thiz=d3_l->status+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y; conc=d3_l->extra+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y; - p=my_info->b_ap*URAND_MAX; + p=my_info->b_ap*URAND_MAX*nel_z; for(i=-(my_info->range);i<=my_info->range;i++) { for(j=-(my_info->range);j<=my_info->range;j++) @@ -768,7 +764,7 @@ int get_c_ratio(double *c_ratio,char *pfile,info *my_info,d3_lattice *d3_l) a=atof(p)/10; /* nm */ p=strtok(NULL," "); b=atof(p); - if(a>my_info->b_cd*CELL_LENGTH && a<(my_info->b_cd+d3_l->max_z)*CELL_LENGTH) d+=b; + if(a<=d3_l->max_z*CELL_LENGTH) d+=b; all+=b; } } @@ -868,8 +864,6 @@ int main(int argc,char **argv) char a_txt[MAX_TXT]; char s_txt[MAX_TXT]; char ap_txt[MAX_TXT]; - char el_txt[MAX_TXT]; - char cd_txt[MAX_TXT]; char r_txt[MAX_TXT]; char cp_txt[MAX_TXT]; char zdiff_txt[MAX_TXT]; @@ -892,6 +886,7 @@ int main(int argc,char **argv) u32 *c_profile; u32 *n_e_loss; u32 ne_max,ip_max; + u32 nel_z; d3_l.max_x=X; d3_l.max_y=Y; @@ -902,10 +897,6 @@ int main(int argc,char **argv) resave=RESAVE; my_info.z_diff=0; my_info.c_diff=1; - my_info.a_el=A_EL; - my_info.b_el=B_EL; - my_info.a_cd=A_CD; - my_info.b_cd=B_CD; my_info.a_ap=A_AP; my_info.b_ap=B_AP; my_info.a_cp=A_CP; @@ -943,12 +934,6 @@ int main(int argc,char **argv) case 'n': nowait=1; break; - case 'a': - my_info.a_el=atof(argv[++i]); - break; - case 'b': - my_info.b_el=atof(argv[++i]); - break; case 'x': d3_l.max_x=atoi(argv[++i]); break; @@ -983,12 +968,6 @@ int main(int argc,char **argv) case 'F': my_info.a_cp=atof(argv[++i]); break; - case 'A': - my_info.a_cd=atof(argv[++i]); - break; - case 'B': - my_info.b_cd=atof(argv[++i]); - break; case 'W': resave=atoi(argv[++i]); break; @@ -1097,8 +1076,6 @@ int main(int argc,char **argv) sprintf(dose_txt,"dose: %.2fe+17 C/cm²",my_info.steps*1.0/(d3_l.max_x*d3_l.max_y*CELL_LENGTH*CELL_LENGTH*1000)); sprintf(r_txt,"pressure range: %d",my_info.range); sprintf(ap_txt,"a_ap: %f b_ap: %f",my_info.a_ap,my_info.b_ap); - sprintf(el_txt,"a_el: %f b_el: %f",my_info.a_el,my_info.b_el); - sprintf(cd_txt,"a_cd: %f b_cd: %f",my_info.a_cd,my_info.b_cd); sprintf(cp_txt,"a_cp: %f",my_info.a_cp); sprintf(dr_ac_txt,"a/c diffusion rate: %f",my_info.dr_ac); if(my_info.c_diff!=0) sprintf(dr_cc_txt,"c/c diffusion rate: %f",my_info.dr_cc); @@ -1123,13 +1100,13 @@ int main(int argc,char **argv) arg_v[13]=zdiff_txt; arg_v[14]=r_txt; arg_v[15]=ap_txt; - arg_v[16]=el_txt; - arg_v[17]=cd_txt; - arg_v[18]=cp_txt; - arg_v[19]=dr_ac_txt; - arg_v[20]=dr_cc_txt; - arg_v[21]=hpi_txt; - arg_v[22]=csat_txt; + arg_v[16]=cp_txt; + arg_v[17]=dr_ac_txt; + arg_v[18]=dr_cc_txt; + arg_v[19]=hpi_txt; + arg_v[20]=csat_txt; + arg_v[21]=NULL; + arg_v[22]=NULL; arg_v[23]=NULL; arg_v[24]=NULL; arg_v[25]=NULL; @@ -1179,8 +1156,10 @@ 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_reject(d3_l.max_z,ne_max,n_e_loss); - process_cell(&d3_l,x_c,y_c,z_c,&my_info); + // z_c=get_rand_reject(d3_l.max_z,ne_max,n_e_loss); + z_c=get_rand(d3_l.max_z); + nel_z=(URAND_MAX*n_e_loss[z_c])/ne_max; + process_cell(&d3_l,x_c,y_c,z_c,&my_info,nel_z); } distrib_c(&d3_l,&my_info,i,c_ratio,ip_max,c_profile); #ifdef USE_DFB_API diff --git a/nlsop.h b/nlsop.h index b309cc4..3231cb7 100644 --- a/nlsop.h +++ b/nlsop.h @@ -13,15 +13,12 @@ typedef unsigned int u32; typedef struct __info { int cc,steps,range,diff_rate,cpi,c_sat; - double a_el,b_el,a_cd,b_cd,a_ap,b_ap,a_cp,dr_ac,dr_cc; + double a_ap,b_ap,a_cp,dr_ac,dr_cc; char z_diff,c_diff; } info; #define AMORPH 1 -#define A_EL 1. -#define B_EL .0 - #define X 64 #define Y 64 #define Z 233 @@ -31,9 +28,6 @@ typedef struct __info #define REFRESH 100000 #define RESAVE 10000000 -#define A_CD 1. -#define B_CD .0 - #define CC 0 #define DR_AC .5