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 <value> \t slope of nuclear energy loss (default %f)\n",A_EL);
- printf("-b <value> \t nuclear energy loss offset (default %f)\n",B_EL);
printf("-x <value> \t # x cells (default %d)\n",X);
printf("-y <value> \t # y cells (default %d)\n",Y);
printf("-z <value> \t # z cells (default %d)\n",Z);
printf("-f <value> \t pressure = <value> * 1/distance^2 (default %f)\n",A_AP);
printf("-p <value> \t pressure offset (default %f)\n",B_AP);
printf("-F <value> \t proportionality constant between c conc and ability to get amorphous (default %f)\n",A_CP);
- printf("-A <value> \t slope of linear c distribution (default %f)\n",A_CD);
- printf("-B <value> \t linear c distribution offset (default %f)\n",B_CD);
printf("-D <value> \t diffusion rate from cryst to amorph cells (default %f)\n",DR_AC);
printf("-c <value> \t diffusion rate in cryst cells (default %f)\n",DR_CC);
printf("-e <value> \t do diffusion every <value> steps (default %d)\n",DIFF_RATE);
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;
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++)
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;
}
}
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];
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;
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;
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;
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;
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);
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;
{
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