Test that vector diffusion in the ball builds and runs.
(N, radius, dealias, dtype)
| 54 | @pytest.mark.parametrize('dealias', [1]) |
| 55 | @pytest.mark.parametrize('dtype', [np.float64, np.complex128]) |
| 56 | def test_vector_diffusion_ball(N, radius, dealias, dtype): |
| 57 | """Test that vector diffusion in the ball builds and runs.""" |
| 58 | # Bases |
| 59 | c, d, b, phi, theta, r, x, y, z = build_ball(N, N, N, radius, dealias, dtype) |
| 60 | # Fields |
| 61 | A = d.VectorField(c, bases=b) |
| 62 | phi = d.Field(bases=b) |
| 63 | tau_A = d.VectorField(c, bases=b.surface) |
| 64 | Lift = lambda A: d3.Lift(A, b, -1) |
| 65 | # Problem |
| 66 | problem = d3.IVP([A, phi, tau_A], namespace=locals()) |
| 67 | problem.add_equation("div(A) = 0") |
| 68 | problem.add_equation("dt(A) - grad(phi) - lap(A) + Lift(tau_A) = 0") |
| 69 | problem.add_equation("angular(A(r=1), index=0) = 0") |
| 70 | problem.add_equation("phi(r=1) = 0") |
| 71 | # Solver |
| 72 | solver = problem.build_solver("RK111") |
| 73 | dt = 1e-5 |
| 74 | # Just check that it runs |
| 75 | iter = 5 |
| 76 | for i in range(iter): |
| 77 | solver.step(dt) |
| 78 | assert True # TODO: make quantitative test |
| 79 |
nothing calls this directly
no test coverage detected