-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(cell *cell)
+{
+ cell->status|=AMORPH;
+ return 23;
+}
+
+int make_cryst(cell *cell)
+{
+ cell->status&=~AMORPH;
+ return 23;
+}
+
+int distrib_c_conc(cell *cell_p,u32 c_c0,u32 c_slope,int add_c,u32 x_max,u32 y_max,u32 z_max)
+{
+ /* cryst. c to distribute */
+ int i,j,k;
+ double cryst_c;
+ cryst_c=0;
+ for(i=0;i<x_max*y_max*z_max;i++) if(!(cell_p+i)->status&AMORPH) cryst_c+=(cell_p+i)->conc;
+ for(i=0;i<z_max;i++)
+ {
+ for(j=0;j<x_max*y_max;j++)
+ {
+ if(!(cell_p+j+i*x_max*y_max)->status&AMORPH)
+
+ return 23;
+}
+
+/* look at cell ... */
+int process_cell(cell *cell_p,u32 x,u32 y,u32 z,u32 x_max,u32 y_max,u32 z_max,int range,double faktor,double p0)
+{
+ cell *this_cell;
+ int i,j,k;
+ double pressure;
+ this_cell=cell_p+x+y*x_max+z*x_max*y_max;
+ pressure=p0*URAND_2BYTE_MAX;
+ 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((cell_p+((x+x_max+i)%x_max)+((y+j+y_max)%y_max)*x_max+((z+k+z_max)%z_max)*x_max*y_max)->status&AMORPH) pressure+=faktor*URAND_2BYTE_MAX/(i*i+j*j+k*k);
+ }
+ }
+ }
+ }
+ if(this_cell->status&AMORPH)
+ {
+ /* wrong probability! just test by now ...*/
+ if(rand_get(URAND_2BYTE_MAX)>pressure) make_cryst(this_cell);
+ } else
+ {
+ if(rand_get(URAND_2BYTE_MAX)<=pressure) make_amorph(this_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,gr; /* for counting */
+ int slope_nel,start_nel; /* nuclear energy loss: slope, constant */
+ int a_p_range; /* p. range of amorphous sic */
+ double a_p_faktor,a_p_p0; /* p0 and faktor of amorphous sic */
+ u32 c_c0,c_slope; /* c start concentration and linear slope of c distribution */
+ int steps; /* # steps */
+ cell *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 */
+ int quit=0; /* continue/quit status */
+
+ printfd("debug: sizeof my u32 variable: %d\n",sizeof(u32));
+ printfd("debug: sizeof my cell struct: %d\n",sizeof(cell));