]> hackdaworld.org Git - physik/posic.git/commitdiff
safety checkin before mensa
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 29 Apr 2008 11:44:49 +0000 (13:44 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 29 Apr 2008 11:44:49 +0000 (13:44 +0200)
config.default
mdrun.c
mdrun.h
moldyn.c

index e9181be59348701d58c214abfb92d4700389f0ef..d63e401f69e88679b86546c496c1c97df505b59e 100644 (file)
@@ -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 c4b6df2a09badbeb2107df086f930ad444bde24c..63899a6a60e9ed72dfd07591792c486ccb6ef2a6 100644 (file)
--- 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;i<wcnt;i++) {
                                if(!strncmp(word[i],"pctrl",5)) {
-                                       csp.ptau=atof(word[++i]);
+                                       csp.ptau=0.01/(atof(word[++i])*GPA);
+                                       csp.type|=CHSATTR_PCTRL;
                                }
                                if(!strncmp(word[i],"tctrl",5)) {
                                        csp.ttau=atof(word[++i]);
+                                       csp.type|=CHSATTR_TCTRL;
                                }
                                if(!strncmp(word[i],"prelax",6)) {
                                        csp.dp=atof(word[++i]);
+                                       csp.type|=CHSATTR_PRELAX;
                                }
                                if(!strncmp(word[i],"trelax",6)) {
                                        csp.dt=atof(word[++i]);
+                                       csp.type|=CHSATTR_TRELAX;
                                }
                                if(!strncmp(word[i],"rsteps",6)) {
                                        csp.rsteps=atoi(word[++i]);
+                                       csp.type|=CHSATTR_RSTEPS;
                                }
                                if(!strncmp(word[i],"avgrst",6)) {
                                        csp.avgrst=atoi(word[++i]);
+                                       csp.type|=CHSATTR_AVGRST;
                                }
                        }
                        add_stage(mdrun,STAGE_CHSATTR,&csp);
@@ -654,6 +641,9 @@ int chsattr(t_moldyn *moldyn,t_mdrun *mdrun) {
        return 0;
 }
 
+#define stage_print(m) if(!(stage->executed)) \
+                               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 20d68d7f5aae59cd3d44fbc3b99154267eec7056..83a8196d879f09f9a3f164ee923435466427dc47 100644 (file)
--- 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;
index 832d171be44b345c61a6f05306bfe1b12e9c8c3d..6fa9df25c008ac26c5e12e30a1ca66095b3a600f 100644 (file)
--- 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;