puts("-S <file> \t save to file");
puts("-R <file> \t read from random file");
puts("-P <file> \t specify implantation profile file");
+ puts("-N <file> \t specify nuclear energy loss profile file");
printf("-H <value> \t collisions per ion in simulation window (default %d)\n",CPI);
return 1;
int write_ac_distr(d3_lattice *d3_l,int ac_distr)
{
int fd,x,y,z;
- int count=0,offset;
+ int count,offset;
char file[16];
if(ac_distr==1) strcpy(file,"a.plot");
for(z=0;z<d3_l->max_z;z++)
{
+ count=0;
for(x=0;x<d3_l->max_x;x++)
{
for(y=0;y<d3_l->max_y;y++)
char l_file[MAX_CHARS];
char c_file[MAX_CHARS];
char p_file[MAX_CHARS];
+ char n_e_file[MAX_CHARS];
char convert;
char r_file[MAX_CHARS];
#ifdef USE_DFB_API
strcpy(l_file,"");
strcpy(c_file,"");
strcpy(p_file,IMP_PROFILE);
+ strcpy(n_e_file,NEL_PROFILE);
convert=0;
strcpy(r_file,"");
mode=0;
case 'P':
strcpy(p_file,argv[++i]);
break;
+ case 'N':
+ strcpy(n_e_file,argv[++i]);
+ break;
case 'g':
strcpy(l_file,argv[++i]);
if(i<argc-1) if(argv[i+1][0]!='-') c_step=atoi(argv[++i]);
sprintf(s_txt,"steps: %d",my_info.steps);
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: %.4f b_ap: %.3f",my_info.a_ap,my_info.b_ap);
- sprintf(el_txt,"a_el: %.3f b_el: %.3f",my_info.a_el,my_info.b_el);
- sprintf(cd_txt,"a_cd: %.3f b_cd: %.3f",my_info.a_cd,my_info.b_cd);
- sprintf(cp_txt,"a_cp: %.5f",my_info.a_cp);
- sprintf(dr_ac_txt,"a/c diffusion rate: %.4f",my_info.dr_ac);
- if(my_info.c_diff!=0) sprintf(dr_cc_txt,"c/c diffusion rate: %.4f",my_info.dr_cc);
+ 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);
else sprintf(dr_cc_txt,"c/c diffusion rate: none");
sprintf(zdiff_txt,"diffusion in z direction: %c",my_info.z_diff?'y':'n');
sprintf(diff_txt,"diffusion every %d steps",my_info.diff_rate);
return -1;
}
ip_max=get_reject_graph(&my_info,&d3_l,p_file,c_profile);
+ ne_max=get_reject_graph(&my_info,&d3_l,n_e_file,n_e_loss);
#ifdef DEBUG_RAND
while(1)
{
+#ifdef DEBUG_CP
printf("%d\n",get_rand_reject(d3_l.max_z,ip_max,c_profile));
+#endif
+#ifdef DEBUG_NEL
+ printf("%d\n",get_rand_reject(d3_l.max_z,ne_max,n_e_loss));
+#endif
}
#endif
{
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);
- // printf("%d\n",z_c);
+ // z_c=get_rand_lgp(d3_l.max_z,my_info.a_el,my_info.b_el);
+ 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);
}
distrib_c(&d3_l,&my_info,i,c_ratio,ip_max,c_profile);