Commit 25e253cf authored by Sunhwan Jo's avatar Sunhwan Jo
Browse files

add test case for virtual site/nbfix

parent 1d6bfef4
...@@ -151,6 +151,23 @@ class TestGromacsTopFile(unittest.TestCase): ...@@ -151,6 +151,23 @@ class TestGromacsTopFile(unittest.TestCase):
totalMass2 = sum([system2.getParticleMass(i) for i in range(system2.getNumParticles())]).value_in_unit(amu) totalMass2 = sum([system2.getParticleMass(i) for i in range(system2.getNumParticles())]).value_in_unit(amu)
self.assertAlmostEqual(totalMass1, totalMass2) self.assertAlmostEqual(totalMass1, totalMass2)
def test_VirtualParticle(self):
"""Test virtual particle works correctly."""
top = GromacsTopFile('systems/bnz.top')
gro = GromacsGroFile('systems/bnz.gro')
system = top.createSystem()
self.assertEqual(26, system.getNumParticles())
self.assertEqual(1, len(top._moleculeTypes['BENX'].vsites2))
context = Context(system, VerletIntegrator(1*femtosecond),
Platform.getPlatformByName('Reference'))
context.setPositions(gro.positions)
ene = context.getState(getEnergy=True).getPotentialEnergy()
# 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)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
GROwing Monsters And Cloning Shrimps
26
1BEN CG 1 4.683 2.023 2.471
1BEN HG 2 4.695 2.020 2.579
1BEN CD1 3 4.635 1.911 2.403
1BEN HD1 4 4.611 1.821 2.457
1BEN CD2 5 4.715 2.140 2.401
1BEN HD2 6 4.751 2.227 2.454
1BEN CE1 7 4.620 1.915 2.263
1BEN HE1 8 4.583 1.828 2.210
1BEN CE2 9 4.700 2.144 2.261
1BEN HE2 10 4.725 2.234 2.207
1BEN CZ 11 4.653 2.031 2.193
1BEN HZ 12 4.642 2.035 2.086
1BEN LPA 13 4.668 2.027 2.332
1BEN CG 14 4.667 2.077 1.583
1BEN HG 15 4.723 2.096 1.493
1BEN CD1 16 4.577 1.970 1.588
1BEN HD1 17 4.563 1.906 1.502
1BEN CD2 18 4.683 2.160 1.695
1BEN HD2 19 4.751 2.244 1.690
1BEN CE1 20 4.504 1.945 1.705
1BEN HE1 21 4.435 1.862 1.709
1BEN CE2 22 4.612 2.134 1.813
1BEN HE2 23 4.627 2.197 1.900
1BEN CZ 24 4.523 2.026 1.818
1BEN HZ 25 4.468 2.005 1.908
1BEN LPA 26 4.595 2.052 1.700
0.00000 0.00000 0.00000
;
; File '6lyz_gmx.top' was generated
; By user: sunhwan (40816)
; On host: kuta
; At date: Fri Nov 10 13:02:26 2017
;
; This is a standalone topology file
;
; Created by:
; :-) GROMACS - gmx pdb2gmx, 2017-dev-20170822-762c6f0 (-:
;
; Executable: /home/sunhwan/local/gromacs/src/gromacs/build/bin/gmx
; Data prefix: /home/sunhwan/local/gromacs/src/gromacs (source tree)
; Working dir: /data/sunhwan/work/lysozyme/1_setup
; Command line:
; gmx pdb2gmx -f 6lyz_4pdb2gmx.pdb -o 6lyz_gmx.pdb -p 6lyz_gmx.top -ff charmm36 -water tip3p -ter -merge all
; Force field was read from current directory or a relative path - path added.
;
[ defaults ]
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ
1 2 yes 1.0 1.0
[ atomtypes ]
;type atnum mass charge ? sigma epsilon
CG2R61 6 12.011000 0.000 A 0.355005321205 0.29288
HGR61 1 1.008000 0.000 A 0.242003727796 0.12552
LP 0 0.000000 0.00 A 0.0 0.0 ; pram
[ bondtypes ]
; i j func b0 kb
CG2R61 CG2R61 1 0.13750000 255224.00
CG2R61 HGR61 1 0.10800000 284512.00
[ angletypes ]
; i j k func theta0 ktheta ub0 kub
CG2R61 CG2R61 CG2R61 5 120.000000 334.720000 0.24162000 29288.00
CG2R61 CG2R61 HGR61 5 120.000000 251.040000 0.21525000 18409.60
[ dihedraltypes ]
; i j k l func phi0 kphi mult
CG2R61 CG2R61 CG2R61 CG2R61 9 180.000000 12.970400 2
CG2R61 CG2R61 CG2R61 HGR61 9 180.000000 17.572800 2
HGR61 CG2R61 CG2R61 HGR61 9 180.000000 10.041600 2
[ dihedraltypes ]
; 'improper' dihedrals
; i j k l func phi0 kphi
[ moleculetype ]
; Name nrexcl
BENX 3
[ atoms ]
; nr type resnr residue atom cgnr charge mass typeB chargeB massB
; residue 1 BENX rtp BENX q 0.0
1 CG2R61 1 BENX CG 1 -0.115 12.011 ; qtot -0.115
2 HGR61 1 BENX HG 1 0.115 1.008 ; qtot 0
3 CG2R61 1 BENX CD1 1 -0.115 12.011 ; qtot -0.115
4 HGR61 1 BENX HD1 1 0.115 1.008 ; qtot 0
5 CG2R61 1 BENX CD2 1 -0.115 12.011 ; qtot -0.115
6 HGR61 1 BENX HD2 1 0.115 1.008 ; qtot 0
7 CG2R61 1 BENX CE1 1 -0.115 12.011 ; qtot -0.115
8 HGR61 1 BENX HE1 1 0.115 1.008 ; qtot 0
9 CG2R61 1 BENX CE2 1 -0.115 12.011 ; qtot -0.115
10 HGR61 1 BENX HE2 1 0.115 1.008 ; qtot 0
11 CG2R61 1 BENX CZ 1 -0.115 12.011 ; qtot -0.115
12 HGR61 1 BENX HZ 1 0.115 1.008 ; qtot 0
13 LP 1 BENX LPA 1 0.000 0.000 ; qtot 0
[ bonds ]
; ai aj funct c0 c1 c2 c3
1 2 1
1 3 1
1 5 1
3 4 1
3 7 1
5 6 1
5 9 1
7 8 1
7 11 1
9 10 1
9 11 1
11 12 1
[ pairs ]
; ai aj funct c0 c1 c2 c3
1 8 1
1 10 1
1 11 1
2 4 1
2 6 1
2 7 1
2 9 1
3 6 1
3 9 1
3 12 1
4 5 1
4 8 1
4 11 1
5 7 1
5 12 1
6 10 1
6 11 1
7 10 1
8 9 1
8 12 1
10 12 1
[ angles ]
; ai aj ak funct c0 c1 c2 c3
2 1 3 5
2 1 5 5
3 1 5 5
1 3 4 5
1 3 7 5
4 3 7 5
1 5 6 5
1 5 9 5
6 5 9 5
3 7 8 5
3 7 11 5
8 7 11 5
5 9 10 5
5 9 11 5
10 9 11 5
7 11 9 5
7 11 12 5
9 11 12 5
[ dihedrals ]
; ai aj ak al funct c0 c1 c2 c3 c4 c5
2 1 3 4 9
2 1 3 7 9
5 1 3 4 9
5 1 3 7 9
2 1 5 6 9
2 1 5 9 9
3 1 5 6 9
3 1 5 9 9
1 3 7 8 9
1 3 7 11 9
4 3 7 8 9
4 3 7 11 9
1 5 9 10 9
1 5 9 11 9
6 5 9 10 9
6 5 9 11 9
3 7 11 9 9
3 7 11 12 9
8 7 11 9 9
8 7 11 12 9
5 9 11 7 9
5 9 11 12 9
10 9 11 7 9
10 9 11 12 9
[ virtual_sites2 ]
; Vsite from funct a
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 ]
; Name
two benzene
[ molecules ]
; Compound #mols
BENX 2
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