Skip to content

Commit

Permalink
tree open remove
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed Jan 1, 2025
1 parent 314cdd1 commit d09d63b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions rebound/tests/test_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
class TestBoundary(unittest.TestCase):

def test_open(self):
sim = rebound.Simulation()
sim.boundary = "open"
sim.configure_box(10.)
sim.add(m=0.1,x=1., vx=5.0)
sim.add(m=0.1,x=-1., vx=-5.0)
sim.add(m=0.1,y=1., vx=6.0)
sim.add(m=0.1,x=-1., y=-1., vx=-3., vy=-3.)
sim.add(m=0.1,z=1., vz=5.0)
sim.add(m=0.1,z=-1., vz=-5.0)
self.assertEqual(sim.N,6)
sim.integrate(1.)
self.assertEqual(sim.N,1)
with self.assertRaises(rebound.NoParticles):
sim.integrate(2.)
for gravity in ["basic", "tree"]:
sim = rebound.Simulation()
sim.boundary = "open"
sim.gravity = gravity
sim.configure_box(10.)
sim.add(m=0.1,x=1., vx=5.0)
sim.add(m=0.1,x=-1., vx=-5.0)
sim.add(m=0.1,y=1., vx=6.0)
sim.add(m=0.1,x=-1., y=-1., vx=-3., vy=-3.)
sim.add(m=0.1,z=1., vz=5.0)
sim.add(m=0.1,z=-1., vz=-5.0)
self.assertEqual(sim.N,6)
sim.integrate(1.)
self.assertEqual(sim.N,1)
with self.assertRaises(rebound.NoParticles):
sim.integrate(2.)

def test_periodic(self):
sim = rebound.Simulation()
Expand Down

0 comments on commit d09d63b

Please sign in to comment.