From: hackbard Date: Tue, 29 Apr 2008 11:44:49 +0000 (+0200) Subject: safety checkin before mensa X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dddad627c54f294c4c5b5d736178c3ef3288159;p=physik%2Fposic.git safety checkin before mensa --- diff --git a/config.default b/config.default index e9181be..d63e401 100644 --- a/config.default +++ b/config.default @@ -4,8 +4,9 @@ ## potential ## -potential albe +potential albe 14 6 cutoff 2.96 +nnd 2.351 ## integration algorithm ## @@ -14,20 +15,20 @@ timestep 1.0 ## simulation volume ## -volume +volume 48.861 48.861 48.861 pbc 1 1 1 ## temperature / pressure ## -temperature 450.0 +temperature -273.0 pressure 0.0 ## initial lattice ## lattice diamond #lattice zincblende -element1 silicon -#element2 carbon +element1 14 +element2 6 fill lc 9 9 9 ## atom attributes ## diff --git a/mdrun.c b/mdrun.c index c4b6df2..63899a6 100644 --- a/mdrun.c +++ b/mdrun.c @@ -201,6 +201,8 @@ int mdrun_parse_config(t_mdrun *mdrun) { } else if(!strncmp(word[0],"cutoff",6)) mdrun->cutoff=atof(word[1]); + else if(!strncmp(word[0],"nnd",3)) + mdrun->nnd=atof(word[1]); else if(!strncmp(word[0],"intalgo",7)) { if(!strncmp(word[1],"verlet",5)) mdrun->intalgo=MOLDYN_INTEGRATE_VERLET; @@ -242,33 +244,11 @@ int mdrun_parse_config(t_mdrun *mdrun) { } else if(!strncmp(word[0],"element1",8)) { mdrun->element1=atoi(word[1]); - switch(mdrun->element1) { - case SI: - mdrun->m1=M_SI; - break; - case C: - mdrun->m1=M_C; - break; - default: - printf("%s unknown element1: %s|%d\n", - ME,word[1],mdrun->element1); - return -1; - } + mdrun->m1=pse_mass[mdrun->element1]; } else if(!strncmp(word[0],"element2",8)) { mdrun->element2=atoi(word[1]); - switch(mdrun->element2) { - case SI: - mdrun->m2=M_SI; - break; - case C: - mdrun->m2=M_C; - break; - default: - printf("%s unknown element2: %s|%d\n", - ME,word[1],mdrun->element2); - return -1; - } + mdrun->m2=pse_mass[mdrun->element2]; } else if(!strncmp(word[0],"fill",6)) { // only lc mode by now @@ -341,24 +321,31 @@ int mdrun_parse_config(t_mdrun *mdrun) { else if(!strncmp(word[0],"sattr",5)) { // for satrib line we need a special stage // containing one schedule of 0 loops ... + csp.type=0; for(i=1;iexecuted)) \ + printf("%s",m) + int mdrun_hook(void *ptr1,void *ptr2) { t_moldyn *moldyn; @@ -684,15 +674,22 @@ int mdrun_hook(void *ptr1,void *ptr2) { /* default steps and tau values */ steps=mdrun->relax_steps; +printf("-------> %d\n",mdrun->relax_steps); tau=mdrun->timestep; /* check whether relaxation steps are necessary */ if(!((check_pressure(moldyn,mdrun)==FALSE)|\ (check_temperature(moldyn,mdrun)==FALSE))) { + + /* be verbose */ + stage_print("\n###########################\n"); + stage_print("# [mdrun] executing stage #\n"); + stage_print("###########################\n\n"); /* stage specific stuff */ switch(stage->type) { case STAGE_INSERT_ATOMS: + stage_print(" -> insert atoms\n\n"); iap=stage->params; if(iap->cnt_steps==iap->ins_steps) { change_stage=TRUE; @@ -702,6 +699,7 @@ int mdrun_hook(void *ptr1,void *ptr2) { iap->cnt_steps+=1; break; case STAGE_CONTINUE: + stage_print(" -> continue\n\n"); if(stage->executed==TRUE) { change_stage=TRUE; break; @@ -710,6 +708,7 @@ int mdrun_hook(void *ptr1,void *ptr2) { steps=cp->runs; break; case STAGE_ANNEAL: + stage_print(" -> anneal\n\n"); ap=stage->params; if(ap->count==ap->runs) { change_stage=TRUE; @@ -719,10 +718,12 @@ int mdrun_hook(void *ptr1,void *ptr2) { ap->count+=1; break; case STAGE_CHAATTR: + stage_print(" -> chaattr\n\n"); chaatr(moldyn,mdrun); change_stage=TRUE; break; case STAGE_CHSATTR: + stage_print(" -> chsattr\n\n"); chsattr(moldyn,mdrun); change_stage=TRUE; break; @@ -789,6 +790,7 @@ int main(int argc,char **argv) { if(set_int_alg(&moldyn,mdrun.intalgo)<0) return -1; set_cutoff(&moldyn,mdrun.cutoff); + set_nn_dist(&moldyn,mdrun.nnd); if(set_potential(&moldyn,mdrun.potential)<0) return -1; switch(mdrun.potential) { diff --git a/mdrun.h b/mdrun.h index 20d68d7..83a8196 100644 --- a/mdrun.h +++ b/mdrun.h @@ -57,8 +57,9 @@ typedef struct s_mdrun { double timestep; // timestep u8 potential; // potential - double cutoff; // cutoff radius + double nnd; // next neighbour distance + t_3dvec dim; // simulation volume u8 pbcx; // periodic boundary conditions u8 pbcy; diff --git a/moldyn.c b/moldyn.c index 832d171..6fa9df2 100644 --- a/moldyn.c +++ b/moldyn.c @@ -1635,6 +1635,7 @@ int moldyn_integrate(t_moldyn *moldyn) { atom=moldyn->atom; /* initialize linked cell method */ +printf(" hier soll es sein\n"); link_cell_init(moldyn,VERBOSE); /* logging & visualization */ @@ -2415,6 +2416,8 @@ int process_2b_bonds(t_moldyn *moldyn,void *data, lc=&(moldyn->lc); + /* only init link cell if it doesn't exist! */ + HIER WEITER link_cell_init(moldyn,VERBOSE); itom=moldyn->atom;