From: hackbard Date: Tue, 13 May 2003 17:03:28 +0000 (+0000) Subject: first (not yet ready) main code X-Git-Tag: fpb~61 X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f26989bb9e70a48d947ada3af4b3defce65ed27;p=physik%2Fnlsop.git first (not yet ready) main code --- diff --git a/nlsop.c b/nlsop.c new file mode 100644 index 0000000..761be35 --- /dev/null +++ b/nlsop.c @@ -0,0 +1,110 @@ +/* + * nlsop.c + * + * this program tries helping to understand the amorphous depuration + * and recrystallization of SiCx while ion implanation. hopefully the program + * will simulate the stabilization of the selforganizing structure in the + * observed behaviour. + * + * refs: + * - J. K. N. Lindner. Habilationsschrift, Universitaet Augsburg. + * - Maik Haeberlen. Diplomarbeit, Universitaet Augsburg. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include + +#include "nlsop.h" + +#include "dfbapi.h" +#include "random.h" + +#define MAKE_AMORPH(N) *(N)|=AMORPH +#define MAKE_CRYST(N) *(N)&=~AMORPH + +int usage(void) +{ + puts("usage:"); + puts("-h \t\t help"); + puts("-n \t\t no user interaction"); + printf("-a \t slope of nuclear energy loss (default %d)\n",A_EL); + printf("-b \t nuclear energy loss offset (default %d)\n",B_EL); + printf("-x \t # x cells (default %d)\n",X); + printf("-y \t # x cells (default %d)\n",Y); + printf("-z \t # x cells (default %d)\n",Z); + printf("-X \t display x (default %d)\n",X/2-1); + printf("-Y \t display y (default %d)\n",Y/2-1); + printf("-Z \t display z (default %d)\n",Z/2-1); + printf("-s \t steps (default %d)\n",STEPS); + printf("-d \t refresh display (default %d)\n",REFRESH); + printf("-r \t amorphous influence range (default %d)\n",RANGE); + printf("-f \t pressure = * 1/distance^2 (default %f)\n",A_AP); + printf("-p \t pressure offset (default %f)\n",B_AP); + printf("-A \t slope of linear c distribution (default %f)\n",A_CD); + printf("-B \t linear c distribution offset (default %f)\n",B_CD); + printf("-C \t initial c concentration (default %d)\n",CC); + puts("-L \t load from file"); + puts("-S \t save to file"); + puts("-R \t read from random file"); + + return 1; +} + +int process_cell(3d_lattice *3d_l,u32 x,u32 y,u32 z,int r,double a,double b,int *t_c) +{ + unsigned char *thiz; + int *conc; + int i,j; + double p; + + thiz=3d_l->status+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y; + conc=3d_l->extra+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y; + p=b*URAND_MAX; + for(i=-r;i<=r;i++) + { + for(j=-r;j<=r;j++) + { + if(!(i==0 && j==0)) + { + if(*(d3_l->status+((x+d3_l->max_x+i)%d3_l->max_x)+((y+d3_l->max_y+j)%d3_l->max_x)*d3_l->max_x+z*d3_l->max_x*d3_l->max_y)&AMORPH) p+=a*URAND_MAX/(i*i+j*j); + } + } + } + p*=*conc; + if(!(*thiz&AMORPH)) + { + if(rand_get(URAND_MAX)<=p) + { + MAKE_AMORPH(thiz); + *t_c=*t_c+1-*conc; + } else *t_c+=1; + } else + { + /* assume 1-p probability */ + if(rand_get(URAND_MAX)>p) + { + MAKE_CRYST(thiz); + *t_c=*t_c+1+*conc; + } else *t_c+=1; + } + + return 1; +} + +int distrib_c(3d_lattice *3d_l,int t_c,double a,double b) +{ + int i,j,total,area; + + for(i=0;imax_z;i++) + { + + } + + return 1; +} diff --git a/nlsop.h b/nlsop.h new file mode 100644 index 0000000..79a887a --- /dev/null +++ b/nlsop.h @@ -0,0 +1,30 @@ +/* + * nlsop headers + * + * author: hackbard@hackdaworld.dyndns.org + * + */ + +typedef unsigned int u32; + +#define AMORPH 1 + +#define A_EL 1 +#define B_EL 0 + +#define X 50 +#define Y 50 +#define Z 100 + +#define STEPS 100000 +#define RANGE 3 +#define REFRESH 20 + +#define A_CD 1 +#define B_CD 0 + +#define CC 0 + +#define A_AP .1 +#define B_AP .2 +