Skip to content
Snippets Groups Projects

WIP: Resolve "WENO flux contains bug"

Merged Timothy Smith requested to merge 19-weno-flux-contains-bug into consistent-part-test
+ 88
0
@@ -98,6 +98,94 @@ def test_consistent_part_uniform_grid(
u.compare_arrays(consistent_dev.get(), consistent_expected)
@pytest.mark.parametrize(("char_fluxes_str,combined_metric,"
"R_str,dissipation_expected_str"), [
(("1.09071563 1.23015152 1.23015152 7.52305259 0.232956271,"
"0.467376796 -0.6627417 -0.6627417 1.47953026 0.312527304"),
1.0,
("1 0 0 0.45781246 0.45781246,"
"1.58578644 0 0 1.43309957 0.0188860081,"
"1.58578644 1.41421356 0 0.725992789 0.725992789,"
"1.58578644 0 1.41421356 0.725992789 0.725992789,"
"3.77207794 2.24264069 2.24264069 5.57860029 3.3359596"),
"1.67685514 4.82397437 3.99761177 3.99761177 22.1451964"),
(("0.0672231577 0.248528137 0.248528137 0.374562227 0.107250611,"
"0.168354897 -0.0585786438 -0.0585786438 0.306026299 0.727493464"),
1.0,
("1 0 0 0.45781246 0.45781246,"
"-1.58578644 0 0 -0.0188860081 -1.43309957,"
"-1.58578644 1.41421356 0 -0.725992789 -0.725992789,"
"-1.58578644 0 1.41421356 -0.725992789 -0.725992789,"
"3.77207794 -2.24264069 -2.24264069 3.3359596 5.57860029"),
"-0.17685508 0.523974175 0.497611669 0.497611669 -2.49519635")
])
def test_dissipation_part_pos_uniform_grid(
ctx_factory, char_fluxes_str, combined_metric, R_str,
dissipation_expected_str):
prg = u.get_weno_program_with_root_kernel("dissipation_part_pos")
queue = u.get_queue(ctx_factory)
nvars = 5
char_fluxes = u.expand_to_6(
u.transposed_array_from_string(char_fluxes_str))
R = u.array_from_string(R_str)
dissipation_dev = u.empty_array_on_device(queue, nvars)
prg(queue, nvars=nvars,
characteristic_fluxes=char_fluxes,
combined_frozen_metrics=combined_metric,
R=R,
dissipation_pos=dissipation_dev)
dissipation_expected = u.array_from_string(dissipation_expected_str)
u.compare_arrays(dissipation_dev.get(), dissipation_expected)
@pytest.mark.parametrize(("char_fluxes_str,combined_metric,"
"R_str,dissipation_expected_str"), [
(("-0.168354897 -0.0585786438 -0.0585786438 -0.727493464 -0.306026299,"
"-0.0672231577 0.248528137 0.248528137 -0.107250611 -0.374562227"),
1.0,
("1 0 0 0.45781246 0.45781246,"
"1.58578644 0 0 1.43309957 0.0188860081,"
"1.58578644 1.41421356 0 0.725992789 0.725992789,"
"1.58578644 0 1.41421356 0.725992789 0.725992789,"
"3.77207794 2.24264069 2.24264069 5.57860029 3.3359596"),
"0.17685508 0.523974175 0.497611669 0.497611669 2.49519635"),
(("-0.467376796 -0.6627417 -0.6627417 -0.312527304 -1.47953026,"
"-1.09071563 1.23015152 1.23015152 -0.232956271 -7.52305259"),
1.0,
("1 0 0 0.45781246 0.45781246,"
"-1.58578644 0 0 -0.0188860081 -1.43309957,"
"-1.58578644 1.41421356 0 -0.725992789 -0.725992789,"
"-1.58578644 0 1.41421356 -0.725992789 -0.725992789,"
"3.77207794 -2.24264069 -2.24264069 3.3359596 5.57860029"),
"-1.67685514 4.82397437 3.99761177 3.99761177 -22.1451964")
])
def test_dissipation_part_neg_uniform_grid(
ctx_factory, char_fluxes_str, combined_metric, R_str,
dissipation_expected_str):
prg = u.get_weno_program_with_root_kernel("dissipation_part_neg")
queue = u.get_queue(ctx_factory)
nvars = 5
char_fluxes = u.expand_to_6(
u.transposed_array_from_string(char_fluxes_str))
R = u.array_from_string(R_str)
dissipation_dev = u.empty_array_on_device(queue, nvars)
prg(queue, nvars=nvars,
characteristic_fluxes=char_fluxes,
combined_frozen_metrics=combined_metric,
R=R,
dissipation_neg=dissipation_dev)
dissipation_expected = u.array_from_string(dissipation_expected_str)
u.compare_arrays(dissipation_dev.get(), dissipation_expected)
@pytest.mark.slow
@pytest.mark.parametrize(("states_str,fluxes_str,R_inv_str,wavespeeds_str,"
"fluxes_pos_expected_str,fluxes_neg_expected_str"), [
Loading