puts("usage:");
puts("-h \t\t help");
puts("-n \t\t no user interaction");
+ puts("-Z \t\t cryst -> amorph c diffusion in z direction");
printf("-a <value> \t slope of nuclear energy loss (default %f)\n",A_EL);
printf("-b <value> \t nuclear energy loss offset (default %f)\n",B_EL);
printf("-x <value> \t # x cells (default %d)\n",X);
return 1;
}
-int distrib_c(d3_lattice *d3_l,double d_r,double a,double b)
+int distrib_c(d3_lattice *d3_l,double d_r,double a,double b,char z_diff)
{
u32 x,y,z;
int i,j,k,c;
}
}
}
+ for(c=-1;c<=1;c++)
+ {
+ if(c!=0)
+ {
+ off=((i+c+d3_l->max_x)%d3_l->max_x)+j*d3_l->max_x+k*d3_l->max_x*d3_l->max_y;
+ carry=0;
+ /* case neighbour not amorph */
+ if(!(*(d3_l->status+off)&AMORPH))
+ {
+ carry=(*(d3_l->extra+off)-*(d3_l->extra+offset))/2;
+ if(carry!=0)
+ {
+ *(d3_l->extra+offset)+=carry;
+ *(d3_l->extra+off)-=carry;
+ }
+ }
+ }
+ }
+ /* cryst -> amorph diffusion in z direction */
+ if(z_diff)
+ {
+ for(c=1;c>=-1;c--)
+ {
+ off=i+j*d3_l->max_x+((k+c+d3_l->max_z)%d3_l->max_z)*d3_l->max_x*d3_l->max_y;
+ carry=0;
+ if(*(d3_l->status+off)&AMORPH) carry=(int)(d_r*(*(d3_l->extra+off)));
+ if(carry!=0)
+ {
+ *(d3_l->extra+offset)+=carry;
+ *(d3_l->extra+off)-=carry;
+ }
+ }
+ } /* if z_diff */
}
} /* for z */
} /* for y */
u32 x,y,z,x_c,y_c,z_c;
int i,quit,escape,nowait;
int refresh,resave;
+ char z_diff;
char s_file[MAX_CHARS];
char s_file_tmp[MAX_CHARS];
char l_file[MAX_CHARS];
my_info.range=RANGE;
refresh=REFRESH;
resave=RESAVE;
+ z_diff=0;
my_info.a_el=A_EL;
my_info.b_el=B_EL;
my_info.a_cd=A_CD;
case 'Y':
y=atoi(argv[++i]);
break;
+ */
case 'Z':
- z=atoi(argv[++i]);
+ z_diff=1;
break;
- */
+ /* */
case 's':
my_info.steps=atoi(argv[++i]);
break;
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);
- distrib_c(&d3_l,my_info.d_r,my_info.a_cd,my_info.b_cd);
+ distrib_c(&d3_l,my_info.d_r,my_info.a_cd,my_info.b_cd,z_diff);
process_cell(&d3_l,x_c,y_c,z_c,my_info.range,my_info.a_ap,my_info.b_ap,&(my_info.cc));
#ifdef USE_DFB_API
if(i%refresh==0)