[tests] Ignore boundary cells in divergence test for CenteredGrids
@@ -24,7 +24,10 @@ class FluidTest(TestCase):
for _ in range(2):
velocity += smoke * (0, 0.1) @ velocity
velocity, _ = fluid.make_incompressible(velocity)
- math.assert_close(divergence(velocity).values, 0, abs_tolerance=2e-5)
+ if grid_type == StaggeredGrid:
+ math.assert_close(0, divergence(velocity).values, abs_tolerance=2e-5)
+ else:
+ math.assert_close(0, field.pad(divergence(velocity), -1).values, abs_tolerance=2e-5)
if result is None:
result = velocity
else:
