Commit 0db10f6c authored by Sunhwan Jo's avatar Sunhwan Jo
Browse files

add comment/modify test

- Test system is translated to the origin
- Energy is computed again after updating Gromacs input to reflect no-cutoff option (rcoulomb = rlist = rvdw = 0.0)
parent 25e253cf
...@@ -889,7 +889,10 @@ class GromacsTopFile(object): ...@@ -889,7 +889,10 @@ class GromacsTopFile(object):
q = float(params[4]) q = float(params[4])
if has_nbfix_terms: if has_nbfix_terms:
# when NBFIX term is found, add all possible nonbond atom pairs explicitly
if self._defaults[1] != '2': if self._defaults[1] != '2':
# CHARMM parameters are compatible with the Lorentz-Berthelot combination
# rule (type 2) and we will stick with that for simplicity.
raise NotImplemented raise NotImplemented
nb.addParticle(q, 1.0, 0.0) nb.addParticle(q, 1.0, 0.0)
atom_charges.append(q) atom_charges.append(q)
...@@ -1053,7 +1056,10 @@ class GromacsTopFile(object): ...@@ -1053,7 +1056,10 @@ class GromacsTopFile(object):
lj.setCutoffDistance(nonbondedCutoff) lj.setCutoffDistance(nonbondedCutoff)
if has_nbfix_terms: if has_nbfix_terms:
# when NBFIX term is found, add all possible nonbond atom pairs explicitly
if self._defaults[1] != '2': if self._defaults[1] != '2':
# CHARMM parameters are compatible with the Lorentz-Berthelot combination
# rule (type 2) and we will stick with that for simplicity.
raise NotImplemented raise NotImplemented
atom_nbfix_types = set([]) atom_nbfix_types = set([])
......
...@@ -164,9 +164,10 @@ class TestGromacsTopFile(unittest.TestCase): ...@@ -164,9 +164,10 @@ class TestGromacsTopFile(unittest.TestCase):
context = Context(system, VerletIntegrator(1*femtosecond), context = Context(system, VerletIntegrator(1*femtosecond),
Platform.getPlatformByName('Reference')) Platform.getPlatformByName('Reference'))
context.setPositions(gro.positions) context.setPositions(gro.positions)
context.computeVirtualSites()
ene = context.getState(getEnergy=True).getPotentialEnergy() ene = context.getState(getEnergy=True).getPotentialEnergy()
# the energy output is from gromacs and it only prints out 6 sig digits. # the energy output is from gromacs and it only prints out 6 sig digits.
self.assertAlmostEqual(ene.value_in_unit(kilojoules_per_mole), 187.559, places=3) self.assertAlmostEqual(ene.value_in_unit(kilojoules_per_mole), 1.88855e+02, places=3)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
......
GROwing Monsters And Cloning Shrimps Gnomes, ROck Monsters And Chili Sauce
26 26
1BEN CG 1 4.683 2.023 2.471 1BEN CG 1 0.052 -0.016 0.455
1BEN HG 2 4.695 2.020 2.579 1BEN HG 2 0.064 -0.020 0.563
1BEN CD1 3 4.635 1.911 2.403 1BEN CD1 3 0.004 -0.129 0.386
1BEN HD1 4 4.611 1.821 2.457 1BEN HD1 4 -0.020 -0.219 0.441
1BEN CD2 5 4.715 2.140 2.401 1BEN CD2 5 0.084 0.100 0.385
1BEN HD2 6 4.751 2.227 2.454 1BEN HD2 6 0.120 0.187 0.438
1BEN CE1 7 4.620 1.915 2.263 1BEN CE1 7 -0.012 -0.125 0.247
1BEN HE1 8 4.583 1.828 2.210 1BEN HE1 8 -0.048 -0.211 0.194
1BEN CE2 9 4.700 2.144 2.261 1BEN CE2 9 0.069 0.104 0.245
1BEN HE2 10 4.725 2.234 2.207 1BEN HE2 10 0.094 0.194 0.191
1BEN CZ 11 4.653 2.031 2.193 1BEN CZ 11 0.022 -0.008 0.177
1BEN HZ 12 4.642 2.035 2.086 1BEN HZ 12 0.011 -0.005 0.069
1BEN LPA 13 4.668 2.027 2.332 1BEN LPA 13 0.037 -0.012 0.316
1BEN CG 14 4.667 2.077 1.583 1BEN CG 14 0.036 0.038 -0.433
1BEN HG 15 4.723 2.096 1.493 1BEN HG 15 0.092 0.057 -0.523
1BEN CD1 16 4.577 1.970 1.588 1BEN CD1 16 -0.054 -0.070 -0.428
1BEN HD1 17 4.563 1.906 1.502 1BEN HD1 17 -0.068 -0.133 -0.515
1BEN CD2 18 4.683 2.160 1.695 1BEN CD2 18 0.052 0.120 -0.321
1BEN HD2 19 4.751 2.244 1.690 1BEN HD2 19 0.120 0.205 -0.326
1BEN CE1 20 4.504 1.945 1.705 1BEN CE1 20 -0.127 -0.095 -0.311
1BEN HE1 21 4.435 1.862 1.709 1BEN HE1 21 -0.196 -0.178 -0.307
1BEN CE2 22 4.612 2.134 1.813 1BEN CE2 22 -0.019 0.094 -0.203
1BEN HE2 23 4.627 2.197 1.900 1BEN HE2 23 -0.004 0.157 -0.116
1BEN CZ 24 4.523 2.026 1.818 1BEN CZ 24 -0.108 -0.014 -0.198
1BEN HZ 25 4.468 2.005 1.908 1BEN HZ 25 -0.163 -0.034 -0.108
1BEN LPA 26 4.595 2.052 1.700 1BEN LPA 26 -0.036 0.012 -0.316
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
...@@ -27,6 +27,10 @@ CG2R61 6 12.011000 0.000 A 0.355005321205 0.29288 ...@@ -27,6 +27,10 @@ CG2R61 6 12.011000 0.000 A 0.355005321205 0.29288
HGR61 1 1.008000 0.000 A 0.242003727796 0.12552 HGR61 1 1.008000 0.000 A 0.242003727796 0.12552
LP 0 0.000000 0.00 A 0.0 0.0 ; pram LP 0 0.000000 0.00 A 0.0 0.0 ; pram
; NBFIX for LP, rmin=1.2/2^(1/6), eps=4.184*.01
[ nonbond_params ]
LP LP 1 1.069078461768 0.041840000000 ; pram
[ bondtypes ] [ bondtypes ]
; i j func b0 kb ; i j func b0 kb
CG2R61 CG2R61 1 0.13750000 255224.00 CG2R61 CG2R61 1 0.13750000 255224.00
...@@ -160,15 +164,6 @@ BENX 3 ...@@ -160,15 +164,6 @@ BENX 3
; Vsite from funct a ; Vsite from funct a
13 1 11 1 0.500 13 1 11 1 0.500
[ atomtypes ]
;type atnum mass charge ? sigma epsilon
; special dummy-type particles
LP 0 0.000000 0.00 A 0.0 0.0 ; pram
; NBFIX for LP, rmin=1.2/2^(1/6), eps=4.184*.01
[ nonbond_params ]
LP LP 1 1.069078461768 0.041840000000 ; pram
[ system ] [ system ]
; Name ; Name
two benzene two benzene
......
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