#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
char error[128];
char line[128];
char *wptr;
- char word[16][32];
+ char word[16][64];
int wcnt;
int i,o;
wptr=strtok(line," \t");
if(wptr==NULL)
break;
- strncpy(word[wcnt],wptr,32);
+ strncpy(word[wcnt],wptr,64);
wcnt+=1;
}
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))
if(!strncmp(word[1],"lj",2))
mdrun->potential=MOLDYN_POTENTIAL_LJ;
}
+ else if(!strncmp(word[0],"continue",8))
+ strncpy(mdrun->continue_file,word[1],128);
else if(!strncmp(word[0],"cutoff",6))
mdrun->cutoff=atof(word[1]);
else if(!strncmp(word[0],"nnd",3))
/* sanity check! */
/* prepare simulation */
- moldyn_init(&moldyn,argc,argv);
+
+ 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;
+
+ /* potential */
set_cutoff(&moldyn,mdrun.cutoff);
if(set_potential(&moldyn,mdrun.potential)<0)
return -1;
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,
ME,mdrun.potential);
return -1;
}
+
+ /* if it is a continue run, reset schedule and skip lattice init */
+ if(mdrun.continue_file[0]) {
+ memset(&(moldyn.schedule),0,sizeof(t_moldyn_schedule));
+ goto addsched;
+ }
+
+ /* initial lattice and dimensions */
set_dim(&moldyn,mdrun.dim.x,mdrun.dim.y,mdrun.dim.z,mdrun.vis);
set_pbc(&moldyn,mdrun.pbcx,mdrun.pbcy,mdrun.pbcz);
switch(mdrun.lattice) {
return -1;
}
moldyn_bc_check(&moldyn);
+
+ /* temperature and pressure */
set_temperature(&moldyn,mdrun.temperature);
set_pressure(&moldyn,mdrun.pressure);
thermal_init(&moldyn,TRUE);
+
+addsched:
+ /* first schedule */
moldyn_add_schedule(&moldyn,mdrun.prerun,mdrun.timestep);
+
+ /* log */
moldyn_set_log_dir(&moldyn,mdrun.sdir);
moldyn_set_report(&moldyn,"CHANGE ME","CHANGE ME TOO");
if(mdrun.elog)