Skip to content
Snippets Groups Projects
Commit 0aa77408 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14219 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 01e0beda
No related branches found
No related tags found
No related merge requests found
Showing
with 27419 additions and 0 deletions
Axel Kohlmeyer is the current maintainer of the msi2lmp tool.
Please send any inquiries about msi2lmp to the lammps-users mailing list.
24 Oct 2015 Axel Kohlmeyer <akohlmey@gmail.com>
Added check to make certain that force field files
are consistent with the notation of non-bonded parameters
that the msi2lmp code expects. For Class 1 and OPLS-AA
the A-B notation with geometric mixing is expected and for
Class 2 the r-eps notation with sixthpower mixing.(
11 Sep 2014 Axel Kohlmeyer <akohlmey@gmail.com>
Refactored ReadMdfFile.c so it more consistently honors
the MAX_NAME and MAX_STRING string length defines and
potentially handles inputs with long names better.
27 May 2014 Axel Kohlmeyer <akohlmey@gmail.com>
Added TopoTools style type hints as comments to all Mass, PairCoeff,
BondCoeff, AngleCoeff, DihedralCoeff, ImproperCoeff entries.
This should make it easier to identify force field entries with
the structure and force field map in the data file later.
06 Mar 2014 Axel Kohlmeyer <akohlmey@gmail.com>
Fixed a bug in handling of triclinic cells, where the matrices to
convert to and from fractional coordinates were incorrectly built.
26 Oct 2013 Axel Kohlmeyer <akohlmey@gmail.com>
Implemented writing out force field style hints in generated data
files for improved consistency checking when reading those files.
Also added writing out CGCMM style comments to identify atom types.
08 Oct 2013 Axel Kohlmeyer <akohlmey@gmail.com>
Fixed a memory access violation with Class 2 force fields.
Free all allocated memory to better detection of memory errors.
Print out version number and data with all print levels > 0.
Added valgrind checks to the regression tests
08 Oct 2013 Axel Kohlmeyer <akohlmey@gmail.com>
Fixed a memory access violation with Class 2 force fields.
Free all allocated memory to better detection of memory errors.
Print out version number and data with all print levels > 0.
Added valgrind checks to the regression tests
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
Improved accuracy of atom masses
Added flag for shifting the entire system
Fixed some minor logic bugs and prepared
for supporting other force fields and morse style bonds.
12 Jul 2013 Axel Kohlmeyer <akohlmey@gmail.com>
Fixed the bug that caused improper coefficients to be wrong
Cleaned up the handling of box parameters and center the box
by default around the system/molecule. Added a flag to make
this step optional and center the box around the origin instead.
Added a regression test script with examples.
1 Jul 2013 Axel Kohlmeyer <akohlmey@gmail.com>
Cleanup and improved port to windows.
Removed some more static string limits.
Added print level 3 for additional output.
Make code stop at missing force field parameters
and added -i flag to override this.
Safer argument checking.
Provide short versions for all flags.
23 Sep 2011
added support for triclinic boxes
see msi2lmp/TriclinicModification.pdf doc for details
-----------------------------
msi2lmp V3.6 4/10/2005
This program uses the .car and .mdf files from MSI/Biosyms's INSIGHT
program to produce a LAMMPS data file.
1. Building msi2lmp
Use the Makefile in the src directory. It is
currently set up for gcc. You will have to modify
it to use a different compiler.
2. Testing the program
There are several pairs of input test files in the format generated
by materials studio or compatible programs (one .car and one .mdf
file each) in the test directory. There is also a LAMMPS input to
run a minimization for each and write out the resulting system as
a data file. With the runtests.sh script all of those inputs are
converted via msi2lmp, then the minimization with LAMMPS is run
and the generated data files are compared with the corresponding
files in the reference folder. This script assumes you are on a
unix/linux system and that you have compile a serial LAMMPS executable
called lmp_serial with make serial. The tests are groups by the
force fields they use.
3. To run the program
The program is started by supplying information at the command prompt
according to the usage described below.
USAGE: msi2lmp.exe <ROOTNAME> {-print #} {-class #} {-frc FRC_FILE}
{-ignore} {-nocenter} {-shift # # #}
-- msi2lmp.exe is the name of the executable
-- <ROOTNAME> is the base name of the .car and .mdf files
-- -2001
Output lammps files for LAMMPS version 2001 (F90 version)
Default is to write output for the C++ version of LAMMPS
-- -print (or -p)
# is the print level 0 - silent except for error messages
1 - minimal (default)
2 - verbose (usual for developing and
checking new data files for consistency)
3 - even more verbose (additional debug info)
-- -ignore (or -i) ignore errors about missing force field parameters
and treat them as warnings instead.
-- -nocenter (or -n) do not recenter the simulation box around the
geometrical center of the provided geometry but
rather around the origin
-- -oldstyle (or -o) write out a data file without style hints
(to be compatible with older LAMMPS versions)
-- -shift (or -s) translate the entire system (box and coordinates)
by a vector (default: 0.0 0.0 0.0)
-- -class (or -c)
# is the class of forcefield to use (I or 1 = Class I e.g., CVFF)
(O or 0 = OPLS-AA)
(II or 2 = Class II e.g., CFFx)
default is -class I
-- -frc (or -f) specifies name of the forcefield file (e.g., cff91)
If the file name includes a directory component (or drive letter
on Windows), then the name is used as is. Otherwise, the program
looks for the forcefield file in $MSI2LMP_LIBRARY (or %MSI2LMP_LIBRARY%
on Windows). If $MSI2LMP_LIBRARY is not set, ../frc_files is used
(for testing). If the file name does not end in .frc, then .frc
is appended to the name.
For example, -frc cvff (assumes cvff.frc is in $MSI2LMP_LIBRARY
or ../frc_files)
-frc cff/cff91 (assumes cff91.frc is in cff)
-frc /usr/local/forcefields/cff95
(assumes cff95.frc is in /usr/local/forcefields/)
By default, the program uses $MSI2LMP_LIBRARY/cvff.frc or
../frc_files/cvff.frc depending on whether MSI2LMP_LIBRARY is set.
-- the LAMMPS data file is written to <ROOTNAME>.data
protocol and error information is written to the screen.
****************************************************************
*
* msi2lmp
*
* This is the third version of a program that generates a LAMMPS
* data file based on the information in MSI .car (atom
* coordinates), .mdf (molecular topology) and .frc (forcefield)
* files. The .car and .mdf files are specific to a molecular
* system while the .frc file is specific to a forcefield version.
* The only coherency needed between .frc and .car/.mdf files are
* the atom types.
*
* The first version was written by Steve Lustig at Dupont, but
* required using Discover to derive internal coordinates and
* forcefield parameters
*
* The second version was written by Michael Peachey while an
* intern in the Cray Chemistry Applications Group managed
* by John Carpenter. This version derived internal coordinates
* from the mdf file and looked up parameters in the frc file
* thus eliminating the need for Discover.
*
* The third version was written by John Carpenter to optimize
* the performance of the program for large molecular systems
* (the original code for deriving atom numbers was quadratic in time)
* and to make the program fully dynamic. The second version used
* fixed dimension arrays for the internal coordinates.
*
* The current maintainer is only reluctantly doing so because John Mayo no longer
* needs this code.
*
* V3.2 corresponds to adding code to MakeLists.c to gracefully deal with
* systems that may only be molecules of 1 to 3 atoms. In V3.1, the values
* for number_of_dihedrals, etc. could be unpredictable in these systems.
*
* V3.3 was generated in response to a strange error reading a MDF file generated by
* Accelys' Materials Studio GUI. Simply rewriting the input part of ReadMdfFile.c
* seems to have fixed the problem.
*
* V3.4 and V3.5 are minor upgrades to fix bugs associated mostly with .car and .mdf files
* written by Accelys' Materials Studio GUI.
*
* V3.6 outputs to LAMMPS 2005 (C++ version).
*
* Contact: Kelly L. Anderson, kelly.anderson@cantab.net
*
* April 2005
Set the environment variable MSI2LMP_LIBRARY or copy cvff.frc and cff9*.frc
or any other *.frc files (which you have license to use) to this directory
for use with msi2lmp.
Note that LAMMPS does not distribute Accelrys (or old BioSym)
force field files, since they are proprietary. All the
files in this directory that are part of the LAMMPS distribution
are are openly available files that are in the public domain.
source diff could not be displayed: it is too large. Options to address this: view the blob.
!CLAYFF forcefield
#atom_types cvff
!Ver Ref Type Mass Element Connections Comment
!---- --- ---- ---------- ------- -----------------------------------------
1.0 1 st 28.08550 Si 4
1.0 1 ao 26.98154 Al 6
1.0 1 at 26.98154 Al 4
1.0 1 mgo 24.30500 Mg 6
1.0 1 cao 40.08000 Ca 6
1.0 1 feo 55.84700 Fe 6
1.0 1 lio 6.941000 Li 6
1.0 1 ob 15.99940 O 2
1.0 1 obss 15.99940 O 3
1.0 1 obts 15.99940 O 2
1.0 1 obos 15.99940 O 2
1.0 1 ohs 15.99940 O 2
1.0 1 oh 15.99940 O 2
1.0 1 oh- 15.99940 O 1
1.0 1 o* 15.99940 O 2
1.0 1 ho 1.007970 H 1
1.0 1 h* 1.007970 H 1
1.0 1 Na 22.99000 Na 0
1.0 1 K 39.10 K 0
1.0 1 Cs 132.9100 Cs 0
1.0 1 Ca 40.07980 Ca 0
1.0 1 Ba 137.3300 Ba 0
1.0 1 Mg 24.3050 Mg 0
1.0 1 Sr 87.6200 Sr 0
1.0 1 Pb 207.2000 Pb 0
1.0 1 Cl 35.45300 Cl 0
#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
#auto_equivalence cvff_auto
! Equivalences
! -----------------------------------------
!Ver Ref Type NonB Bond Bond Angle Angle Torsion Torsion OOP OOP
! Inct End atom Apex atom End Atoms Center Atoms End Atom Center Atom
!---- --- ---- ---- ------ ---- ---------- --------- --------- ----------- -------- -----------
2.0 18 h h h h_ h_ h_ h_ h_ h_ h_
#hbond_definition cvff
#morse_bond cvff
> E = D * (1 - exp(-ALPHA*(R - R0)))^2
!Ver Ref I J R0 D ALPHA
!---- --- ---- ---- ------- -------- -------
2.3 23 no o- 1.2178 140.2486 2.0000
#quadratic_bond cvff
> E = K2 * (R - R0)^2
!Ver Ref I J R0 K2
!---- --- ---- ---- ------- --------
2.1 28 oh ho 1.0000 553.9350
2.1 28 ohs ho 1.0000 553.9350
#quadratic_angle cvff
> E = K2 * (Theta - Theta0)^2
!Ver Ref I J K Theta0 K2
!---- --- ---- ---- ---- -------- -------
2.3 23 cp cp c' 120.0000 34.6799
#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 st 12.3645 0.00954
1.0 1 ao 196.1446 0.03230
1.0 1 at 12.3645 0.00954
1.0 1 mgo 1636.3265 0.07688
1.0 1 cao 17814.73 0.5987
1.0 1 feo 702.54 0.0504
1.0 1 lio 112.01 0.0201
1.0 1 ob 629358.0000 625.50000
1.0 1 obss 629358.0000 625.50000
1.0 1 obts 629358.0000 625.50000
1.0 1 obos 629358.0000 625.50000
1.0 1 ohs 629358.0000 625.50000
1.0 1 oh 629358.0000 625.50000
1.0 1 oh- 629358.0000 625.50000
1.0 1 o* 629358.0000 625.50000
1.0 1 ho 0.00000001 0.00000
1.0 1 h* 0.00000001 0.00000
1.0 1 Na 14763.1719 87.65132
1.0 1 K 754506.86 549.37
1.0 1 Cs 3998193.96 1264.63
1.0 1 Ca 125966.6068 224.46969
1.0 1 Ba 1799606.56 582.25
1.0 1 Mg 1369.00 69.22
1.0 1 Sr 1185860.37 688.73
1.0 1 Pb 861150.71 638.08
1.0 1 Cl 21081006.97 2905.31
#bond_increments cvff
!Ver Ref I J DeltaIJ DeltaJI
!---- --- ---- ---- ------- -------
2.3 23 no o- 0.1684 -0.1684
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
!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 CT CT CT CT 1.740 -0.157 0.279 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
This diff is collapsed.
VERSION
elib
This diff is collapsed.
#include "msi2lmp.h"
void CheckLists() {
int i;
for (i=0; i < total_no_bonds; i++) {
if ((atoms[bonds[i].members[0]].type != bondtypes[bonds[i].type].types[0])
|| (atoms[bonds[i].members[1]].type != bondtypes[bonds[i].type].types[1])) {
fprintf(stderr,"Warning atom types in bond %d are inconsistent with bond type %d\n",i,bonds[i].type);
}
}
for (i=0; i < total_no_angles;i++) {
if ((atoms[angles[i].members[0]].type != angletypes[angles[i].type].types[0])
|| (atoms[angles[i].members[1]].type != angletypes[angles[i].type].types[1])
|| (atoms[angles[i].members[2]].type != angletypes[angles[i].type].types[2])) {
fprintf(stderr,"Warning atom types in angle %d are inconsistent with angle type %d\n", i,angles[i].type);
}
}
for (i=0; i < total_no_dihedrals; i++) {
if ((atoms[dihedrals[i].members[0]].type != dihedraltypes[dihedrals[i].type].types[0])
|| (atoms[dihedrals[i].members[1]].type != dihedraltypes[dihedrals[i].type].types[1])
|| (atoms[dihedrals[i].members[2]].type != dihedraltypes[dihedrals[i].type].types[2])
|| (atoms[dihedrals[i].members[3]].type != dihedraltypes[dihedrals[i].type].types[3])) {
fprintf(stderr,"Warning atom types in dihedral %d are inconsistent with dihedral type %d\n",i,dihedrals[i].type);
}
}
for (i=0; i < total_no_oops; i++) {
if ((atoms[oops[i].members[0]].type != ooptypes[oops[i].type].types[0])
|| (atoms[oops[i].members[1]].type != ooptypes[oops[i].type].types[1])
|| (atoms[oops[i].members[2]].type != ooptypes[oops[i].type].types[2])
|| (atoms[oops[i].members[3]].type != ooptypes[oops[i].type].types[3])) {
fprintf(stderr,"Warning atom types in oop %d are inconsistent with oop type %d\n",i,oops[i].type);
}
}
}
/******************************
*
* This is the header file for the routine that reads the forcefield file
* into memory in order to speed up searching.
*
* It defines the data structures used to store the force field in memory
*/
#define MAX_NO_MEMS 6
#define MAX_NO_PARAMS 8
struct FrcFieldData {
float ver; /* Version number of forcefield entry */
int ref; /* Reference within forcefield */
char ff_types[MAX_NO_MEMS][5];
double ff_param[MAX_NO_PARAMS];
};
struct FrcFieldItem {
char keyword[25];
int number_of_members; /* number of members of item */
int number_of_parameters; /* number of parameters of item */
int entries; /* number of entries in item list */
struct FrcFieldData *data; /* contains all eqiuv and param data */
};
extern struct FrcFieldItem ff_atomtypes, equivalence, ff_vdw, ff_bond, ff_morse, ff_ang, ff_tor, ff_oop,
ff_bonbon, ff_bonang, ff_angtor, ff_angangtor, ff_endbontor, ff_midbontor, ff_angang, ff_bonbon13;
/* prototypes */
extern void InitializeItems(void);
extern void ClearFrcItem(struct FrcFieldItem *item);
extern void SearchAndFill(struct FrcFieldItem *item);
extern const char *SearchAndCheck(const char *);
This diff is collapsed.
/*
* This function fills in the keyword field, the number of members for each
* item and the number of parameters for each item
*
*/
#include "msi2lmp.h"
#include "Forcefield.h"
#include <string.h>
void InitializeItems(void)
{
/* ATOM TYPES */
strcpy(ff_atomtypes.keyword,"#atom_types");
ff_atomtypes.number_of_members = 1;
ff_atomtypes.number_of_parameters = 1;
/* EQUIVALENCE */
strcpy(equivalence.keyword,"#equivalence");
equivalence.number_of_members = 6;
equivalence.number_of_parameters = 0;
/* NON-BOND */
strcpy(ff_vdw.keyword,"#nonbond");
ff_vdw.number_of_members = 1;
ff_vdw.number_of_parameters = 2;
/* BOND */
ff_bond.number_of_members = 2;
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
strcpy(ff_bond.keyword,"#quadratic_bond");
ff_bond.number_of_parameters = 2;
}
if (forcefield & FF_TYPE_CLASS2) {
strcpy(ff_bond.keyword,"#quartic_bond");
ff_bond.number_of_parameters = 4;
}
/* MORSE */
if (forcefield & FF_TYPE_CLASS1) {
ff_morse.number_of_members = 2;
strcpy(ff_morse.keyword,"#morse_bond");
ff_morse.number_of_parameters = 3;
}
/* ANGLE */
ff_ang.number_of_members = 3;
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
strcpy(ff_ang.keyword,"#quadratic_angle");
ff_ang.number_of_parameters = 2;
}
if (forcefield & FF_TYPE_CLASS2) {
strcpy(ff_ang.keyword,"#quartic_angle");
ff_ang.number_of_parameters = 4;
}
/* TORSION */
ff_tor.number_of_members = 4;
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
strcpy(ff_tor.keyword,"#torsion_1");
ff_tor.number_of_parameters = 3;
}
if (forcefield & FF_TYPE_CLASS2) {
strcpy(ff_tor.keyword,"#torsion_3");
ff_tor.number_of_parameters = 6;
}
/* OOP */
ff_oop.number_of_members = 4;
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) {
strcpy(ff_oop.keyword,"#out_of_plane");
ff_oop.number_of_parameters = 3;
}
if (forcefield & FF_TYPE_CLASS2) {
strcpy(ff_oop.keyword,"#wilson_out_of_plane");
ff_oop.number_of_parameters = 2;
}
if (forcefield & FF_TYPE_CLASS2) {
/* BOND-BOND */
strcpy(ff_bonbon.keyword,"#bond-bond");
ff_bonbon.number_of_members = 3;
ff_bonbon.number_of_parameters = 1;
/* BOND-ANGLE */
strcpy(ff_bonang.keyword,"#bond-angle");
ff_bonang.number_of_members = 3;
ff_bonang.number_of_parameters = 2;
/* ANGLE-TORSION */
strcpy(ff_angtor.keyword,"#angle-torsion_3");
ff_angtor.number_of_members = 4;
ff_angtor.number_of_parameters = 6;
/* ANGLE-ANGLE-TORSION */
strcpy(ff_angangtor.keyword,"#angle-angle-torsion_1");
ff_angangtor.number_of_members = 4;
ff_angangtor.number_of_parameters = 1;
/* END-BOND-TORSION */
strcpy(ff_endbontor.keyword,"#end_bond-torsion_3");
ff_endbontor.number_of_members = 4;
ff_endbontor.number_of_parameters = 6;
/* MID-BOND-TORSION */
strcpy(ff_midbontor.keyword,"#middle_bond-torsion_3");
ff_midbontor.number_of_members = 4;
ff_midbontor.number_of_parameters = 3;
/* ANGLE-ANGLE */
strcpy(ff_angang.keyword,"#angle-angle");
ff_angang.number_of_members = 4;
ff_angang.number_of_parameters = 1;
/* BOND-BOND-1-3 */
strcpy(ff_bonbon13.keyword,"#bond-bond_1_3");
ff_bonbon13.number_of_members = 4;
ff_bonbon13.number_of_parameters = 1;
}
}
This diff is collapsed.
TARGET = msi2lmp.exe
SRCS = msi2lmp.c \
ReadCarFile.c \
ReadMdfFile.c \
MakeLists.c \
ReadFrcFile.c \
InitializeItems.c \
SearchAndFill.c \
GetParameters.c \
CheckLists.c \
WriteDataFile.c
OBJS = $(SRCS:.c=.o)
HEADERS = msi2lmp.h Forcefield.h
CC = gcc
CFLAGS = -O -Wall -W -g
LDFLAGS =
FRCFILE = cvff.frc
FRCFILE2 = cff91.frc
README = README
MKFILE = Makefile
$(TARGET) : $(OBJS)
$(CC) $(LDFLAGS) $(CFLAGS) -o $(TARGET) $(OBJS) -lm
.c.o:
$(CC) $(CFLAGS) -c $<
clean:
rm -f $(OBJS) $(TARGET)
# dependencies
CheckLists.o: CheckLists.c msi2lmp.h
GetParameters.o: GetParameters.c msi2lmp.h Forcefield.h
InitializeItems.o: InitializeItems.c msi2lmp.h Forcefield.h
MakeLists.o: MakeLists.c msi2lmp.h
msi2lmp.o: msi2lmp.c msi2lmp.h
ReadCarFile.o: ReadCarFile.c msi2lmp.h
ReadFrcFile.o: ReadFrcFile.c msi2lmp.h Forcefield.h
ReadMdfFile.o: ReadMdfFile.c msi2lmp.h
SearchAndFill.o: SearchAndFill.c msi2lmp.h Forcefield.h
WriteDataFile.o: WriteDataFile.c msi2lmp.h Forcefield.h
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment