1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
9 class bond_harmonic_tests (unittest
.TestCase
):
12 self
.polymer1
= dict(bond_len
=1.2, type=['A']*6 + ['B']*7 + ['A']*6, bond
="linear", count
=100);
13 self
.polymer2
= dict(bond_len
=1.2, type=['B']*4, bond
="linear", count
=10)
14 self
.polymers
= [self
.polymer1
, self
.polymer2
]
15 self
.box
= data
.boxdim(L
=35);
16 self
.separation
=dict(A
=0.35, B
=0.35)
17 init
.create_random_polymers(box
=self
.box
, polymers
=self
.polymers
, separation
=self
.separation
);
19 sorter
.set_params(grid
=8)
21 # test to see that se can create a force.constant
22 def test_create(self
):
25 # test setting coefficients
26 def test_set_coeff(self
):
27 harmonic
= bond
.harmonic();
28 harmonic
.bond_coeff
.set('polymer', k
=1.0, r0
=1.0)
30 integrate
.mode_standard(dt
=0.005);
34 # test coefficient not set checking
35 def test_set_coeff_fail(self
):
36 harmonic
= bond
.harmonic();
38 integrate
.mode_standard(dt
=0.005);
40 self
.assertRaises(RuntimeError, run
, 100);
46 if __name__
== '__main__':
47 unittest
.main(argv
= ['test.py', '-v'])