"docs-source/vscode:/vscode.git/clone" did not exist on "adfd84c27330f99c59a9e1c510c07473a7ac8a9b"
Unverified Commit 014797f4 authored by Agilio Padua's avatar Agilio Padua Committed by GitHub
Browse files

Read E14FAC Coulomb 1-4 scaling factor in CHARMM files (#3038)

* Update charmmparameterset.py

* Update charmmpsffile.py
parent 79460bf6
...@@ -116,6 +116,7 @@ class CharmmParameterSet(object): ...@@ -116,6 +116,7 @@ class CharmmParameterSet(object):
self.nbthole_types = dict() self.nbthole_types = dict()
self.parametersets = [] self.parametersets = []
self.nbxmod = 5 self.nbxmod = 5
self.e14fac = 1.0
# Load all of the files # Load all of the files
tops, pars, strs = [], [], [] tops, pars, strs = [], [], []
...@@ -273,6 +274,8 @@ class CharmmParameterSet(object): ...@@ -273,6 +274,8 @@ class CharmmParameterSet(object):
if nbxmod not in list(range(-5, 6)): if nbxmod not in list(range(-5, 6)):
raise CharmmFileError('Unsupported value for NBXMOD: %d' % nbxmod) raise CharmmFileError('Unsupported value for NBXMOD: %d' % nbxmod)
self.nbxmod = nbxmod self.nbxmod = nbxmod
if 'E14FAC' in fields:
self.e14fac = float(fields[fields.index('E14FAC')+1])
continue continue
if line.startswith('NBFIX'): if line.startswith('NBFIX'):
section = 'NBFIX' section = 'NBFIX'
......
...@@ -1384,7 +1384,7 @@ class CharmmPsfFile(object): ...@@ -1384,7 +1384,7 @@ class CharmmPsfFile(object):
for ia1, ia4 in self.pair_14_list: for ia1, ia4 in self.pair_14_list:
atom1 = self.atom_list[ia1] atom1 = self.atom_list[ia1]
atom4 = self.atom_list[ia4] atom4 = self.atom_list[ia4]
charge_prod = (atom1.charge * atom4.charge) charge_prod = (atom1.charge * atom4.charge) * params.e14fac
epsilon = sqrt(abs(atom1.type.epsilon_14 * atom4.type.epsilon_14)) * ene_conv epsilon = sqrt(abs(atom1.type.epsilon_14 * atom4.type.epsilon_14)) * ene_conv
sigma = (atom1.type.rmin_14 + atom4.type.rmin_14) * (length_conv * sigma_scale) sigma = (atom1.type.rmin_14 + atom4.type.rmin_14) * (length_conv * sigma_scale)
force.addException(ia1, ia4, charge_prod, sigma, epsilon) force.addException(ia1, ia4, charge_prod, sigma, epsilon)
......
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