MCPcopy Create free account
hub / github.com/DedalusProject/dedalus / test_vector_diffusion_ball

Function test_vector_diffusion_ball

dedalus/tests/test_ivp.py:56–78  ·  view source on GitHub ↗

Test that vector diffusion in the ball builds and runs.

(N, radius, dealias, dtype)

Source from the content-addressed store, hash-verified

54@pytest.mark.parametrize('dealias', [1])
55@pytest.mark.parametrize('dtype', [np.float64, np.complex128])
56def 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

Callers

nothing calls this directly

Calls 6

VectorFieldMethod · 0.80
FieldMethod · 0.80
add_equationMethod · 0.80
build_solverMethod · 0.80
build_ballFunction · 0.70
stepMethod · 0.45

Tested by

no test coverage detected