Converting GromacsForce File to NAMD using GromacsTopFile.C

From: Ivan (ivanlosperez_at_gmail.com)
Date: Tue Jul 17 2018 - 06:25:58 CDT

Hi!

I have syntax errors when running the program.

Acoording to the scanf function of the NAMD source code, only 2 atoms typea
and typeb can be read:

case DIHEDRALTYPES
<http://www.ks.uiuc.edu/Research/namd/doxygen/GromacsTopFile_8C.html#6cc5488f9288fe04f28510aeac2c9e27>:00405
      i = sscanf(buf," %5s %5s %d %f %f %f %f %f %f",00406
     typea,typeb,&funct,&c[0],&c[1],&c[2],&c[3],&c[4],&c[5]);00407
  if(funct == 1 || funct == 2) {00408 if(i!=5+(funct==1)) { /*
6 for f=2, 5 for f=1 */00409 fprintf(stderr,"Syntax error in
DIHEDRALTYPES: %s\n",buf);00410 exit(1);00411 }00412
        c[0] = c[0]; /* both in deg */00413 c[1] =
c[1]/JOULES_PER_CALORIE
<http://www.ks.uiuc.edu/Research/namd/doxygen/GromacsTopFile_8C.html#0d7a8dff559ee043079a50ee58651087>;
/* convert kJ to kcal and still use E=kx2*/00414 /* for
funct==1 these are both divided by rad^2 */00415 if(funct==1)
{00416 mult=(int)(c[2]+0.5); /* round to nearest integer :p
*/00417 }00418 }00419 else if(funct == 3) {00420
      if(i!=9) {00421 fprintf(stderr,"Syntax error in
DIHEDRALTYPES\n");00422 exit(1);00423 }00424
for(j=0;j<6;j++) {00425 c[j] = c[j]/JOULES_PER_CALORIE
<http://www.ks.uiuc.edu/Research/namd/doxygen/GromacsTopFile_8C.html#0d7a8dff559ee043079a50ee58651087>;
/* convert kJ to kcal and E=Cn cos^n */00426 }00427
}00428 else {00429 fprintf(stderr,"I don't know what
funct=%d means in DIHEDRALTYPES\n",00430 funct);00431
       exit(1);00432 }00433 dihedralTable.addType
<http://www.ks.uiuc.edu/Research/namd/doxygen/classDihedralTable.html#f093c14257a792a41f8c663c8036444b>(typea,typeb,c,mult,funct);00434
      break;

But in my GROMACS script, I have 4 atoms as shown here:

[ dihedraltypes ]

  C_2 CT CT HC 3 -0.15899 -0.47698 0.00000 0.63596 0.00000
0.00000
  C_2 OS CT CT 3 -2.19660 5.20071 0.52719 -3.53130 0.00000
0.00000
  C_2 OS CT HC 3 0.41421 1.24265 0.00000 -1.65686 0.00000
0.00000
  CT CT OS CT 3 1.71544 2.84512 1.04600 -5.60656 0.00000
0.00000

How can I know wchich 2 atom hould I delete?

Thank you very much in advanced for your answer, I really need to know this
so I can finish my final degree project.

Ivan

This archive was generated by hypermail 2.1.6 : Thu Sep 19 2019 - 23:19:49 CDT