{
x=get_rand(d3_l->max_x);
y=get_rand(d3_l->max_y);
+ // printf("nd: %d %d\n",x,y);
z=get_rand_lgp(d3_l->max_z,my_info->a_cd,my_info->b_cd);
+ // printf("ld: %d\n",z);
*(d3_l->extra+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y)+=1;
(my_info->cc)++;
}
return 1;
}
+int get_reject_graph(info *my_info,d3_lattice *d3_l,char *file,u32 *graph) {
+ double a,b;
+ int i,j,k;
+ int fd;
+ char buf[32],*p;
+
+ if((fd=open(file,O_RDONLY))<0)
+ {
+ puts("cannot open file to calculate rejection graph");
+ return -1;
+ }
+ memset(graph,0,d3_l->max_z*sizeof(u32));
+ /* get fixpoints */
+ k=1;
+ while(k)
+ {
+ for(i=0;i<32;i++)
+ {
+ k=read(fd,&buf[i],1);
+ if((buf[i]=='\n')||(k==0)) break;
+ }
+ if(k)
+ {
+ p=strtok(buf," ");
+ a=atof(p)/10; /* nm */
+ p=strtok(NULL," ");
+ b=atof(p);
+ if(a>d3_l->max_z*CELL_LENGTH) k=0;
+ else graph[(int)(a/CELL_LENGTH)]=(int)(URAND_MAX*b);
+ }
+ }
+ /* do interpolation here! */
+
+ return 1;
+}
+
int main(int argc,char **argv)
{
u32 x,y,z,x_c,y_c,z_c;
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: %.3f b_ap: %.3f",my_info.a_ap,my_info.b_ap);
+ 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: %.4f",my_info.a_cp);
+ 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);
else sprintf(dr_cc_txt,"c/c diffusion rate: none");