def test_escape_cube(): D = 400 v = 1 a = 0.1 r = sphere_vol_to_r(v) pores = points_on_cube_surface(1, r) t = escape(D, v, a, pores, shape='cube', dt=1e-6) assert t
def test_timeout_from_dt(): D = 400 v = 1 a = 0.1 r = sphere_vol_to_r(v) pores = points_on_cube_surface(1, r) t = escape(D, v, a, pores, shape='cube', max_steps=(1e3), dt=1) assert int(t) == 0
def test_avg_escape_sphere_time(): N = 50 D = 400 v = 1 a = 0.1 r = sphere_vol_to_r(v) pores = points_on_cube_surface(1, r) ts = np.mean([escape(D, v, a, pores, shape='cube') for _ in range(N)]) assert 0.01 < ts < 0.1
def test_points_in_cube(): assert in_cube(points_on_cube_surface(1, r=100)[0], r=1) == False
def test_ponts_on_cube_outside(): assert in_cube(points_on_cube_surface(P, V)[0], V - eps) == False
def test_ponts_on_cube_inside(): assert in_cube(points_on_cube_surface(P, V)[0], V + eps)