Skip to content

Commit 6dd98e8

Browse files
added butadiene and isoprene trappe tests
1 parent 2a84d17 commit 6dd98e8

File tree

6 files changed

+85
-1
lines changed

6 files changed

+85
-1
lines changed

foyer/forcefields/trappe-ua.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
<!-- maerzke T4.8 C=C-C=C -->
208208
<Proper type1="CH2_sp2" type2="CH_sp2-Csp2" type3="CH_sp2-Csp2" type4="CH2_sp2" c0="-28.85375" c1="7.05523" c2="-33.6714" c3="-15.29994" c4="13.06235" c5="0.0"/>
209209
<!-- maerzke T4.9 CH2=CH-C(sp2)-CH3 isoprene -->
210-
<Proper type1="CH2_sp2" type2="CH_sp2-Csp2" type3="C_sp2-Csp2" type4="CH3_sp3" c0="-23.21439" c1="-11.57082" c2="-9.59522" c3="19.30751" c4="-7.84353" c5="0.0"/>
210+
<Proper type1="CH2_sp2" type2="CH_sp2-Csp2" type3="C_sp2-Csp2" type4="CH3_sp3" c0="-25.17527" c1="-11.57082" c2="-25.28228" c3="19.30751" c4="7.84353" c5="0.0"/>
211211
<!--
212212
No parameters for CHX-[CH2]-[CH]-OH, CHX-[CH2]-[C]-OH, CHX-[CH]-[CH2]-OH,
213213
CHX-[CH]-[CH]-OH, CHX-[CH]-[C]-OH, CHX-[C]-[CH2]-OH, CHX-[C]-[CH]-OH,

foyer/tests/test_trappe.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,16 @@ def check_dihedrals(ref, struc):
219219
for ref_d in ref_dihedrals:
220220
_, desc, _, *params = ref_d.strip().split(',')
221221
i, j, k, l = map(int, desc.strip("\"\'").split('-'))
222+
if l < i:
223+
i, j, k, l = l, k, j, i
222224

223225
foyer_d = dih_dict[i, j, k, l]
224226

225227
assert_dihedrals_match(foyer_d, params)
226228

227229
@pytest.mark.parametrize('trappe_ref,mol2file', [
230+
('butadiene/trappe_parameters_94.csv', 'butadiene'),
231+
('isoprene/trappe_parameters_95.csv', 'isoprene'),
228232
('methyl_acrylate/trappe_parameters_96.csv', 'methyl_acrylate'),
229233
], indirect=True)
230234
def test_trappe_reference(self, trappe_ref, mol2file):
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@<TRIPOS>MOLECULE
2+
RES
3+
4 3 1 0 1
4+
SMALL
5+
NO_CHARGES
6+
@<TRIPOS>CRYSIN
7+
9.5000 5.0000 5.0000 90.0000 90.0000 90.0000 1 1
8+
@<TRIPOS>ATOM
9+
1 _CH2 0.0000 0.0000 0.0000 CH2_sp2 1 RES
10+
2 _HC 1.5000 0.0000 0.0000 CH_sp2-Csp2 1 RES
11+
3 _HC 3.0000 0.0000 0.0000 CH_sp2-Csp2 1 RES
12+
4 _CH2 4.5000 0.0000 0.0000 CH2_sp2 1 RES
13+
@<TRIPOS>BOND
14+
1 1 2 1
15+
2 2 3 1
16+
3 3 4 1
17+
@<TRIPOS>SUBSTRUCTURE
18+
1 RES 1 RESIDUE 0 1 ROOT 0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"1,3-butadiene"
2+
3+
#,(pseudo)atom,type,"epsilon/kB [K]","sigma [Ang.]","charge [e]"
4+
1,CH2,[CH2]=CHx,85.0,3.675,0.000
5+
4,CH2,[CH2]=CHx,85.0,3.675,0.000
6+
2,CH,CHx=[CH](sp2)-CHy(sp2),52.0,3.710,0.000
7+
3,CH,CHx=[CH](sp2)-CHy(sp2),52.0,3.710,0.000
8+
9+
#,stretch,type,"length [Ang.]"
10+
1,"'1 - 2'",CHx=CHy,1.3300
11+
2,"'2 - 3'",CHx-CHy,1.5400
12+
3,"'3 - 4'",CHx=CHy,1.3300
13+
14+
#,bend,type,"theta [degrees]","k_theta/kB [K/rad^2]"
15+
1,"'1 - 2 - 3'",CHx=(CH)-CHx,119.70,70420
16+
2,"'2 - 3 - 4'",CHx=(CH)-CHx,119.70,70420
17+
18+
#,torsion,type,"c0/kB [K]","c1/kB [K]","c2/kB [K]","c3/kB [K]","c4/kB [K]"
19+
1,"'1 - 2 - 3 - 4'",CH2=(CH)-(CH)=CH2,2034.58,531.57,-1239.35,460.04,196.38
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@<TRIPOS>MOLECULE
2+
RES
3+
5 4 1 0 1
4+
SMALL
5+
NO_CHARGES
6+
@<TRIPOS>CRYSIN
7+
9.5000 6.5000 5.0000 90.0000 90.0000 90.0000 1 1
8+
@<TRIPOS>ATOM
9+
1 _CH2 3.0000 1.5000 0.0000 CH2_sp2 1 RES
10+
2 C 3.0000 0.0000 0.0000 C_sp2-Csp2 1 RES
11+
3 _HC 1.5000 0.0000 0.0000 CH_sp2-Csp2 1 RES
12+
4 _CH2 0.0000 0.0000 0.0000 CH2_sp2 1 RES
13+
5 _CH3 4.5000 0.0000 0.0000 CH3_sp3 1 RES
14+
@<TRIPOS>BOND
15+
1 2 1 1
16+
2 2 5 1
17+
3 3 2 1
18+
4 4 3 1
19+
@<TRIPOS>SUBSTRUCTURE
20+
1 RES 1 RESIDUE 0 1 ROOT 0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
isoprene
2+
3+
#,(pseudo)atom,type,"epsilon/kB [K]","sigma [Ang.]","charge [e]"
4+
5,CH3,[CH3]-CHx,98.0,3.750,0.000
5+
1,CH2,[CH2]=CHx,85.0,3.675,0.000
6+
4,CH2,[CH2]=CHx,85.0,3.675,0.000
7+
3,CH,CHx=[CH](sp2)-CHy(sp2),52.0,3.710,0.000
8+
2,C,CHx=[C](sp2)-CHy(sp2),22.0,3.850,0.000
9+
10+
#,stretch,type,"length [Ang.]"
11+
1,"'1 - 2'",CHx=CHy,1.3300
12+
2,"'2 - 3'",CHx-CHy,1.5400
13+
3,"'2 - 5'",CHx-CHy,1.5400
14+
4,"'3 - 4'",CHx=CHy,1.3300
15+
16+
#,bend,type,"theta [degrees]","k_theta/kB [K/rad^2]"
17+
1,"'1 - 2 - 3'",CHx=(C)-CHy,119.70,70420
18+
2,"'1 - 2 - 5'",CHx=(C)-CHy,119.70,70420
19+
3,"'2 - 3 - 4'",CHx=(CH)-CHx,119.70,70420
20+
4,"'3 - 2 - 5'",CHx-(C)[=CHz]-CHy,119.70,70420
21+
22+
#,torsion,type,"c0/kB [K]","c1/kB [K]","c2/kB [K]","c3/kB [K]","c4/kB [K]"
23+
2,"'5 - 2 - 3 - 4'",CH2=(CH)-(C)[=CHx]-CH3,1861.27,-349.97,-1048.70,-580.54,117.92

0 commit comments

Comments
 (0)