import and adapt changes from jeff greathouse to support opls-aa
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
Stephanie Teich-McGoldrick (Sandai) is the current maintainer
|
||||
of the msi2lmp tool. She can be contacted at steichm at sandia.gov
|
||||
|
||||
02 Aug 2013 Axel Kohlmeyer <akohlmey@gmail.com>
|
||||
|
||||
Added rudimentary support for OPLS-AA based on
|
||||
input provided by jeff greathouse.
|
||||
|
||||
18 Jul 2013 Axel Kohlmeyer <akohlmey@gmail.com>
|
||||
|
||||
Added support for writing out image flags
|
||||
|
||||
236
tools/msi2lmp/biosym_frc_files/oplsaa.frc
Normal file
236
tools/msi2lmp/biosym_frc_files/oplsaa.frc
Normal file
@ -0,0 +1,236 @@
|
||||
!BIOSYM forcefield 1
|
||||
|
||||
! This is a modified version of msi2lmp for use specifically wtih the
|
||||
! OPLS force field. No out-of-plane or cross-terms are included.
|
||||
! Atom types from SPC water and CLAYFF are also included.
|
||||
|
||||
|
||||
#atom_types cvff
|
||||
|
||||
> Masses from CRC 1973/74 pages B-250.
|
||||
|
||||
!Ver Ref Type Mass Element Connections Comment
|
||||
!---- --- ---- ---------- ------- -----------------------------------------
|
||||
1.0 1 HC 1.007970 H 1 H, RH, alkanes
|
||||
1.0 1 HO 1.007970 H 1 H(O), ROH
|
||||
1.0 1 HS 1.007970 H 1 H(S), RSH
|
||||
1.0 1 HM 1.007970 H 1 H(C), CH3OH
|
||||
1.0 1 CT 12.011150 C 4 Aliphatic C
|
||||
1.0 1 OH 15.999400 O 2 O, ROH
|
||||
1.0 1 SH 32.064000 S 2 S, RSH
|
||||
1.0 1 S 32.064000 S 2 S, RSR
|
||||
1.0 1 CG 12.011150 C 1 Graphite C
|
||||
1.0 1 CL 35.453000 Cl 1 Cl, RCl
|
||||
X.X X CC 12.011150 C 3 Carbonate ion C, AMBER
|
||||
X.X X OC 15.035060 O 1 Carbonate ion O, AMBER
|
||||
|
||||
|
||||
#equivalence cvff
|
||||
|
||||
> Equivalence table for any variant of cvff
|
||||
|
||||
! Equivalences
|
||||
! -----------------------------------------
|
||||
!Ver Ref Type NonB Bond Angle Torsion OOP
|
||||
!---- --- ---- ---- ---- ----- ------- ----
|
||||
1.0 1 h h h h h h
|
||||
|
||||
|
||||
|
||||
#quadratic_bond cvff
|
||||
|
||||
> E = K2 * (R - R0)^2
|
||||
|
||||
!Ver Ref I J R0 K2
|
||||
!---- --- ---- ---- ------- --------
|
||||
2.3 23 CT CT 1.529 268.0
|
||||
2.3 23 CT HC 1.09 340.0
|
||||
2.3 23 CT OH 1.410 320.0
|
||||
2.3 23 CT SH 1.810 222.0
|
||||
1.0 1 HO OH 0.96 553.0
|
||||
1.0 1 HS SH 1.336 274.0
|
||||
1.0 1 CT S 1.810 222.0
|
||||
1.0 1 CT CL 1.781 245.0
|
||||
X.X X CC OC 1.21 648.0
|
||||
|
||||
|
||||
|
||||
#quadratic_angle cvff
|
||||
|
||||
> E = K2 * (Theta - Theta0)^2
|
||||
|
||||
!Ver Ref I J K Theta0 K2
|
||||
!---- --- ---- ---- ---- -------- -------
|
||||
2.3 23 CT CT CT 112.7 58.35
|
||||
2.3 23 CT CT HC 110.7 37.50
|
||||
2.3 23 CT CT OH 109.5 50.00
|
||||
2.3 23 HC CT HC 107.8 33.00
|
||||
2.3 23 CT OH HO 108.5 55.00
|
||||
2.3 23 HC CT OH 109.5 35.00
|
||||
1.0 1 CT CT SH 108.6 50.00
|
||||
1.0 1 CT SH HS 96.0 44.00
|
||||
1.0 1 HC CT SH 109.5 35.00
|
||||
1.0 1 CT CT S 114.7 50.00
|
||||
1.0 1 CT S CT 98.9 62.00
|
||||
1.0 1 HC CT S 109.5 35.00
|
||||
1.0 1 CT CT CL 109.8 69.0
|
||||
1.0 1 HC CT CL 107.6 51.0
|
||||
X.X X OC CC OC 127.0 79.1
|
||||
|
||||
|
||||
#bond-bond cvff
|
||||
|
||||
> E = K(b,b') * (R - R0) * (R' - R0')
|
||||
|
||||
!Ver Ref I J K K(b,b')
|
||||
!---- --- ---- ---- ---- -------
|
||||
1.0 1 c o c' 0.0000
|
||||
|
||||
#bond-angle cvff
|
||||
|
||||
> E = K * (R - R0) * (Theta - Theta0)
|
||||
|
||||
!Ver Ref I J K K(b,theta) K(b',theta)
|
||||
!---- --- ---- ---- ---- ---------- -----------
|
||||
1.0 1 c o c' 57.0000 57.0000
|
||||
|
||||
#torsion_1 opls
|
||||
|
||||
> E = 0.5*K1*[1 + cos(Phi)] + 0.5*K2*[1 + cos(2*Phi)] + 0.5*K3*[1 + cos(3*Phi)] + 0.5*K4*[1 + cos(4*Phi)]
|
||||
|
||||
!Ver Ref I J K L K1 K2 K3 K4
|
||||
!---- --- ---- ---- ---- ---- ------- ------ ------ -----
|
||||
X.X XX HC CT CT HC 0.0 0.0 0.318 0.0
|
||||
X.X XX HC CT CT CT 0.0 0.0 0.366 0.0
|
||||
X.X XX HC CT OH HO 0.0 0.0 0.450 0.0
|
||||
X.X XX CT CT OH HO -0.356 -0.174 0.492 0.0
|
||||
X.X XX HC CT CT OH 0.0 0.0 0.468 0.0
|
||||
X.X XX CT CT CT OH 1.711 -0.500 0.663 0.0
|
||||
X.X XX HC CT SH HS 0.0 0.0 0.451 0.0
|
||||
X.X XX CT CT SH HS -0.759 -0.282 0.603 0.0
|
||||
X.X XX HC CT CT SH 0.0 0.0 0.452 0.0
|
||||
X.X XX CT CT CT SH 1.876 0.0 0.0 0.0
|
||||
X.X XX HC CT CT S 0.0 0.0 0.452 0.0
|
||||
X.X XX CT CT S CT 0.925 -0.576 0.677 0.0
|
||||
X.X XX HC CT S CT 0.0 0.0 0.647 0.0
|
||||
X.X XX S CT CT CL 0.0 0.0 0.452 0.0
|
||||
X.X XX CL CT CT CL 0.250 -0.250 0.0 0.0
|
||||
X.X XX HC CT CT CL 0.0 0.0 0.400 0.0
|
||||
|
||||
|
||||
#angle-angle-torsion_1 cvff
|
||||
|
||||
> E = K * (Theta - Theta0) * (Theta' - Theta0') * cos(Phi)
|
||||
!Ver Ref I J K L K(Ang,Ang,Tor)
|
||||
!---- --- ---- ---- ---- ---- --------------
|
||||
1.0 1 * c c * -10.5000
|
||||
|
||||
#out_of_plane cvff
|
||||
|
||||
> E = Kchi * [ 1 + cos(n*Chi - Chi0) ]
|
||||
|
||||
!Ver Ref I J K L Kchi n Chi0
|
||||
!---- --- ---- ---- ---- ---- ------- ------ -------
|
||||
2.3 0 hn n c c' 10.0 2 180.0
|
||||
X.X X OC CC OC OC 1.1 2 180.0
|
||||
|
||||
|
||||
#out_of_plane-out_of_plane cvff
|
||||
|
||||
> E = Koo * Chi * Chi'
|
||||
|
||||
!Ver Ref I J K L Koo
|
||||
!---- --- ---- ---- ---- ---- -------
|
||||
1.0 1 c c' n o' 0.0100
|
||||
|
||||
#angle-angle cvff
|
||||
|
||||
> E = K * (Theta - Theta0) * (Theta' - Theta0')
|
||||
|
||||
! J' I' K'
|
||||
!Ver Ref I J K K
|
||||
!---- --- ---- ---- ---- ---- -------
|
||||
1.0 1 c c c c -7.9000
|
||||
|
||||
|
||||
|
||||
#morse_bond cvff_auto
|
||||
|
||||
> E = D * (1 - exp(-ALPHA*(R - R0)))^2
|
||||
|
||||
!Ver Ref I J R0 D ALPHA
|
||||
!---- --- ---- ---- ------- -------- -------
|
||||
2.0 18 c3m_ c3m_ 1.5100 88.0000 1.9150
|
||||
|
||||
#quadratic_bond cvff_auto
|
||||
|
||||
> E = K2 * (R - R0)^2
|
||||
|
||||
!Ver Ref I J R0 K2
|
||||
!---- --- ---- ---- ------- --------
|
||||
2.0 18 c3m_ c3m_ 1.5100 322.7158
|
||||
|
||||
|
||||
#quadratic_angle cvff_auto
|
||||
|
||||
> E = K2 * (Theta - Theta0)^2
|
||||
|
||||
!Ver Ref I J K Theta0 K2
|
||||
!---- --- ---- ---- ---- -------- -------
|
||||
2.0 18 c3m_ c3m_ c3m_ 60.0000 46.0000
|
||||
|
||||
|
||||
|
||||
|
||||
#torsion_1 cvff_auto
|
||||
|
||||
> E = Kphi * [ 1 + cos(n*Phi - Phi0) ]
|
||||
|
||||
!Ver Ref I J K L Kphi n Phi0
|
||||
!---- --- ---- ---- ---- ---- ------- ------ -------
|
||||
2.0 18 * c_ n3n_ * 0.0500 3 0.
|
||||
|
||||
|
||||
|
||||
|
||||
#out_of_plane cvff_auto
|
||||
|
||||
> E = Kchi * [ 1 + cos(n*Chi - Chi0) ]
|
||||
|
||||
!Ver Ref I J K L Kchi n Chi0
|
||||
!---- --- ---- ---- ---- ---- ------- ------ -------
|
||||
2.0 18 * c'_ * * 10.0000 2 180.0000
|
||||
|
||||
|
||||
#nonbond(12-6) cvff
|
||||
|
||||
@type A-B
|
||||
@combination geometric
|
||||
|
||||
> E = Aij/r^12 - Bij/r^6
|
||||
> where Aij = sqrt( Ai * Aj )
|
||||
> Bij = sqrt( Bi * Bj )
|
||||
|
||||
!Ver Ref I A B
|
||||
!---- --- ---- ----------- -----------
|
||||
1.0 1 HC 7152.557 29.297
|
||||
1.0 1 HO 0.0 0.0
|
||||
1.0 1 HS 0.0 0.0
|
||||
1.8 14 HM 7152.557 29.297
|
||||
1.0 1 CT 892114.214 485.302
|
||||
1.0 1 OH 578580.831 627.244
|
||||
2.3 25 SH 4006270.2 2001.567
|
||||
2.3 25 S 4006270.2 2001.567
|
||||
1.0 1 CG 531140.879 343.824
|
||||
1.0 1 CL 2863704.82 1853.765299
|
||||
X.X X CC 819971.66216 531.10286
|
||||
XX X OC 379876.39852 564.88598
|
||||
|
||||
|
||||
|
||||
#bond_increments cvff
|
||||
|
||||
!Ver Ref I J DeltaIJ DeltaJI
|
||||
!---- --- ---- ---- ------- -------
|
||||
2.3 23 no o- 0.1684 -0.1684
|
||||
|
||||
@ -77,7 +77,7 @@ void GetParameters()
|
||||
printf(" Unable to find vdw data for %s\n",atomtypes[i].potential);
|
||||
condexit(11);
|
||||
} else {
|
||||
if (forcefield & FF_TYPE_CLASS1) {
|
||||
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
|
||||
if((ff_vdw.data[k].ff_param[0] != 0.0 ) &&
|
||||
(ff_vdw.data[k].ff_param[1] != 0.0)) {
|
||||
atomtypes[i].params[0] =
|
||||
@ -132,7 +132,7 @@ void GetParameters()
|
||||
potential_types[0],potential_types[1]);
|
||||
condexit(12);
|
||||
} else {
|
||||
if (forcefield & FF_TYPE_CLASS1) {
|
||||
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
|
||||
bondtypes[i].params[0] = ff_bond.data[k].ff_param[1];
|
||||
bondtypes[i].params[1] = ff_bond.data[k].ff_param[0];
|
||||
}
|
||||
@ -189,7 +189,7 @@ void GetParameters()
|
||||
potential_types[0],potential_types[1],potential_types[2]);
|
||||
condexit(13);
|
||||
} else {
|
||||
if (forcefield & FF_TYPE_CLASS1) {
|
||||
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
|
||||
angletypes[i].params[0] = ff_ang.data[k].ff_param[1];
|
||||
angletypes[i].params[1] = ff_ang.data[k].ff_param[0];
|
||||
}
|
||||
@ -341,6 +341,10 @@ void GetParameters()
|
||||
}
|
||||
dihedraltypes[i].params[2] = ff_tor.data[k].ff_param[1];
|
||||
}
|
||||
if (forcefield & FF_TYPE_OPLSAA) {
|
||||
for (j=0; j < 4; j++)
|
||||
dihedraltypes[i].params[j] = ff_tor.data[k].ff_param[j];
|
||||
}
|
||||
if (forcefield & FF_TYPE_CLASS2) {
|
||||
for (j=0; j < 6; j++)
|
||||
dihedraltypes[i].params[j] = ff_tor.data[k].ff_param[j];
|
||||
|
||||
@ -31,7 +31,7 @@ void InitializeItems(void)
|
||||
/* BOND */
|
||||
|
||||
ff_bond.number_of_members = 2;
|
||||
if (forcefield & FF_TYPE_CLASS1) {
|
||||
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
|
||||
strcpy(ff_bond.keyword,"#quadratic_bond");
|
||||
ff_bond.number_of_parameters = 2;
|
||||
}
|
||||
@ -52,7 +52,7 @@ void InitializeItems(void)
|
||||
/* ANGLE */
|
||||
|
||||
ff_ang.number_of_members = 3;
|
||||
if (forcefield & FF_TYPE_CLASS1) {
|
||||
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
|
||||
strcpy(ff_ang.keyword,"#quadratic_angle");
|
||||
ff_ang.number_of_parameters = 2;
|
||||
}
|
||||
@ -65,7 +65,7 @@ void InitializeItems(void)
|
||||
/* TORSION */
|
||||
|
||||
ff_tor.number_of_members = 4;
|
||||
if (forcefield & FF_TYPE_CLASS1) {
|
||||
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
|
||||
strcpy(ff_tor.keyword,"#torsion_1");
|
||||
ff_tor.number_of_parameters = 3;
|
||||
}
|
||||
@ -78,7 +78,7 @@ void InitializeItems(void)
|
||||
/* OOP */
|
||||
|
||||
ff_oop.number_of_members = 4;
|
||||
if (forcefield & FF_TYPE_CLASS1) {
|
||||
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
|
||||
strcpy(ff_oop.keyword,"#out_of_plane");
|
||||
ff_oop.number_of_parameters = 3;
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ void ReadCarFile(void)
|
||||
atoms[k].molecule = m;
|
||||
atoms[k].no = k;
|
||||
|
||||
fscanf(CarF,"%s %lf %lf %lf %*s %d %s %s %f",
|
||||
fscanf(CarF,"%s %lf %lf %lf %*s %d %s %s %lf",
|
||||
atoms[k].name,
|
||||
&(atoms[k].x[0]),
|
||||
&(atoms[k].x[1]),
|
||||
|
||||
@ -57,8 +57,9 @@ void ReadFrcFile(void)
|
||||
ff_vdw.keyword,ff_vdw.entries);
|
||||
fprintf(stderr," Item %s has %d entries\n",
|
||||
ff_bond.keyword,ff_bond.entries);
|
||||
fprintf(stderr," Item %s has %d entries\n",
|
||||
ff_morse.keyword,ff_morse.entries);
|
||||
if (forcefield & FF_TYPE_CLASS1)
|
||||
fprintf(stderr," Item %s has %d entries\n",
|
||||
ff_morse.keyword,ff_morse.entries);
|
||||
fprintf(stderr," Item %s has %d entries\n",
|
||||
ff_ang.keyword,ff_ang.entries);
|
||||
if (forcefield & FF_TYPE_CLASS2) {
|
||||
|
||||
@ -41,7 +41,7 @@ void SearchAndFill(struct FrcFieldItem *item)
|
||||
while (got_it == 0) {
|
||||
status = fgets( line, MAX_LINE_LENGTH, FrcF );
|
||||
if (status == NULL) {
|
||||
fprintf(stderr," Unable to find forcefield keyword %s\n",item->keyword);
|
||||
fprintf(stderr," Unable to find keyword '%s'\n",item->keyword);
|
||||
fprintf(stderr," Check consistency of forcefield name and class \n");
|
||||
fprintf(stderr," Exiting....\n");
|
||||
exit(1);
|
||||
|
||||
@ -94,6 +94,7 @@ void WriteDataFile(char *nameroot)
|
||||
if (no_bond_types > 0) {
|
||||
m = 0;
|
||||
if (forcefield & FF_TYPE_CLASS1) m = 2;
|
||||
if (forcefield & FF_TYPE_OPLSAA) m = 2;
|
||||
if (forcefield & FF_TYPE_CLASS2) m = 4;
|
||||
|
||||
fprintf(DatF,"Bond Coeffs\n\n");
|
||||
@ -109,6 +110,7 @@ void WriteDataFile(char *nameroot)
|
||||
if (no_angle_types > 0) {
|
||||
m = 0;
|
||||
if (forcefield & FF_TYPE_CLASS1) m = 2;
|
||||
if (forcefield & FF_TYPE_OPLSAA) m = 2;
|
||||
if (forcefield & FF_TYPE_CLASS2) m = 4;
|
||||
|
||||
fprintf(DatF,"Angle Coeffs\n\n");
|
||||
@ -134,6 +136,17 @@ void WriteDataFile(char *nameroot)
|
||||
(int) dihedraltypes[i].params[1],
|
||||
(int) dihedraltypes[i].params[2]);
|
||||
|
||||
} else if (forcefield & FF_TYPE_OPLSAA) {
|
||||
|
||||
fprintf(DatF,"Dihedral Coeffs\n\n");
|
||||
|
||||
for (i=0; i < no_dihedral_types; i++) {
|
||||
fprintf(DatF, "%3i",i+1);
|
||||
for ( j = 0; j < 4; j++)
|
||||
fprintf(DatF, " %10.4f",dihedraltypes[i].params[j]);
|
||||
|
||||
fputs("\n",DatF);
|
||||
}
|
||||
} else if (forcefield & FF_TYPE_CLASS2) {
|
||||
|
||||
fprintf(DatF,"Dihedral Coeffs\n\n");
|
||||
@ -160,6 +173,17 @@ void WriteDataFile(char *nameroot)
|
||||
}
|
||||
fputs("\n",DatF);
|
||||
}
|
||||
} else if (forcefield & FF_TYPE_OPLSAA) {
|
||||
if (no_oop_types > 0) {
|
||||
/* opls improper coeffs are like cvff: type K0 d(=-1) n(=2) */
|
||||
fprintf(DatF,"Improper Coeffs\n\n");
|
||||
for (i=0; i < no_oop_types; i++) {
|
||||
fprintf(DatF,"%5i %10.4f %3i %3i\n",i+1,
|
||||
ooptypes[i].params[0], (int) ooptypes[i].params[1],
|
||||
(int) ooptypes[i].params[2]);
|
||||
}
|
||||
fputs("\n",DatF);
|
||||
}
|
||||
} else if (forcefield & FF_TYPE_CLASS2) {
|
||||
if ((no_oop_types + no_angleangle_types) > 0) {
|
||||
fprintf(DatF,"Improper Coeffs\n\n");
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/*
|
||||
*
|
||||
* msi2lmp.exe V3.8
|
||||
* msi2lmp.exe V3.9
|
||||
*
|
||||
* v3.9 AK - Rudimentary support for OPLS-AA
|
||||
*
|
||||
* v3.6 KLA - Changes to output to either lammps 2001 (F90 version) or to
|
||||
* lammps 2005 (C++ version)
|
||||
@ -317,15 +319,23 @@ int main (int argc, char *argv[])
|
||||
printf(" Forcefield file name: %s\n",FrcFileName);
|
||||
}
|
||||
|
||||
if (((forcefield & FF_TYPE_CLASS1) && (strstr(FrcFileName,"cff") != NULL)) ||
|
||||
((forcefield & FF_TYPE_CLASS2) &&
|
||||
! ((strstr(FrcFileName,"cvff") == NULL)
|
||||
|| (strstr(FrcFileName,"clayff") == NULL)
|
||||
|| (strstr(FrcFileName,"compass") == NULL))) ||
|
||||
((forcefield & FF_TYPE_OPLSAA) &&
|
||||
! (strstr(FrcFileName,"opls") == NULL))) {
|
||||
fprintf(stderr," WARNING - forcefield name and class appear to\n");
|
||||
fprintf(stderr," be inconsistent - Errors may result\n\n");
|
||||
n = 0;
|
||||
if (forcefield & FF_TYPE_CLASS1) {
|
||||
if (strstr(FrcFileName,"cvff") != NULL) ++n;
|
||||
if (strstr(FrcFileName,"clayff") != NULL) ++n;
|
||||
} else if (forcefield & FF_TYPE_OPLSAA) {
|
||||
if (strstr(FrcFileName,"oplsaa") != NULL) ++n;
|
||||
} else if (forcefield & FF_TYPE_CLASS2) {
|
||||
if (strstr(FrcFileName,"pcff") != NULL) ++n;
|
||||
if (strstr(FrcFileName,"cff91") != NULL) ++n;
|
||||
if (strstr(FrcFileName,"compass") != NULL) ++n;
|
||||
}
|
||||
|
||||
if (n == 0) {
|
||||
if (iflag > 0) fputs(" WARNING",stderr);
|
||||
else fputs(" Error ",stderr);
|
||||
|
||||
fputs("- forcefield name and class appear to be inconsistent\n\n",stderr);
|
||||
if (iflag == 0) return 7;
|
||||
}
|
||||
|
||||
|
||||
@ -826,6 +826,38 @@ sub syscompare {
|
||||
die "Number of ",$i," types does not match: $a vs $b" unless ($a == $b);
|
||||
}
|
||||
|
||||
topocompare($d1,$d2,'bond',2);
|
||||
topocompare($d1,$d2,'angle',3);
|
||||
topocompare($d1,$d2,'dihedral',4);
|
||||
topocompare($d1,$d2,'improper',4);
|
||||
|
||||
coeffcompare($d1,$d2,'pair','atom');
|
||||
coeffcompare($d1,$d2,'bond','bond');
|
||||
coeffcompare($d1,$d2,'angle','angle');
|
||||
coeffcompare($d1,$d2,'bondbond','angle');
|
||||
coeffcompare($d1,$d2,'bondangle','angle');
|
||||
coeffcompare($d1,$d2,'dihedral','dihedral');
|
||||
coeffcompare($d1,$d2,'angleangletorsion','dihedral');
|
||||
coeffcompare($d1,$d2,'bondbond13','dihedral');
|
||||
coeffcompare($d1,$d2,'endbondtorsion','dihedral');
|
||||
coeffcompare($d1,$d2,'middlebondtorsion','dihedral');
|
||||
coeffcompare($d1,$d2,'improper','improper');
|
||||
coeffcompare($d1,$d2,'angleangle','improper');
|
||||
|
||||
for ($i=0; $i < $d1->{natomtypes}; ++$i) {
|
||||
$j = $i+1;
|
||||
if (exists $d1->{mass}[$i]) {
|
||||
$a = $d1->{mass}[$i];
|
||||
} else {
|
||||
die "No mass for atom type $j in data file 1";
|
||||
}
|
||||
if (exists $d2->{mass}[$i]) {
|
||||
$a = $d2->{mass}[$i];
|
||||
} else {
|
||||
die "No mass for atom type $j in data file 2";
|
||||
}
|
||||
}
|
||||
|
||||
# check box information
|
||||
die "Inconsistent box shape" if ($d1->{triclinic} != $d2->{triclinic});
|
||||
|
||||
@ -868,38 +900,6 @@ sub syscompare {
|
||||
}
|
||||
}
|
||||
|
||||
for ($i=0; $i < $d1->{natomtypes}; ++$i) {
|
||||
$j = $i+1;
|
||||
if (exists $d1->{mass}[$i]) {
|
||||
$a = $d1->{mass}[$i];
|
||||
} else {
|
||||
die "No mass for atom type $j in data file 1";
|
||||
}
|
||||
if (exists $d2->{mass}[$i]) {
|
||||
$a = $d2->{mass}[$i];
|
||||
} else {
|
||||
die "No mass for atom type $j in data file 2";
|
||||
}
|
||||
}
|
||||
|
||||
topocompare($d1,$d2,'bond',2);
|
||||
topocompare($d1,$d2,'angle',3);
|
||||
topocompare($d1,$d2,'dihedral',4);
|
||||
topocompare($d1,$d2,'improper',4);
|
||||
|
||||
coeffcompare($d1,$d2,'pair','atom');
|
||||
coeffcompare($d1,$d2,'bond','bond');
|
||||
coeffcompare($d1,$d2,'angle','angle');
|
||||
coeffcompare($d1,$d2,'bondbond','angle');
|
||||
coeffcompare($d1,$d2,'bondangle','angle');
|
||||
coeffcompare($d1,$d2,'dihedral','dihedral');
|
||||
coeffcompare($d1,$d2,'angleangletorsion','dihedral');
|
||||
coeffcompare($d1,$d2,'bondbond13','dihedral');
|
||||
coeffcompare($d1,$d2,'endbondtorsion','dihedral');
|
||||
coeffcompare($d1,$d2,'middlebondtorsion','dihedral');
|
||||
coeffcompare($d1,$d2,'improper','improper');
|
||||
coeffcompare($d1,$d2,'angleangle','improper');
|
||||
|
||||
}
|
||||
|
||||
########################################################################
|
||||
|
||||
15
tools/msi2lmp/test/ethane-oplsaa.car
Normal file
15
tools/msi2lmp/test/ethane-oplsaa.car
Normal file
@ -0,0 +1,15 @@
|
||||
!BIOSYM archive 3
|
||||
PBC=ON
|
||||
Materials Studio Generated CAR File
|
||||
!DATE Tue Jul 02 12:42:22 2013
|
||||
PBC 10.0000 10.0000 10.0000 90.0000 90.0000 90.0000 (P1)
|
||||
C1 4.462910000 5.148330000 -5.000410000 XXXX 1 CT C -0.180
|
||||
C2 5.965490000 5.079930000 -4.999750000 XXXX 1 CT C -0.180
|
||||
H3 4.099550000 6.054480000 -5.502500000 XXXX 1 HC H 0.060
|
||||
H4 4.020330000 4.288350000 -5.519840000 XXXX 1 HC H 0.060
|
||||
H5 4.057610000 5.156680000 -3.980190000 XXXX 1 HC H 0.060
|
||||
H6 6.409980000 5.944880000 -4.490510000 XXXX 1 HC H 0.060
|
||||
H7 6.329880000 4.179410000 -4.488110000 XXXX 1 HC H 0.060
|
||||
H8 6.370610000 5.061380000 -6.019850000 XXXX 1 HC H 0.060
|
||||
end
|
||||
end
|
||||
36
tools/msi2lmp/test/ethane-oplsaa.mdf
Normal file
36
tools/msi2lmp/test/ethane-oplsaa.mdf
Normal file
@ -0,0 +1,36 @@
|
||||
!BIOSYM molecular_data 4
|
||||
|
||||
!Date: Tue Jul 02 12:42:23 2013 Materials Studio Generated MDF file
|
||||
|
||||
#topology
|
||||
|
||||
@column 1 element
|
||||
@column 2 atom_type
|
||||
@column 3 charge_group
|
||||
@column 4 isotope
|
||||
@column 5 formal_charge
|
||||
@column 6 charge
|
||||
@column 7 switching_atom
|
||||
@column 8 oop_flag
|
||||
@column 9 chirality_flag
|
||||
@column 10 occupancy
|
||||
@column 11 xray_temp_factor
|
||||
@column 12 connections
|
||||
|
||||
@molecule ethane
|
||||
|
||||
XXXX_1:C1 C CT 1 0 0 -0.1800 0 0 8 1.0000 0.0000 C2 H3 H4 H5
|
||||
XXXX_1:C2 C CT 1 0 0 -0.1800 0 0 8 1.0000 0.0000 C1 H6 H7 H8
|
||||
XXXX_1:H3 H HC 1 0 0 0.0600 0 0 8 1.0000 0.0000 C1
|
||||
XXXX_1:H4 H HC 1 0 0 0.0600 0 0 8 1.0000 0.0000 C1
|
||||
XXXX_1:H5 H HC 1 0 0 0.0600 0 0 8 1.0000 0.0000 C1
|
||||
XXXX_1:H6 H HC 1 0 0 0.0600 0 0 8 1.0000 0.0000 C2
|
||||
XXXX_1:H7 H HC 1 0 0 0.0600 0 0 8 1.0000 0.0000 C2
|
||||
XXXX_1:H8 H HC 1 0 0 0.0600 0 0 8 1.0000 0.0000 C2
|
||||
|
||||
!
|
||||
#symmetry
|
||||
@periodicity 3 xyz
|
||||
@group (P1)
|
||||
|
||||
#end
|
||||
14
tools/msi2lmp/test/in.ethane-oplsaa
Normal file
14
tools/msi2lmp/test/in.ethane-oplsaa
Normal file
@ -0,0 +1,14 @@
|
||||
log log.ethane-oplsaa
|
||||
units real
|
||||
atom_style full
|
||||
pair_style lj/cut/coul/cut 15.0
|
||||
bond_style harmonic
|
||||
angle_style harmonic
|
||||
dihedral_style opls
|
||||
|
||||
read_data ethane-oplsaa.data
|
||||
|
||||
thermo_style multi
|
||||
minimize 0.0 0.0 100 1000
|
||||
|
||||
write_data ethane-oplsaa.data2
|
||||
89
tools/msi2lmp/test/reference/ethane-oplsaa.data
Normal file
89
tools/msi2lmp/test/reference/ethane-oplsaa.data
Normal file
@ -0,0 +1,89 @@
|
||||
LAMMPS data file from msi2lmp v3.8 for ethane-oplsaa
|
||||
|
||||
8 atoms
|
||||
7 bonds
|
||||
12 angles
|
||||
9 dihedrals
|
||||
0 impropers
|
||||
|
||||
2 atom types
|
||||
2 bond types
|
||||
2 angle types
|
||||
1 dihedral types
|
||||
|
||||
-5.000000000 5.000000000 xlo xhi
|
||||
-5.000000000 5.000000000 ylo yhi
|
||||
-5.000000000 5.000000000 zlo zhi
|
||||
|
||||
Masses
|
||||
|
||||
1 12.011150
|
||||
2 1.007970
|
||||
|
||||
Pair Coeffs
|
||||
|
||||
1 0.0659999660 3.5000001502
|
||||
2 0.0300002576 2.4999982005
|
||||
|
||||
Bond Coeffs
|
||||
|
||||
1 268.0000 1.5290
|
||||
2 340.0000 1.0900
|
||||
|
||||
Angle Coeffs
|
||||
|
||||
1 37.5000 110.7000
|
||||
2 33.0000 107.8000
|
||||
|
||||
Dihedral Coeffs
|
||||
|
||||
1 0.0000 0.0000 0.3180 0.0000
|
||||
|
||||
Atoms
|
||||
|
||||
1 1 1 -0.180000 4.462910000 -4.851670000 4.999590000 0 1 -1
|
||||
2 1 1 -0.180000 -4.034510000 -4.920070000 -4.999750000 1 1 0
|
||||
3 1 2 0.060000 4.099550000 -3.945520000 4.497500000 0 1 -1
|
||||
4 1 2 0.060000 4.020330000 4.288350000 4.480160000 0 0 -1
|
||||
5 1 2 0.060000 4.057610000 -4.843320000 -3.980190000 0 1 0
|
||||
6 1 2 0.060000 -3.590020000 -4.055120000 -4.490510000 1 1 0
|
||||
7 1 2 0.060000 -3.670120000 4.179410000 -4.488110000 1 0 0
|
||||
8 1 2 0.060000 -3.629390000 -4.938620000 3.980150000 1 1 -1
|
||||
|
||||
Bonds
|
||||
|
||||
1 1 1 2
|
||||
2 2 1 3
|
||||
3 2 1 4
|
||||
4 2 1 5
|
||||
5 2 2 6
|
||||
6 2 2 7
|
||||
7 2 2 8
|
||||
|
||||
Angles
|
||||
|
||||
1 1 2 1 3
|
||||
2 1 2 1 4
|
||||
3 1 2 1 5
|
||||
4 2 3 1 4
|
||||
5 2 3 1 5
|
||||
6 2 4 1 5
|
||||
7 1 1 2 6
|
||||
8 1 1 2 7
|
||||
9 1 1 2 8
|
||||
10 2 6 2 7
|
||||
11 2 6 2 8
|
||||
12 2 7 2 8
|
||||
|
||||
Dihedrals
|
||||
|
||||
1 1 3 1 2 6
|
||||
2 1 3 1 2 7
|
||||
3 1 3 1 2 8
|
||||
4 1 4 1 2 6
|
||||
5 1 4 1 2 7
|
||||
6 1 4 1 2 8
|
||||
7 1 5 1 2 6
|
||||
8 1 5 1 2 7
|
||||
9 1 5 1 2 8
|
||||
|
||||
97
tools/msi2lmp/test/reference/ethane-oplsaa.data2
Normal file
97
tools/msi2lmp/test/reference/ethane-oplsaa.data2
Normal file
@ -0,0 +1,97 @@
|
||||
LAMMPS data file via write_data, version 14 Aug 2013-ICMS, timestep = 38
|
||||
|
||||
8 atoms
|
||||
2 atom types
|
||||
7 bonds
|
||||
2 bond types
|
||||
12 angles
|
||||
2 angle types
|
||||
9 dihedrals
|
||||
1 dihedral types
|
||||
|
||||
-5.0000000000000000e+00 5.0000000000000000e+00 xlo xhi
|
||||
-5.0000000000000000e+00 5.0000000000000000e+00 ylo yhi
|
||||
-5.0000000000000000e+00 5.0000000000000000e+00 zlo zhi
|
||||
|
||||
Masses
|
||||
|
||||
1 12.0112
|
||||
2 1.00797
|
||||
|
||||
Pair Coeffs
|
||||
|
||||
1 0.066 3.5
|
||||
2 0.0300003 2.5
|
||||
|
||||
Bond Coeffs
|
||||
|
||||
1 268 1.529
|
||||
2 340 1.09
|
||||
|
||||
Angle Coeffs
|
||||
|
||||
1 37.5 110.7
|
||||
2 33 107.8
|
||||
|
||||
Dihedral Coeffs
|
||||
|
||||
1 0 0 0.318 0
|
||||
|
||||
Atoms
|
||||
|
||||
1 1 1 -1.7999999999999999e-01 4.4513654787991950e+00 -4.8452952225235171e+00 4.9978618185413897e+00 0 1 -1
|
||||
2 1 1 -1.7999999999999999e-01 -4.0223413274230113e+00 -4.9265327783543249e+00 -4.9984426635205530e+00 1 1 0
|
||||
3 1 2 5.9999999999999998e-02 4.1118234494897825e+00 -3.9519955907798003e+00 4.4733619774254318e+00 0 1 -1
|
||||
4 1 2 5.9999999999999998e-02 4.0174988470475572e+00 4.2860576171223572e+00 4.5022469929383719e+00 0 0 -1
|
||||
5 1 2 5.9999999999999998e-02 4.0630111196035328e+00 -4.8077899330369602e+00 -3.9842586979365473e+00 0 1 0
|
||||
6 1 2 5.9999999999999998e-02 -3.5902683367048773e+00 -4.0732209849776302e+00 -4.4754195169139814e+00 1 1 0
|
||||
7 1 2 5.9999999999999998e-02 -3.6834327143496224e+00 4.1648625434843920e+00 -4.5005239377702599e+00 1 0 0
|
||||
8 1 2 5.9999999999999998e-02 -3.6312965164625557e+00 -4.9326456509345169e+00 3.9840140272361455e+00 1 1 -1
|
||||
|
||||
Velocities
|
||||
|
||||
1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
6 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
|
||||
Bonds
|
||||
|
||||
1 1 1 2
|
||||
2 2 1 3
|
||||
3 2 1 4
|
||||
4 2 1 5
|
||||
5 2 2 6
|
||||
6 2 2 7
|
||||
7 2 2 8
|
||||
|
||||
Angles
|
||||
|
||||
1 1 2 1 3
|
||||
2 1 2 1 4
|
||||
3 1 2 1 5
|
||||
4 2 3 1 4
|
||||
5 2 3 1 5
|
||||
6 2 4 1 5
|
||||
7 1 1 2 6
|
||||
8 1 1 2 7
|
||||
9 1 1 2 8
|
||||
10 2 6 2 7
|
||||
11 2 6 2 8
|
||||
12 2 7 2 8
|
||||
|
||||
Dihedrals
|
||||
|
||||
1 1 3 1 2 6
|
||||
2 1 3 1 2 7
|
||||
3 1 3 1 2 8
|
||||
4 1 4 1 2 6
|
||||
5 1 4 1 2 7
|
||||
6 1 4 1 2 8
|
||||
7 1 5 1 2 6
|
||||
8 1 5 1 2 7
|
||||
9 1 5 1 2 8
|
||||
@ -5,6 +5,24 @@ MSI2LMP=../src/msi2lmp.exe
|
||||
LAMMPS=../../../src/lmp_serial
|
||||
CHECKDATA=./data-compare.pl
|
||||
|
||||
if [ ! -x $MSI2LMP ]
|
||||
then
|
||||
echo "No executable $MSI2LMP"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d $BIOSYM_LIBRARY ]
|
||||
then
|
||||
echo "No directory $BIOSYM_LIBRARY"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -x $LAMMPS ]
|
||||
then
|
||||
echo "No executable $LAMMPS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
verbose=1
|
||||
counter=0
|
||||
errors=0
|
||||
@ -41,6 +59,22 @@ do \
|
||||
counter=$(expr $counter + 4)
|
||||
done
|
||||
|
||||
# OPLS-AA tests
|
||||
for m in ethane
|
||||
do \
|
||||
before=$errors
|
||||
${MSI2LMP} ${m}-oplsaa -c 0 -p ${verbose} -f oplsaa -n \
|
||||
|| errors=$(expr $errors + 1)
|
||||
${LAMMPS} -log none -screen none -in in.${m}-oplsaa \
|
||||
|| errors=$(expr $errors + 1)
|
||||
${CHECKDATA} ${m}-oplsaa.data reference/${m}-oplsaa.data \
|
||||
|| errors=$(expr $errors + 1)
|
||||
${CHECKDATA} ${m}-oplsaa.data2 reference/${m}-oplsaa.data2 \
|
||||
|| errors=$(expr $errors + 1)
|
||||
[ $before -eq $errors ] && rm ${m}-oplsaa.data ${m}-oplsaa.data2 log.${m}-oplsaa
|
||||
counter=$(expr $counter + 4)
|
||||
done
|
||||
|
||||
# Class2 tests with compass
|
||||
for m in hydrogen ethane benzene naphthalene
|
||||
do \
|
||||
|
||||
Reference in New Issue
Block a user