-int main(int argc,char **argv) {
- int x_seg,y_seg,z_seg; /* amount of segments */
- int x,y,z; /* segments */
- int i; /* for counting */
- int slope_cc,start_cc; /* C concentration: slope, c(0) */
+int make_amorph(u32 *cell)
+{
+ *cell|=AMORPH;
+ return 23;
+}
+
+int make_cryst(u32 *cell)
+{
+ *cell&=~AMORPH;
+ return 23;
+}
+
+/* look at cell ... */
+int process_cell(void *cell_p,u32 x,u32 y,u32 z,u32 x_max,u32 y_max,u32 z_max,int range,int faktor,int p0)
+{
+ u32 *cell;
+ int i,j,k,count;
+ // float count;
+ cell=(u32 *)(cell_p+x+y*(x_max-1)+z*(x_max-1)*(y_max-1));
+ count=p0;
+ for(i=-range;i<=range;i++)
+ {
+ for(j=-range;j<=range;j++)
+ {
+ for(k=-range;k<=range;k++)
+ {
+ if(!(i==0 && j==0 && k==0))
+ {
+ if(*(u32 *)(cell_p+((x+x_max+i)%x_max)+((y+j+y_max)%y_max)*(x_max-1)+((z+k+z_max)%z_max)*(x_max-1)*(y_max-1))&AMORPH) count+=(3*range*range-i*i-j*j-k*k);
+ }
+ }
+ }
+ }
+ // count+=faktor*1.0/(i*i+j*j+k*k);
+ if(*cell&AMORPH)
+ {
+ /* wrong propability! just test by now ...*/
+ if(rand_get(sum_range_rate)>count) make_cryst(cell);
+ } else
+ {
+ if(rand_get(sum_range_rate)<=count) make_amorph(cell);
+ }
+ return 23;
+}
+
+int main(int argc,char **argv)
+{
+ u32 x_cell,y_cell,z_cell; /* amount of segments */
+ u32 x,y,z; /* cells */
+ int i,j,k; /* for counting */
+ int slope_nel,start_nel; /* nuclear energy loss: slope, constant */
+ int a_p_range,a_p_faktor,a_p_p0; /* p. range, p0 and faktor of amorphous sic */
+ int steps; /* # steps */
+ void *cell_p;
+ struct __display display;
+ u32 display_x,display_y,display_z; /* intercept point of diplayed areas */
+ u32 display_refresh_rate; /* refresh rate for display */