fixed virial calc in new albe pot
[physik/posic.git] / mdrun.c
diff --git a/mdrun.c b/mdrun.c
index d99bd7a..907388a 100644 (file)
--- a/mdrun.c
+++ b/mdrun.c
@@ -11,6 +11,7 @@
 #include "potentials/harmonic_oscillator.h"
 #include "potentials/lennard_jones.h"
 #include "potentials/albe.h"
+#include "potentials/albe_orig.h"
 #ifdef TERSOFF_ORIG
 #include "potentials/tersoff_orig.h"
 #else
@@ -196,6 +197,8 @@ int mdrun_parse_config(t_mdrun *mdrun) {
                if(!strncmp(word[0],"potential",9)) {
                        if(!strncmp(word[1],"albe",4))
                                mdrun->potential=MOLDYN_POTENTIAL_AM;
+                       if(!strncmp(word[1],"albe_o",6))
+                               mdrun->potential=MOLDYN_POTENTIAL_AO;
                        if(!strncmp(word[1],"tersoff",7))
                                mdrun->potential=MOLDYN_POTENTIAL_TM;
                        if(!strncmp(word[1],"ho",2))
@@ -879,10 +882,18 @@ int main(int argc,char **argv) {
 
        /* prepare simulation */
 
-       moldyn_init(&moldyn,argc,argv);
-
-       if(mdrun.continue_file)
+       if(mdrun.continue_file[0]) {
+               // read the save file
                moldyn_read_save_file(&moldyn,mdrun.continue_file);
+               // manualaadjusting some stuff
+               moldyn.argc=argc;
+               moldyn.args=argv;
+               rand_init(&(moldyn.random),NULL,1);
+               moldyn.random.status|=RAND_STAT_VERBOSE;
+       }
+       else {
+               moldyn_init(&moldyn,argc,argv);
+       }
        
        if(set_int_alg(&moldyn,mdrun.intalgo)<0)
                return -1;
@@ -897,6 +908,11 @@ int main(int argc,char **argv) {
                                             mdrun.element1,
                                             mdrun.element2);
                        break;
+               case MOLDYN_POTENTIAL_AO:
+                       albe_orig_mult_set_params(&moldyn,
+                                                 mdrun.element1,
+                                                 mdrun.element2);
+                       break;
                case MOLDYN_POTENTIAL_TM:
                        tersoff_mult_set_params(&moldyn,
                                                mdrun.element1,
@@ -915,7 +931,7 @@ int main(int argc,char **argv) {
        }
 
        /* if it is a continue run, reset schedule and skip lattice init */
-       if(mdrun.continue_file) {
+       if(mdrun.continue_file[0]) {
                memset(&(moldyn.schedule),0,sizeof(t_moldyn_schedule));
                goto addsched;
        }