From: hackbard Date: Mon, 10 Sep 2007 14:00:26 +0000 (+0200) Subject: added some definitions to make the testing app sic more comfortable X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=a35a47e5a070e5615313e2b612996cd572bccae9;p=physik%2Fposic.git added some definitions to make the testing app sic more comfortable --- diff --git a/sic.c b/sic.c index be75aad..749600f 100644 --- a/sic.c +++ b/sic.c @@ -21,13 +21,27 @@ #include "potentials/tersoff.h" #endif -#define INJECT 1 -#define NR_ATOMS 1 -#define R_C 1.0 +#define INJECT 800 +#define NR_ATOMS 10 +#define R_C 1.5 #define T_C 10.0 -#define LCNT 5 -#define PRERUN 500 -#define POSTRUN 1000 +#define INJ_LENX (10*ALBE_LC_SIC) +#define INJ_LENY (10*ALBE_LC_SIC) +#define INJ_LENZ (10*ALBE_LC_SIC) +#define INJ_OFFSET (ALBE_LC_SI/8.0) + +#define LCNTX 50 +#define LCNTY 50 +#define LCNTZ 50 +#define PRERUN 1000 +#define POSTRUN 10000 + +#define R_TITLE "Insertion of 8000 carbon atoms in silicon" +#define LOG_E 10 +#define LOG_T 10 +#define LOG_P 10 +#define LOG_S 100 +#define LOG_V 100 typedef struct s_hp { int a_count; /* atom count */ @@ -76,17 +90,12 @@ int hook(void *moldyn,void *hook_params) { for(j=0;jrandom))-0.5)*md->dim.x*0.37; - r.y=(rand_get_double(&(md->random))-0.5)*md->dim.y*0.37; - r.z=(rand_get_double(&(md->random))-0.5)*md->dim.z*0.37; - r.x=(1.0*atoi(hp->argv[3])-4.5)/9.0*ALBE_LC_SI; - r.y=(1.0*atoi(hp->argv[4])-4.5)/9.0*ALBE_LC_SI; - r.z=(1.0*atoi(hp->argv[5])-4.5)/9.0*ALBE_LC_SI; - */ - r.x=(rand_get_double(&(md->random))-0.5)*LC_SI; - r.y=(rand_get_double(&(md->random))-0.5)*LC_SI; - r.z=(rand_get_double(&(md->random))-0.5)*LC_SI; + r.x=(rand_get_double(&(md->random))-0.5)*INJ_LENX; + r.x+=INJ_OFFSET; + r.y=(rand_get_double(&(md->random))-0.5)*INJ_LENY; + r.y+=INJ_OFFSET; + r.z=(rand_get_double(&(md->random))-0.5)*INJ_LENZ; + r.z+=INJ_OFFSET; /* assume valid coordinates */ run=0; for(i=0;icount;i++) { @@ -101,7 +110,8 @@ int hook(void *moldyn,void *hook_params) { } } v.x=0; v.y=0; v.z=0; - add_atom(md,C,M_C,1, + //add_atom(md,C,M_C,1, + add_atom(md,SI,M_SI,1, ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB, &r,&v); } @@ -165,8 +175,10 @@ int main(int argc,char **argv) { /* cutoff radius */ #ifdef ALBE set_cutoff(&md,ALBE_S_SI); + //set_cutoff(&md,ALBE_S_C); #else set_cutoff(&md,TM_S_SI); + //set_cutoff(&md,TM_S_C); #endif /* @@ -247,13 +259,13 @@ int main(int argc,char **argv) { /* set (initial) dimensions of simulation volume */ #ifdef ALBE - set_dim(&md,LCNT*ALBE_LC_SI,LCNT*ALBE_LC_SI,LCNT*ALBE_LC_SI,TRUE); - //set_dim(&md,LCNT*ALBE_LC_C,LCNT*ALBE_LC_C,LCNT*ALBE_LC_C,TRUE); - //set_dim(&md,LCNT*ALBE_LC_SIC,LCNT*ALBE_LC_SIC,LCNT*ALBE_LC_SIC,TRUE); + set_dim(&md,LCNTX*ALBE_LC_SI,LCNTY*ALBE_LC_SI,LCNTZ*ALBE_LC_SI,TRUE); + //set_dim(&md,LCNTX*ALBE_LC_C,LCNTY*ALBE_LC_C,LCNTZ*ALBE_LC_C,TRUE); + //set_dim(&md,LCNTX*ALBE_LC_SIC,LCNTY*ALBE_LC_SIC,LCNTZ*ALBE_LC_SIC,TRUE); #else - //set_dim(&md,LCNT*LC_SI,LCNT*LC_SI,LCNT*LC_SI,TRUE); - //set_dim(&md,LCNT*LC_C,LCNT*LC_C,LCNT*LC_C,TRUE); - set_dim(&md,LCNT*TM_LC_SIC,LCNT*TM_LC_SIC,LCNT*TM_LC_SIC,TRUE); + set_dim(&md,LCNTX*LC_SI,LCNT*LC_SI,LCNT*LC_SI,TRUE); + //set_dim(&md,LCNTX*LC_C,LCNTY*LC_C,LCNTZ*LC_C,TRUE); + //set_dim(&md,LCNTX*TM_LC_SIC,LCNTY*TM_LC_SIC,LCNTZ*TM_LC_SIC,TRUE); #endif /* set periodic boundary conditions in all directions */ @@ -268,8 +280,8 @@ int main(int argc,char **argv) { #endif ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB, // ATOM_ATTR_2BP|ATOM_ATTR_HB, - 0,LCNT,LCNT,LCNT,NULL); - // 1,LCNT,LCNT,LCNT,NULL); + 0,LCNTX,LCNTY,LCNTZ,NULL); + // 1,LCNTX,LCNTY,LCNTZ,NULL); /* create zinkblende structure */ /* @@ -277,20 +289,20 @@ int main(int argc,char **argv) { r.x=0.5*0.25*ALBE_LC_SIC; r.y=r.x; r.z=r.x; create_lattice(&md,FCC,ALBE_LC_SIC,SI,M_SI, ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB, - 0,LCNT,LCNT,LCNT,&r); + 0,LCNTX,LCNTY,LCNTZ,&r); r.x+=0.25*ALBE_LC_SIC; r.y=r.x; r.z=r.x; create_lattice(&md,FCC,ALBE_LC_SIC,C,M_C, ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB, - 1,LCNT,LCNT,LCNT,&r); + 1,LCNTX,LCNTY,LCNTZ,&r); #else r.x=0.5*0.25*TM_LC_SIC; r.y=r.x; r.z=r.x; create_lattice(&md,FCC,TM_LC_SIC,SI,M_SI, ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB, - 0,LCNT,LCNT,LCNT,&r); + 0,LCNTX,LCNTY,LCNTZ,&r); r.x+=0.25*TM_LC_SIC; r.y=r.x; r.z=r.x; create_lattice(&md,FCC,TM_LC_SIC,C,M_C, ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB, - 1,LCNT,LCNT,LCNT,&r); + 1,LCNTX,LCNTY,LCNTZ,&r); #endif */ @@ -334,7 +346,7 @@ int main(int argc,char **argv) { set_pressure(&md,BAR); /* set amount of steps to skip before average calc */ - set_avg_skip(&md,PRERUN); + set_avg_skip(&md,(8.0/10.0*PRERUN)); /* set p/t scaling */ //set_pt_scale(&md,0,0,T_SCALE_BERENDSEN,100.0); @@ -357,12 +369,12 @@ int main(int argc,char **argv) { /* activate logging */ moldyn_set_log_dir(&md,argv[1]); - moldyn_set_report(&md,"Frank Zirkelbach","Test 1"); - moldyn_set_log(&md,LOG_TOTAL_ENERGY,1); - moldyn_set_log(&md,LOG_TEMPERATURE,1); - moldyn_set_log(&md,LOG_PRESSURE,1); - moldyn_set_log(&md,VISUAL_STEP,10); - moldyn_set_log(&md,SAVE_STEP,10); + moldyn_set_report(&md,"Frank Zirkelbach",R_TITLE); + moldyn_set_log(&md,LOG_TOTAL_ENERGY,LOG_E); + moldyn_set_log(&md,LOG_TEMPERATURE,LOG_T); + moldyn_set_log(&md,LOG_PRESSURE,LOG_P); + moldyn_set_log(&md,VISUAL_STEP,LOG_V); + moldyn_set_log(&md,SAVE_STEP,LOG_S); moldyn_set_log(&md,CREATE_REPORT,0); /*