4 * this program tries helping to understand the amorphous depuration
5 * and recrystallization of SiCx while ion implanation. hopefully the program
6 * will simulate the stabilization of the selforganizing structure in the
10 * - J. K. N. Lindner. Habilationsschrift, Universitaet Augsburg.
11 * - Maik Haeberlen. Diplomarbeit, Universitaet Augsburg.
16 #include <sys/types.h>
22 /* global variables */
24 int random_fd; /* /dev/urandom file descriptor */
30 puts("-a <value> \t slope of nuclear energy loss (default 1)");
31 puts("-c <value> \t nuclear enery loss at depths 0 (default 0)");
32 puts("-x <value> \t # x cells (default 50)");
33 puts("-y <value> \t # y cells (default 50)");
34 puts("-z <value> \t # z cells (default 100)");
35 puts("-s <value> \t # steps to calculate (default 5000)");
36 puts("-X <value> \t display area intercept point x (default 25)");
37 puts("-Y <value> \t display area intercept point y (default 25)");
38 puts("-Z <value> \t display area intercept point z (default 50)");
39 puts("-d <value> \t refresh every <value> loops (default 100)");
43 int make_amorph(u32 *cell)
49 int make_cryst(u32 *cell)
51 *cell=*cell&(~AMORPH);
55 /* look at cell ... */
56 int process_cell(u32 *cell)
58 /* tag it ... testing! */
64 int main(int argc,char **argv)
66 u32 x_cell,y_cell,z_cell; /* amount of segments */
67 u32 x,y,z; /* cells */
68 int i; /* for counting */
69 int slope_nel,start_nel; /* nuclear energy loss: slope, constant */
70 int steps; /* # steps */
72 struct __display display;
73 u32 display_x,display_y,display_z; /* intercept point of diplayed areas */
74 u32 display_refresh_rate; /* refresh rate for display */
80 slope_nel=DEFAULT_SLOPE_NEL;
81 start_nel=DEFAULT_START_NEL;
83 display_x=DEFAULT_DISPLAY_X-1;
84 display_y=DEFAULT_DISPLAY_Y-1;
85 display_z=DEFAULT_DISPLAY_Z-1;
86 display_refresh_rate=DEFAULT_DISPLAY_REF_RATE;
88 /* parse command args */
100 slope_nel=atoi(argv[++i]);
103 start_nel=atoi(argv[++i]);
106 x_cell=atoi(argv[++i]);
109 y_cell=atoi(argv[++i]);
112 z_cell=atoi(argv[++i]);
115 steps=atoi(argv[++i]);
118 display_x=atoi(argv[++i]);
121 display_y=atoi(argv[++i]);
124 display_z=atoi(argv[++i]);
127 display_refresh_rate=atoi(argv[++i]);
137 if((random_fd=open("/dev/urandom",O_RDONLY))<0)
139 puts("cannot open /dev/urandom\n");
143 /* calculate sum_z_cells one time! */
145 for(i=1;i<=z_cell;i++) sum_z_cells+=(start_nel+i*slope_nel);
146 printfd("debug: sum z cells -> %d\n",sum_z_cells);
152 if((cell_p=malloc(x_cell*y_cell*z_cell*sizeof(u32)))==NULL)
154 puts("failed allocating memory for cells\n");
157 memset(cell_p,0,x_cell*y_cell*z_cell*sizeof(u32));
160 display_init(x_cell,y_cell,z_cell,&display,cell_p,&argc,argv);
167 z=rand_get_lgp(slope_nel,start_nel);
170 // distrib_c_conc(cell_p);
171 process_cell((u32 *)(cell_p+x+y*(x_cell-1)+z*(x_cell-1)*(y_cell-1)));
174 if((i%display_refresh_rate)==0)
176 puts("refreshing display ...");
177 // display_draw(&display,display_x,display_y,display_z);
182 /* display again and quit when button hit */
183 display_draw(&display,display_x,display_y,display_z);
184 puts("hit button to quit ...");