+ if(!strncmp(word[1],"displace",8)) {
+ dap.nr=atoi(word[2]);
+ dap.dx=atof(word[3]);
+ dap.dy=atof(word[4]);
+ dap.dz=atof(word[5]);
+ add_stage(mdrun,STAGE_DISPLACE_ATOM,&dap);
+ }
+ else if(!strncmp(word[1],"del_atoms",9)) {
+ delp.o.x=atof(word[2]);
+ delp.o.y=atof(word[3]);
+ delp.o.z=atof(word[4]);
+ delp.r=atof(word[5]);
+ add_stage(mdrun,STAGE_DEL_ATOMS,&delp);
+ }
+ else if(!strncmp(word[1],"ins_atoms",9)) {
+ iap.ins_steps=atoi(word[2]);
+ iap.ins_atoms=atoi(word[3]);
+ iap.element=atoi(word[4]);
+ iap.brand=atoi(word[5]);
+ for(i=0;i<strlen(word[6]);i++) {
+ switch(word[6][i]) {
+ case 'b':
+ iap.attr|=ATOM_ATTR_VB;
+ break;
+ case 'h':
+ iap.attr|=ATOM_ATTR_HB;
+ break;
+ case 'v':
+ iap.attr|=ATOM_ATTR_VA;
+ break;
+ case 'f':
+ iap.attr|=ATOM_ATTR_FP;
+ break;
+ case '1':
+ iap.attr|=ATOM_ATTR_1BP;
+ break;
+ case '2':
+ iap.attr|=ATOM_ATTR_2BP;
+ break;
+ case '3':
+ iap.attr|=ATOM_ATTR_3BP;
+ break;
+ default:
+ break;
+ }
+ }
+ switch(word[7][0]) {
+ // insertion types
+ case 'p':
+ iap.type=INS_POS;
+ iap.x0=atof(word[8]);
+ iap.y0=atof(word[9]);
+ iap.z0=atof(word[10]);
+ break;
+ case 'r':
+ switch(word[8][0]) {
+
+ case 't':
+ iap.type=INS_TOTAL;
+ iap.cr=atof(word[9]);
+ break;
+ case 'r':
+ iap.type=INS_RECT;
+ iap.x0=atof(word[9]);
+ iap.y0=atof(word[10]);
+ iap.z0=atof(word[11]);
+ iap.x1=atof(word[12]);
+ iap.y1=atof(word[13]);
+ iap.z1=atof(word[14]);
+ iap.cr=atof(word[15]);
+ break;
+ case 's':
+ iap.type=INS_SPHERE;
+ iap.x0=atof(word[9]);
+ iap.y0=atof(word[10]);
+ iap.z0=atof(word[11]);
+ iap.x1=atof(word[12]);
+ iap.cr=atof(word[13]);
+ break;
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+ add_stage(mdrun,STAGE_INSERT_ATOMS,&iap);
+ }
+
+
+ // HERE WE GO ...
+
+ else if(!strncmp(word[1],"ins_m_atoms",11)) {
+ imp.element1=atoi(word[2]);
+ imp.element2=atoi(word[3]);
+ imp.amount1=atoi(word[4]);
+ imp.amount2=atoi(word[5]);
+ imp.brand1=atoi(word[6]);
+ imp.brand2=atoi(word[7]);
+ imp.crmin=atof(word[8]);
+ imp.crmax=atof(word[9]);
+ /* do this later ...
+ for(i=0;i<strlen(word[8]);i++) {
+ switch(word[8][i]) {
+ case 'b':
+ imp.attr|=ATOM_ATTR_VB;
+ break;
+ case 'h':
+ imp.attr|=ATOM_ATTR_HB;
+ break;
+ case 'v':
+ imp.attr|=ATOM_ATTR_VA;
+ break;
+ case 'f':
+ imp.attr|=ATOM_ATTR_FP;
+ break;
+ case '1':
+ imp.attr|=ATOM_ATTR_1BP;
+ break;
+ case '2':
+ imp.attr|=ATOM_ATTR_2BP;
+ break;
+ case '3':
+ imp.attr|=ATOM_ATTR_3BP;
+ break;
+ default:
+ break;
+ }
+ }
+ */
+ imp.attr1=ATOM_ATTR_HB|ATOM_ATTR_VA|ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_FP;
+ imp.attr2=ATOM_ATTR_HB|ATOM_ATTR_VA|ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_FP;
+ add_stage(mdrun,STAGE_INSERT_MIXED_ATOMS,&imp);
+ }
+
+
+
+
+
+ else if(!strncmp(word[1],"continue",8)) {
+ cp.runs=atoi(word[2]);
+ add_stage(mdrun,STAGE_CONTINUE,&cp);
+ }
+ else if(!strncmp(word[1],"anneal",6)) {
+ 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)) {
+ if(word[2][0]=='c') {
+ stp.type=SET_TEMP_CURRENT;
+ stp.val=0.0;
+ }
+ else {
+ stp.type=SET_TEMP_VALUE;
+ stp.val=atof(word[2]);
+ }
+ add_stage(mdrun,STAGE_SET_TEMP,&stp);
+ }
+ else if(!strncmp(word[1],"set_timestep",12)) {
+ stsp.tau=atof(word[2]);
+ add_stage(mdrun,STAGE_SET_TIMESTEP,&stsp);
+ }
+ else {
+ printf("%s unknown stage type: %s\n",
+ ME,word[1]);
+ return -1;
+ }