added partition support in create_lattice function
[physik/posic.git] / mdrun.c
diff --git a/mdrun.c b/mdrun.c
index b5abe87..83f501c 100644 (file)
--- a/mdrun.c
+++ b/mdrun.c
 #include "potentials/tersoff.h"
 #endif
 
+/* pse */
+#define PSE_MASS
+#include "pse.h"
+#undef PSE_MASS
+
 #define ME     "[mdrun]"
 
 /*
@@ -279,6 +284,14 @@ int mdrun_parse_config(t_mdrun *mdrun) {
                        mdrun->ly=atoi(word[3]);
                        mdrun->lz=atoi(word[4]);
                        mdrun->lc=atof(word[5]);
+                       if(wcnt==8) {
+                               mdrun->fill_element=atoi(word[6]);
+                               mdrun->fill_brand=atoi(word[7]);
+                       }
+                       else {
+                               mdrun->fill_element=mdrun->element1;
+                               mdrun->fill_brand=0;
+                       }
                }
                else if(!strncmp(word[0],"aattr",5)) {
                        // for aatrib line we need a special stage
@@ -517,6 +530,7 @@ int mdrun_parse_config(t_mdrun *mdrun) {
                                ap.count=0;
                                ap.runs=atoi(word[2]);
                                ap.dt=atof(word[3]);
+                               ap.interval=atoi(word[4]);
                                add_stage(mdrun,STAGE_ANNEAL,&ap);
                        }
                        else if(!strncmp(word[1],"set_temp",8)) {
@@ -1006,6 +1020,7 @@ int mdrun_hook(void *ptr1,void *ptr2) {
                                        set_temperature(moldyn,
                                                        moldyn->t_ref+ap->dt);
                                ap->count+=1;
+                               steps=ap->interval;
                                break;
                        case STAGE_CHAATTR:
                                stage_print("  -> change atom attributes\n\n");
@@ -1148,24 +1163,27 @@ int main(int argc,char **argv) {
        set_pbc(&moldyn,mdrun.pbcx,mdrun.pbcy,mdrun.pbcz);
        switch(mdrun.lattice) {
                case FCC:
-                       create_lattice(&moldyn,FCC,mdrun.lc,mdrun.element1,
-                                      mdrun.m1,DEFAULT_ATOM_ATTR,0,mdrun.lx,
-                                      mdrun.ly,mdrun.lz,NULL);
+                       create_lattice(&moldyn,FCC,mdrun.lc,mdrun.fill_element,
+                                      mdrun.m1,DEFAULT_ATOM_ATTR,
+                                       mdrun.fill_brand,mdrun.lx,
+                                      mdrun.ly,mdrun.lz,NULL,0,NULL);
                        break;
                case DIAMOND:
-                       create_lattice(&moldyn,DIAMOND,mdrun.lc,mdrun.element1,
-                                      mdrun.m1,DEFAULT_ATOM_ATTR,0,mdrun.lx,
-                                      mdrun.ly,mdrun.lz,NULL);
+                       create_lattice(&moldyn,DIAMOND,mdrun.lc,
+                                       mdrun.fill_element,
+                                      mdrun.m1,DEFAULT_ATOM_ATTR,
+                                       mdrun.fill_brand,mdrun.lx,
+                                      mdrun.ly,mdrun.lz,NULL,0,NULL);
                        break;
                case ZINCBLENDE:
                        o.x=0.5*0.25*mdrun.lc; o.y=o.x; o.z=o.x;
                        create_lattice(&moldyn,FCC,mdrun.lc,mdrun.element1,
                                       mdrun.m1,DEFAULT_ATOM_ATTR,0,mdrun.lx,
-                                      mdrun.ly,mdrun.lz,&o);
+                                      mdrun.ly,mdrun.lz,&o,0,NULL);
                        o.x+=0.25*mdrun.lc; o.y=o.x; o.z=o.x;
                        create_lattice(&moldyn,FCC,mdrun.lc,mdrun.element2,
                                       mdrun.m2,DEFAULT_ATOM_ATTR,1,mdrun.lx,
-                                      mdrun.ly,mdrun.lz,&o);
+                                      mdrun.ly,mdrun.lz,&o,0,NULL);
                        break;
                case NONE:
                        set_nn_dist(&moldyn,mdrun.nnd);