ForceBalance API
1.3
Automated optimization of force fields and empirical potentials
|
Finite state machine for parsing TINKER force field files. More...
Public Member Functions | |
def | __init__ (self, fnm) |
def | feed (self, line) |
Given a line, determine the interaction type and the atoms involved (the suffix). More... | |
Public Attributes | |
pdict | |
The parameter dictionary (defined in this file) More... | |
atom | |
The atom numbers in the interaction (stored in the TINKER parser) More... | |
itype | |
suffix | |
Finite state machine for parsing TINKER force field files.
This class is instantiated when we begin to read in a file. The feed(line) method updates the state of the machine, informing it of the current interaction type. Using this information we can look up the interaction type and parameter type for building the parameter ID.
Definition at line 97 of file tinkerio.py.
def src.tinkerio.Tinker_Reader.__init__ | ( | self, | |
fnm | |||
) |
Definition at line 99 of file tinkerio.py.
def src.tinkerio.Tinker_Reader.feed | ( | self, | |
line | |||
) |
Given a line, determine the interaction type and the atoms involved (the suffix).
TINKER generally has stuff like this:
bond-cubic -2.55 bond-quartic 3.793125 vdw 1 3.4050 0.1100 vdw 2 2.6550 0.0135 0.910 # PRM 4 multipole 2 1 2 0.25983 -0.03859 0.00000 -0.05818 -0.03673 0.00000 -0.10739 -0.00203 0.00000 0.14412
The '#PRM 4' has no effect on TINKER but it indicates that we are tuning the fourth field on the line (the 0.910 value).
Every parameter line is prefaced by the interaction type except for 'multipole' which is on multiple lines. Because the lines that come after 'multipole' are predictable, we just determine the current line using the previous line. Random note: Unit of force is kcal / mole / angstrom squared.
Definition at line 140 of file tinkerio.py.
src.tinkerio.Tinker_Reader.atom |
The atom numbers in the interaction (stored in the TINKER parser)
Definition at line 104 of file tinkerio.py.
src.tinkerio.Tinker_Reader.itype |
Definition at line 148 of file tinkerio.py.
src.tinkerio.Tinker_Reader.pdict |
The parameter dictionary (defined in this file)
Definition at line 102 of file tinkerio.py.
src.tinkerio.Tinker_Reader.suffix |
Definition at line 170 of file tinkerio.py.