Commit feee6d25 authored by Jason Swails's avatar Jason Swails
Browse files

Make NBFIX ordering consistent.

parent d47cb004
...@@ -446,10 +446,10 @@ class CharmmParameterSet(object): ...@@ -446,10 +446,10 @@ class CharmmParameterSet(object):
except IndexError: except IndexError:
emin14 = rmin14 = None emin14 = rmin14 = None
try: try:
self.atom_types_str[at1].add_nbfix(at2, emin, rmin, self.atom_types_str[at1].add_nbfix(at2, rmin, emin,
emin14, rmin14) rmin14, emin14)
self.atom_types_str[at2].add_nbfix(at1, emin, rmin, self.atom_types_str[at2].add_nbfix(at1, rmin, emin,
emin14, rmin14) rmin14, emin14)
except KeyError: except KeyError:
# Some stream files define NBFIX terms with an atom that # Some stream files define NBFIX terms with an atom that
# is defined in another toppar file that does not # is defined in another toppar file that does not
...@@ -460,7 +460,7 @@ class CharmmParameterSet(object): ...@@ -460,7 +460,7 @@ class CharmmParameterSet(object):
pass pass
except IndexError: except IndexError:
raise CharmmFileError('Could not parse NBFIX terms.') raise CharmmFileError('Could not parse NBFIX terms.')
self.nbfix_types[(min(at1, at2), max(at1, at2))] = (emin, rmin) self.nbfix_types[(min(at1, at2), max(at1, at2))] = (rmin, emin)
# Now we're done. Load the nonbonded types into the relevant AtomType # Now we're done. Load the nonbonded types into the relevant AtomType
# instances. In order for this to work, all keys in nonbonded_types # instances. In order for this to work, all keys in nonbonded_types
# must be in the self.atom_types_str dict. Raise a RuntimeError if this # must be in the self.atom_types_str dict. Raise a RuntimeError if this
......
...@@ -1294,7 +1294,7 @@ class CharmmPsfFile(object): ...@@ -1294,7 +1294,7 @@ class CharmmPsfFile(object):
for j in range(num_lj_types): for j in range(num_lj_types):
namej = lj_type_list[j].name namej = lj_type_list[j].name
try: try:
wdij, rij, wdij14, rij14 = lj_type_list[i].nbfix[namej] rij, wdij, rij14, wdij14 = lj_type_list[i].nbfix[namej]
except KeyError: except KeyError:
rij = (lj_radii[i] + lj_radii[j]) * length_conv rij = (lj_radii[i] + lj_radii[j]) * length_conv
wdij = sqrt(lj_depths[i] * lj_depths[j]) * ene_conv wdij = sqrt(lj_depths[i] * lj_depths[j]) * ene_conv
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment