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

for uniform grid, combined_metric is always 1 so it shouldn't be an argument

parent 0fbd04f4
No related branches found
No related tags found
2 merge requests!29Data fixtures,!28WENO flux bug
......@@ -19,13 +19,12 @@ from input import data
@pytest.mark.parametrize(("gen_fluxes_str,char_fluxes_pos_str,char_fluxes_neg_str,"
"combined_metric,R_str,flux_expected_str"), [
"R_str,flux_expected_str"), [
("4 11.2 8 8 46.4,1 2.6 1 1 7.1",
("1.09071563 1.23015152 1.23015152 7.52305259 0.232956271,"
"0.467376796 -0.6627417 -0.6627417 1.47953026 0.312527304"),
("-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,"
......@@ -37,7 +36,6 @@ from input import data
"0.168354897 -0.0585786438 -0.0585786438 0.306026299 0.727493464"),
("-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,"
......@@ -47,7 +45,7 @@ from input import data
])
def test_weno_flux_uniform_grid(
ctx_factory, gen_fluxes_str, char_fluxes_pos_str, char_fluxes_neg_str,
combined_metric, R_str, flux_expected_str):
R_str, flux_expected_str):
prg = u.get_weno_program_with_root_kernel("weno_flux")
queue = u.get_queue(ctx_factory)
......@@ -66,7 +64,7 @@ def test_weno_flux_uniform_grid(
generalized_fluxes=gen_fluxes,
characteristic_fluxes_pos=char_fluxes_pos,
characteristic_fluxes_neg=char_fluxes_neg,
combined_frozen_metrics=combined_metric,
combined_frozen_metrics=1.0,
R=R,
flux=flux_dev)
......@@ -99,11 +97,10 @@ def test_consistent_part_uniform_grid(
u.compare_arrays(consistent_dev.get(), consistent_expected)
@pytest.mark.parametrize(("char_fluxes_str,combined_metric,"
@pytest.mark.parametrize(("char_fluxes_str,"
"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,"
......@@ -112,7 +109,6 @@ def test_consistent_part_uniform_grid(
"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,"
......@@ -121,8 +117,7 @@ def test_consistent_part_uniform_grid(
"-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):
ctx_factory, char_fluxes_str, R_str, dissipation_expected_str):
prg = u.get_weno_program_with_root_kernel("dissipation_part_pos")
queue = u.get_queue(ctx_factory)
......@@ -135,7 +130,7 @@ def test_dissipation_part_pos_uniform_grid(
prg(queue, nvars=nvars,
characteristic_fluxes=char_fluxes,
combined_frozen_metrics=combined_metric,
combined_frozen_metrics=1.0,
R=R,
dissipation_pos=dissipation_dev)
......@@ -143,10 +138,9 @@ def test_dissipation_part_pos_uniform_grid(
u.compare_arrays(dissipation_dev.get(), dissipation_expected)
@pytest.mark.parametrize(("char_fluxes_str,combined_metric,weights_expected_str"), [
@pytest.mark.parametrize(("char_fluxes_str,weights_expected_str"), [
(("1.09071563 1.23015152 1.23015152 7.52305259 0.232956271,"
"0.467376796 -0.6627417 -0.6627417 1.47953026 0.312527304"),
1.0,
("0.999999998 1. 1. 1. 0.999990928,"
"2.23542587e-9 2.62886024e-11 2.62886024e-11 2.52995663e-13 "
"8.39888392e-6,"
......@@ -154,7 +148,7 @@ def test_dissipation_part_pos_uniform_grid(
"6.7286569e-7"))
])
def test_weno_weights_pos_uniform_grid(
ctx_factory, char_fluxes_str, combined_metric, weights_expected_str):
ctx_factory, char_fluxes_str, weights_expected_str):
prg = u.get_weno_program_with_root_kernel("weno_weights_pos")
queue = u.get_queue(ctx_factory)
......@@ -166,18 +160,17 @@ def test_weno_weights_pos_uniform_grid(
prg(queue, nvars=nvars,
characteristic_fluxes=char_fluxes,
combined_frozen_metrics=combined_metric,
combined_frozen_metrics=1.0,
w=weights_dev)
weights_expected = u.transposed_array_from_string(weights_expected_str)
u.compare_arrays(weights_dev.get(), weights_expected)
@pytest.mark.parametrize(("char_fluxes_str,combined_metric,"
@pytest.mark.parametrize(("char_fluxes_str,"
"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,"
......@@ -186,7 +179,6 @@ def test_weno_weights_pos_uniform_grid(
"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,"
......@@ -195,8 +187,7 @@ def test_weno_weights_pos_uniform_grid(
"-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):
ctx_factory, char_fluxes_str, R_str, dissipation_expected_str):
prg = u.get_weno_program_with_root_kernel("dissipation_part_neg")
queue = u.get_queue(ctx_factory)
......@@ -209,7 +200,7 @@ def test_dissipation_part_neg_uniform_grid(
prg(queue, nvars=nvars,
characteristic_fluxes=char_fluxes,
combined_frozen_metrics=combined_metric,
combined_frozen_metrics=1.0,
R=R,
dissipation_neg=dissipation_dev)
......@@ -217,16 +208,15 @@ def test_dissipation_part_neg_uniform_grid(
u.compare_arrays(dissipation_dev.get(), dissipation_expected)
@pytest.mark.parametrize(("char_fluxes_str,combined_metric,weights_expected_str"), [
@pytest.mark.parametrize(("char_fluxes_str,weights_expected_str"), [
(("-0.168354897 -0.0585786438 -0.0585786438 -0.727493464 -0.306026299,"
"-0.0672231577 0.248528137 0.248528137 -0.107250611 -0.374562227"),
1.0,
("0.99999652 0.999999959 0.999999959 0.999999998 0.99998353,"
"3.22170414e-6 3.79356095e-8 3.79356095e-8 2.28039336e-9 0.0000152478162,"
"2.57963115e-7 3.03513836e-9 3.03513836e-9 1.82435737e-10 1.22216217e-6"))
])
def test_weno_weights_neg_uniform_grid(
ctx_factory, char_fluxes_str, combined_metric, weights_expected_str):
ctx_factory, char_fluxes_str, weights_expected_str):
prg = u.get_weno_program_with_root_kernel("weno_weights_neg")
queue = u.get_queue(ctx_factory)
......@@ -238,7 +228,7 @@ def test_weno_weights_neg_uniform_grid(
prg(queue, nvars=nvars,
characteristic_fluxes=char_fluxes,
combined_frozen_metrics=combined_metric,
combined_frozen_metrics=1.0,
w=weights_dev)
weights_expected = u.transposed_array_from_string(weights_expected_str)
......
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