}
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;
}
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
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);
return 0;
}
+#define stage_print(m) if(!(stage->executed)) \
+ printf("%s",m)
+
int mdrun_hook(void *ptr1,void *ptr2) {
t_moldyn *moldyn;
/* 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;
iap->cnt_steps+=1;
break;
case STAGE_CONTINUE:
+ stage_print(" -> continue\n\n");
if(stage->executed==TRUE) {
change_stage=TRUE;
break;
steps=cp->runs;
break;
case STAGE_ANNEAL:
+ stage_print(" -> anneal\n\n");
ap=stage->params;
if(ap->count==ap->runs) {
change_stage=TRUE;
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;
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) {