def test_runge_kutta_4(self): domain = Domain(x=4, y=3) points = domain.distribute_points(domain.bounds, points_per_cell=2) v = domain.vector_grid(Noise(vector=2)) field.assert_close(points, advect.runge_kutta_4(points, v, 0), advect.runge_kutta_4(points, v * 0, 0)) sv = domain.staggered_grid(Noise()) field.assert_close(points, advect.runge_kutta_4(points, sv, 0), advect.runge_kutta_4(points, sv * 0, 0))
def test_advect_points(self): domain = Domain(x=4, y=3) v = domain.distribute_points(domain.bounds, points_per_cell=2) * (1, -1) field.assert_close(v, advect.points(v, v, 0), advect.points(v, v * 0, 0))