Skip to content
Snippets Groups Projects
Commit bbc1da42 authored by Timothy A. Smith's avatar Timothy A. Smith
Browse files

add more values for Roe test -- exposed another bug

parent 49ca1d14
No related branches found
No related tags found
2 merge requests!10Roe tests,!8Test refactoring
......@@ -14,19 +14,29 @@ import setup_fixtures as setup
import kernel_fixtures as kernel
import comparison_fixtures as compare
def test_roe_uniform_grid(ctx_factory):
@pytest.mark.parametrize("states_str,fluxes_str,direction", [
("2 1,4 1,4 1,4 1,20 5.5", "4 1,11.2 2.6,8 1,8 1,46.4 7.1", "x"),
("2 1,4 1,4 1,4 1,20 5.5", "4 1,8 1,11.2 2.6,8 1,46.4 7.1", "y"),
("2 1,4 1,4 1,4 1,20 5.5", "4 1,8 1,8 1,11.2 2.6,46.4 7.1", "z"),
("1 2,-1 -4,-1 -4,-1 -4,5.5 20", "-1 -4,2.6 11.2,1 8,1 8,-7.1 -46.4", "x"),
("1 2,-1 -4,-1 -4,-1 -4,5.5 20", "-1 -4,1 8,2.6 11.2,1 8,-7.1 -46.4", "y"),
("1 2,-1 -4,-1 -4,-1 -4,5.5 20", "-1 -4,1 8,1 8,2.6 11.2,-7.1 -46.4", "z"),
("2 1,4 1,8 2,12 3,64 11", "4 1,11.2 2.6,16 2,24 3,134.4 12.6", "x"),
("2 1,4 1,8 2,12 3,64 11", "8 2,16 2,35.2 5.6,48 6,268.8 25.2", "y"),
("2 1,4 1,8 2,12 3,64 11", "12 3,24 3,48 6,75.2 10.6,403.2 37.8", "z")
])
def test_roe_uniform_grid(ctx_factory, states_str, fluxes_str, direction):
queue = device.get_queue(ctx_factory)
prg = program.get_weno()
params = setup.roe_params(nvars=5, ndim=3, direction="x")
states = setup.array_from_string("2 1,4 1,4 1,4 1,20 5.5")
params = setup.roe_params(nvars=5, ndim=3, direction=direction)
states = setup.array_from_string(states_str)
metrics_frozen = setup.identity(params.ndim)
R, Rinv, lam = kernel.roe_eigensystem(queue, prg, params, states, metrics_frozen)
compare.roe_identity(states, R, Rinv)
fluxes = setup.array_from_string("4 1,11.2 2.6,8 1,8 1,46.4 7.1")
fluxes = setup.array_from_string(fluxes_str)
compare.roe_property(states, fluxes, R, Rinv, lam)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment