From 7d485182b5bd3f1c90f36f1d52e453f993a48614 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Wed, 17 Jul 2019 12:24:37 -0500 Subject: [PATCH 01/60] remove xfail marks so we know when bug is fixed --- test.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test.py b/test.py index 878e48c..fde5322 100644 --- a/test.py +++ b/test.py @@ -17,7 +17,6 @@ from pyopencl.tools import ( # noqa import utilities as u -@pytest.mark.xfail @pytest.mark.parametrize(("gen_fluxes_str,char_fluxes_pos_str,char_fluxes_neg_str," "combined_metric,R_str,flux_expected_str"), [ ("4 11.2 8 8 46.4,1 2.6 1 1 7.1", @@ -74,7 +73,6 @@ def test_weno_flux_uniform_grid( u.compare_arrays(flux_dev.get(), flux_expected) -@pytest.mark.xfail @pytest.mark.parametrize(("gen_fluxes_str,consistent_expected_str"), [ ("4 11.2 8 8 46.4,1 2.6 1 1 7.1", "2.5 6.9 4.5 4.5 26.75"), @@ -100,7 +98,6 @@ def test_consistent_part_uniform_grid( u.compare_arrays(consistent_dev.get(), consistent_expected) -@pytest.mark.xfail @pytest.mark.parametrize(("char_fluxes_str,combined_metric," "R_str,dissipation_expected_str"), [ (("1.09071563 1.23015152 1.23015152 7.52305259 0.232956271," @@ -145,7 +142,6 @@ def test_dissipation_part_pos_uniform_grid( u.compare_arrays(dissipation_dev.get(), dissipation_expected) -@pytest.mark.xfail @pytest.mark.parametrize(("char_fluxes_str,combined_metric," "R_str,dissipation_expected_str"), [ (("-0.168354897 -0.0585786438 -0.0585786438 -0.727493464 -0.306026299," -- GitLab From 44c9122b7e04ee8ae816c8a3f79e23ac03bcb833 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 20 Jul 2019 16:23:06 -0500 Subject: [PATCH 02/60] added test for WENO weights (positive direction) --- test.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/test.py b/test.py index fde5322..4311695 100644 --- a/test.py +++ b/test.py @@ -17,6 +17,7 @@ from pyopencl.tools import ( # noqa import utilities as u +@pytest.mark.slow @pytest.mark.parametrize(("gen_fluxes_str,char_fluxes_pos_str,char_fluxes_neg_str," "combined_metric,R_str,flux_expected_str"), [ ("4 11.2 8 8 46.4,1 2.6 1 1 7.1", @@ -73,6 +74,7 @@ def test_weno_flux_uniform_grid( u.compare_arrays(flux_dev.get(), flux_expected) +@pytest.mark.slow @pytest.mark.parametrize(("gen_fluxes_str,consistent_expected_str"), [ ("4 11.2 8 8 46.4,1 2.6 1 1 7.1", "2.5 6.9 4.5 4.5 26.75"), @@ -98,6 +100,7 @@ def test_consistent_part_uniform_grid( u.compare_arrays(consistent_dev.get(), consistent_expected) +@pytest.mark.slow @pytest.mark.parametrize(("char_fluxes_str,combined_metric," "R_str,dissipation_expected_str"), [ (("1.09071563 1.23015152 1.23015152 7.52305259 0.232956271," @@ -142,6 +145,45 @@ 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"), [ + (("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," + "1.78838212e-10 2.10309347e-12 2.10309347e-12 2.0239658e-14 " + "6.7286569e-7")), + #(("0.0672231577 0.248528137 0.248528137 0.374562227 0.107250611," + # "0.168354897 -0.0585786438 -0.0585786438 0.306026299 0.727493464"), + # 1.0, + # ("0.99999652 0.999999959 0.999999959 0.99998353 0.999999998," + # "3.22170414e-6 3.79356095e-8 3.79356095e-8 0.0000152478162 " + # "2.28039336e-9," + # "2.57963115e-7 3.03513836e-9 3.03513836e-9 1.22216217e-6 " + # "1.82435737e-10")) + ]) +def test_weno_weights_pos_uniform_grid( + ctx_factory, char_fluxes_str, combined_metric, weights_expected_str): + prg = u.get_weno_program_with_root_kernel("weno_weights_pos") + queue = u.get_queue(ctx_factory) + + nvars = 5 + + char_fluxes = u.expand_to_6( + u.transposed_array_from_string(char_fluxes_str)) + weights_dev = u.empty_array_on_device(queue, nvars, 3) + + prg(queue, nvars=nvars, + characteristic_fluxes=char_fluxes, + combined_frozen_metrics=combined_metric, + w=weights_dev) + + weights_expected = u.transposed_array_from_string(weights_expected_str) + u.compare_arrays(weights_dev.get(), weights_expected) + + +@pytest.mark.slow @pytest.mark.parametrize(("char_fluxes_str,combined_metric," "R_str,dissipation_expected_str"), [ (("-0.168354897 -0.0585786438 -0.0585786438 -0.727493464 -0.306026299," -- GitLab From eb52be62bfa226609e2332092addfca58e0a4319 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 20 Jul 2019 16:23:33 -0500 Subject: [PATCH 03/60] bugfix in WENO weight computation --- WENO.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WENO.F90 b/WENO.F90 index 200d3a9..f849285 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -846,7 +846,7 @@ subroutine weno_weights_neg(nvars, characteristic_fluxes, combined_frozen_metric real :: C(3) = (/0.1, 0.6, 0.3/) real :: weights1(0:2) = (/1, -4, 3/) real :: weights2(0:2) = (/-1, 0, 1/) - real :: weights3(0:2) = (/-3, 4, 1/) + real :: weights3(0:2) = (/-3, 4, -1/) real :: weightsc(0:2) = (/1, -2, 1/) real IS(3), alpha(3), eps -- GitLab From 2415cd2d0bf3833889932bb166ac5f4b3ef5ab4a Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 20 Jul 2019 16:57:54 -0500 Subject: [PATCH 04/60] another bugfix in WENO weights --- WENO.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WENO.F90 b/WENO.F90 index f849285..88f4837 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -743,7 +743,7 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric real :: C(3) = (/0.1, 0.6, 0.3/) real :: weights1(0:2) = (/1, -4, 3/) real :: weights2(0:2) = (/-1, 0, 1/) - real :: weights3(0:2) = (/-3, 4, 1/) + real :: weights3(0:2) = (/-3, 4, -1/) real :: weightsc(0:2) = (/1, -2, 1/) real IS(3), alpha(3), eps -- GitLab From 7f57c25ed3607993a1f728f27f32958237963e1a Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 20 Jul 2019 17:10:29 -0500 Subject: [PATCH 05/60] loosen absolute tolerance since small values in single precision might still be large --- utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities.py b/utilities.py index cce3804..f7579ef 100644 --- a/utilities.py +++ b/utilities.py @@ -11,7 +11,7 @@ from pytest import approx # {{{ arrays def compare_arrays(a, b): - assert a == approx(b, rel=1e-5) + assert a == approx(b, rel=1e-5, abs=1e-5) def random_array_on_device(queue, *shape): -- GitLab From 7ec7556ec548dea4e81cca3a6abbfe90ac15260a Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 20 Jul 2019 17:11:19 -0500 Subject: [PATCH 06/60] rewrite oscillation indicator computation for weno_weights_pos -- fixes bug --- WENO.F90 | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index 88f4837..b6bc335 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -757,16 +757,26 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric p = 2 do i=1,nvars - call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) - call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) - call weighted_sum(3, weights2, characteristic_fluxes(i,-1:1), w2sum) - call weighted_sum(3, weightsc, characteristic_fluxes(i,-1:1), c2sum) - call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) - call weighted_sum(3, weightsc, characteristic_fluxes(i,0:2), c3sum) - - IS(1) = (1.0/4)*w1sum(1)**2 + (13.0/12)*c1sum(1)**2 - IS(2) = (1.0/4)*w2sum(1)**2 + (13.0/12)*c2sum(1)**2 - IS(3) = (1.0/4)*w3sum(1)**2 + (13.0/12)*c3sum(1)**2 + IS(1) = (1.0/4)*(characteristic_fluxes(i,-2) - 4*characteristic_fluxes(i,-1) & + + 3*characteristic_fluxes(i,0))**2 + (13.0/12)*(characteristic_fluxes(i,-2) & + - 2*characteristic_fluxes(i,-1) + characteristic_fluxes(i,0))**2 + IS(2) = (1.0/4)*(-characteristic_fluxes(i,-1) - characteristic_fluxes(i,1))**2 & + + (13.0/12)*(characteristic_fluxes(i,-1) & + - 2*characteristic_fluxes(i,0) + characteristic_fluxes(i,1))**2 + IS(3) = (1.0/4)*(-3*characteristic_fluxes(i,0) + 4*characteristic_fluxes(i,1) & + - characteristic_fluxes(i,2))**2 + (13.0/12)*(characteristic_fluxes(i,0) & + - 2*characteristic_fluxes(i,1) + characteristic_fluxes(i,2))**2 + + !call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) + !call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) + !call weighted_sum(3, weights2, characteristic_fluxes(i,-1:1), w2sum) + !call weighted_sum(3, weightsc, characteristic_fluxes(i,-1:1), c2sum) + !call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) + !call weighted_sum(3, weightsc, characteristic_fluxes(i,0:2), c3sum) + + !IS(1) = (1.0/4)*w1sum(1)**2 + (13.0/12)*c1sum(1)**2 + !IS(2) = (1.0/4)*w2sum(1)**2 + (13.0/12)*c2sum(1)**2 + !IS(3) = (1.0/4)*w3sum(1)**2 + (13.0/12)*c3sum(1)**2 do j=1,3 alpha(j) = C(j)/(IS(j) + eps)**p -- GitLab From fef702ec550f25f5e48cd8476f7ae3bcd9299384 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 20 Jul 2019 17:20:36 -0500 Subject: [PATCH 07/60] added new test for negative direction WENO weights, increase tolerance as necessary --- test.py | 38 +++++++++++++++++++++++++++++--------- utilities.py | 2 +- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/test.py b/test.py index 4311695..2167109 100644 --- a/test.py +++ b/test.py @@ -153,15 +153,7 @@ def test_dissipation_part_pos_uniform_grid( "2.23542587e-9 2.62886024e-11 2.62886024e-11 2.52995663e-13 " "8.39888392e-6," "1.78838212e-10 2.10309347e-12 2.10309347e-12 2.0239658e-14 " - "6.7286569e-7")), - #(("0.0672231577 0.248528137 0.248528137 0.374562227 0.107250611," - # "0.168354897 -0.0585786438 -0.0585786438 0.306026299 0.727493464"), - # 1.0, - # ("0.99999652 0.999999959 0.999999959 0.99998353 0.999999998," - # "3.22170414e-6 3.79356095e-8 3.79356095e-8 0.0000152478162 " - # "2.28039336e-9," - # "2.57963115e-7 3.03513836e-9 3.03513836e-9 1.22216217e-6 " - # "1.82435737e-10")) + "6.7286569e-7")) ]) def test_weno_weights_pos_uniform_grid( ctx_factory, char_fluxes_str, combined_metric, weights_expected_str): @@ -228,6 +220,34 @@ 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"), [ + (("-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): + prg = u.get_weno_program_with_root_kernel("weno_weights_neg") + queue = u.get_queue(ctx_factory) + + nvars = 5 + + char_fluxes = u.expand_to_6( + u.transposed_array_from_string(char_fluxes_str)) + weights_dev = u.empty_array_on_device(queue, nvars, 3) + + prg(queue, nvars=nvars, + characteristic_fluxes=char_fluxes, + combined_frozen_metrics=combined_metric, + w=weights_dev) + + weights_expected = u.transposed_array_from_string(weights_expected_str) + u.compare_arrays(weights_dev.get(), weights_expected) + + @pytest.mark.slow @pytest.mark.parametrize(("states_str,fluxes_str,R_inv_str,wavespeeds_str," "fluxes_pos_expected_str,fluxes_neg_expected_str"), [ diff --git a/utilities.py b/utilities.py index f7579ef..129680a 100644 --- a/utilities.py +++ b/utilities.py @@ -11,7 +11,7 @@ from pytest import approx # {{{ arrays def compare_arrays(a, b): - assert a == approx(b, rel=1e-5, abs=1e-5) + assert a == approx(b, rel=1e-5, abs=2e-5) def random_array_on_device(queue, *shape): -- GitLab From 446d4b9ea27844483ff1427ace1ea7823f3a7e64 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 20 Jul 2019 17:22:20 -0500 Subject: [PATCH 08/60] stop skipping WENO flux related tests --- test.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test.py b/test.py index 2167109..d4477df 100644 --- a/test.py +++ b/test.py @@ -17,7 +17,6 @@ from pyopencl.tools import ( # noqa import utilities as u -@pytest.mark.slow @pytest.mark.parametrize(("gen_fluxes_str,char_fluxes_pos_str,char_fluxes_neg_str," "combined_metric,R_str,flux_expected_str"), [ ("4 11.2 8 8 46.4,1 2.6 1 1 7.1", @@ -74,7 +73,6 @@ def test_weno_flux_uniform_grid( u.compare_arrays(flux_dev.get(), flux_expected) -@pytest.mark.slow @pytest.mark.parametrize(("gen_fluxes_str,consistent_expected_str"), [ ("4 11.2 8 8 46.4,1 2.6 1 1 7.1", "2.5 6.9 4.5 4.5 26.75"), @@ -100,7 +98,6 @@ def test_consistent_part_uniform_grid( u.compare_arrays(consistent_dev.get(), consistent_expected) -@pytest.mark.slow @pytest.mark.parametrize(("char_fluxes_str,combined_metric," "R_str,dissipation_expected_str"), [ (("1.09071563 1.23015152 1.23015152 7.52305259 0.232956271," @@ -175,7 +172,6 @@ def test_weno_weights_pos_uniform_grid( u.compare_arrays(weights_dev.get(), weights_expected) -@pytest.mark.slow @pytest.mark.parametrize(("char_fluxes_str,combined_metric," "R_str,dissipation_expected_str"), [ (("-0.168354897 -0.0585786438 -0.0585786438 -0.727493464 -0.306026299," -- GitLab From d25dd2d2ad66926806aab6796dd6df94e50fd71f Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sun, 21 Jul 2019 13:30:30 -0500 Subject: [PATCH 09/60] remove 'slow' marks from most parametrized tests --- test.py | 55 ++++++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/test.py b/test.py index d4477df..d117069 100644 --- a/test.py +++ b/test.py @@ -244,7 +244,6 @@ def test_weno_weights_neg_uniform_grid( u.compare_arrays(weights_dev.get(), weights_expected) -@pytest.mark.slow @pytest.mark.parametrize(("states_str,fluxes_str,R_inv_str,wavespeeds_str," "fluxes_pos_expected_str,fluxes_neg_expected_str"), [ ("2 4 4 4 20,1 1 1 1 5.5", "4 11.2 8 8 46.4,1 2.6 1 1 7.1", @@ -313,33 +312,6 @@ def test_flux_splitting_uniform_grid( u.compare_arrays(fluxes_neg_dev.get(), fluxes_neg_expected) -@pytest.mark.slow -@pytest.mark.parametrize("lam_pointwise_str,lam_roe_str,lam_expected_str", [ - ("1 2 3 4 5,2 4 6 8 10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), - ("1 2 3 4 5,-2 -4 -6 -8 -10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), - ("1 2 3 4 5,-2 -4 -6 -8 -10", "3 6 9 12 15", "3.3 6.6 9.9 13.2 16.5"), - ("1 2 3 4 5,2 4 6 8 10", "-3 -6 -9 -12 -15", "3.3 6.6 9.9 13.2 16.5"), - ("3 2 9 4 5,2 6 6 12 10", "-1 -4 -3 -8 -15", "3.3 6.6 9.9 13.2 16.5") - ]) -def test_lax_wavespeeds( - ctx_factory, lam_pointwise_str, lam_roe_str, lam_expected_str): - prg = u.get_weno_program_with_root_kernel("lax_wavespeeds") - queue = u.get_queue(ctx_factory) - - nvars = 5 - - lam_pointwise = u.expand_to_6(u.transposed_array_from_string(lam_pointwise_str)) - lam_roe = u.array_from_string(lam_roe_str) - lam_dev = u.empty_array_on_device(queue, nvars) - - prg(queue, nvars=nvars, lambda_pointwise=lam_pointwise, - lambda_roe=lam_roe, wavespeeds=lam_dev) - - lam_expected = u.array_from_string(lam_expected_str) - u.compare_arrays(lam_dev.get(), lam_expected) - - -@pytest.mark.slow @pytest.mark.parametrize("states_str,direction,lam_expected_str", [ ("2 4 4 4 20,1 1 1 1 5.5", "x", "2 2 2 3.49666295 0.503337045,1 1 1 2.49666295 -0.496662955"), @@ -384,7 +356,6 @@ def test_pointwise_eigenvalues_ideal_gas( u.compare_arrays(lam_dev.get(), lam_expected) -@pytest.mark.slow @pytest.mark.parametrize("states_str,fluxes_str,direction", [ ("2 4 4 4 20,1 1 1 1 5.5", "4 11.2 8 8 46.4,1 2.6 1 1 7.1", "x"), ("2 4 4 4 20,1 1 1 1 5.5", "4 8 11.2 8 46.4,1 1 2.6 1 7.1", "y"), @@ -444,6 +415,32 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, states_str, fluxes_str, directi check_roe_property(states, fluxes, R, R_inv, lam) +@pytest.mark.slow +@pytest.mark.parametrize("lam_pointwise_str,lam_roe_str,lam_expected_str", [ + ("1 2 3 4 5,2 4 6 8 10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), + ("1 2 3 4 5,-2 -4 -6 -8 -10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), + ("1 2 3 4 5,-2 -4 -6 -8 -10", "3 6 9 12 15", "3.3 6.6 9.9 13.2 16.5"), + ("1 2 3 4 5,2 4 6 8 10", "-3 -6 -9 -12 -15", "3.3 6.6 9.9 13.2 16.5"), + ("3 2 9 4 5,2 6 6 12 10", "-1 -4 -3 -8 -15", "3.3 6.6 9.9 13.2 16.5") + ]) +def test_lax_wavespeeds( + ctx_factory, lam_pointwise_str, lam_roe_str, lam_expected_str): + prg = u.get_weno_program_with_root_kernel("lax_wavespeeds") + queue = u.get_queue(ctx_factory) + + nvars = 5 + + lam_pointwise = u.expand_to_6(u.transposed_array_from_string(lam_pointwise_str)) + lam_roe = u.array_from_string(lam_roe_str) + lam_dev = u.empty_array_on_device(queue, nvars) + + prg(queue, nvars=nvars, lambda_pointwise=lam_pointwise, + lambda_roe=lam_roe, wavespeeds=lam_dev) + + lam_expected = u.array_from_string(lam_expected_str) + u.compare_arrays(lam_dev.get(), lam_expected) + + @pytest.mark.slow def test_matvec(ctx_factory): prg = u.get_weno_program_with_root_kernel("mult_mat_vec") -- GitLab From 8245de8336ff53a7406b3e7149ed78e353e6461c Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sun, 21 Jul 2019 23:32:58 -0500 Subject: [PATCH 10/60] introduce first version of fixture to replace parametrization --- test.py | 111 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 80 insertions(+), 31 deletions(-) diff --git a/test.py b/test.py index d117069..995067a 100644 --- a/test.py +++ b/test.py @@ -356,21 +356,78 @@ def test_pointwise_eigenvalues_ideal_gas( u.compare_arrays(lam_dev.get(), lam_expected) -@pytest.mark.parametrize("states_str,fluxes_str,direction", [ - ("2 4 4 4 20,1 1 1 1 5.5", "4 11.2 8 8 46.4,1 2.6 1 1 7.1", "x"), - ("2 4 4 4 20,1 1 1 1 5.5", "4 8 11.2 8 46.4,1 1 2.6 1 7.1", "y"), - ("2 4 4 4 20,1 1 1 1 5.5", "4 8 8 11.2 46.4,1 1 1 2.6 7.1", "z"), - ("1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", "x"), - ("1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", "y"), - ("1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", "z"), - ("2 4 8 12 64,1 1 2 3 11", "4 11.2 16 24 134.4,1 2.6 2 3 12.6", "x"), - ("2 4 8 12 64,1 1 2 3 11", "8 16 35.2 48 268.8,2 2 5.6 6 25.2", "y"), - ("2 4 8 12 64,1 1 2 3 11", "12 24 48 75.2 403.2,3 3 6 10.6 37.8", "z"), - ("1 -1 -2 -3 11,2 -4 -8 -12 64", "-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", "x"), - ("1 -1 -2 -3 11,2 -4 -8 -12 64", "-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", "y"), - ("1 -1 -2 -3 11,2 -4 -8 -12 64", "-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", "z") - ]) -def test_roe_uniform_grid_ideal_gas(ctx_factory, states_str, fluxes_str, direction): +class FluxDataSingle: + nvars = 5 + ndim = 3 + dirs = {"x": 1, "y": 2, "z": 3} + + def __init__(self, states_str, fluxes_str, direction): + self.states = u.transposed_array_from_string(states_str) + self.fluxes = u.transposed_array_from_string(fluxes_str) + self.direction = self.dirs[direction] + + +uniformData = {} +uniformData["Case a:x"] = FluxDataSingle( + "2 4 4 4 20,1 1 1 1 5.5", + "4 11.2 8 8 46.4,1 2.6 1 1 7.1", + "x") +uniformData["Case a:y"] = FluxDataSingle( + "2 4 4 4 20,1 1 1 1 5.5", + "4 8 11.2 8 46.4,1 1 2.6 1 7.1", + "y") +uniformData["Case a:z"] = FluxDataSingle( + "2 4 4 4 20,1 1 1 1 5.5", + "4 8 8 11.2 46.4,1 1 1 2.6 7.1", + "z") +uniformData["Case b:x"] = FluxDataSingle( + "1 -1 -1 -1 5.5,2 -4 -4 -4 20", + "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + "x") +uniformData["Case b:y"] = FluxDataSingle( + "1 -1 -1 -1 5.5,2 -4 -4 -4 20", + "-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", + "y") +uniformData["Case b:z"] = FluxDataSingle( + "1 -1 -1 -1 5.5,2 -4 -4 -4 20", + "-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", + "z") +uniformData["Case c:x"] = FluxDataSingle( + "2 4 8 12 64,1 1 2 3 11", + "4 11.2 16 24 134.4,1 2.6 2 3 12.6", + "x") +uniformData["Case c:y"] = FluxDataSingle( + "2 4 8 12 64,1 1 2 3 11", + "8 16 35.2 48 268.8,2 2 5.6 6 25.2", + "y") +uniformData["Case c:z"] = FluxDataSingle( + "2 4 8 12 64,1 1 2 3 11", + "12 24 48 75.2 403.2,3 3 6 10.6 37.8", + "z") +uniformData["Case d:x"] = FluxDataSingle( + "1 -1 -2 -3 11,2 -4 -8 -12 64", + "-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", + "x") +uniformData["Case d:y"] = FluxDataSingle( + "1 -1 -2 -3 11,2 -4 -8 -12 64", + "-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", + "y") +uniformData["Case d:z"] = FluxDataSingle( + "1 -1 -2 -3 11,2 -4 -8 -12 64", + "-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", + "z") + + +@pytest.fixture(params=[ + "Case a:x", "Case a:y", "Case a:z", + "Case b:x", "Case b:y", "Case b:z", + "Case c:x", "Case c:y", "Case c:z", + "Case d:x", "Case d:y", "Case d:z"]) +def data(request): + return uniformData[request.param] + + +def test_roe_uniform_grid_ideal_gas(ctx_factory, data): def identity_matrix(n): return np.identity(n).astype(np.float32).copy(order="F") @@ -389,30 +446,22 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, states_str, fluxes_str, directi prg = u.get_weno_program_with_root_kernel("roe_eigensystem") queue = u.get_queue(ctx_factory) - nvars = 5 - ndim = 3 - dirs = {"x": 1, "y": 2, "z": 3} + metrics_frozen = identity_matrix(data.ndim) - states = u.transposed_array_from_string(states_str) - fluxes = u.transposed_array_from_string(fluxes_str) - metrics_frozen = identity_matrix(ndim) + R_dev = u.empty_array_on_device(queue, data.nvars, data.nvars) + R_inv_dev = u.empty_array_on_device(queue, data.nvars, data.nvars) + lam_dev = u.empty_array_on_device(queue, data.nvars) - R_dev = u.empty_array_on_device(queue, nvars, nvars) - R_inv_dev = u.empty_array_on_device(queue, nvars, nvars) - lam_dev = u.empty_array_on_device(queue, nvars) - - prg(queue, nvars=nvars, ndim=ndim, d=dirs[direction], - states=states, metrics_frozen=metrics_frozen, + prg(queue, nvars=data.nvars, ndim=data.ndim, d=data.direction, + states=data.states, metrics_frozen=metrics_frozen, R=R_dev, R_inv=R_inv_dev, lambda_roe=lam_dev) R = R_dev.get() R_inv = R_inv_dev.get() lam = lam_dev.get() - print(lam) - - check_roe_identity(states, R, R_inv) - check_roe_property(states, fluxes, R, R_inv, lam) + check_roe_identity(data.states, R, R_inv) + check_roe_property(data.states, data.fluxes, R, R_inv, lam) @pytest.mark.slow -- GitLab From 44d8265a9b3884990e3bcb478246f4fd9587ae3d Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sun, 21 Jul 2019 23:40:07 -0500 Subject: [PATCH 11/60] move data fixture stuff to input.py --- input.py | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ test.py | 72 +---------------------------------------------------- 2 files changed, 76 insertions(+), 71 deletions(-) create mode 100644 input.py diff --git a/input.py b/input.py new file mode 100644 index 0000000..7f808dc --- /dev/null +++ b/input.py @@ -0,0 +1,75 @@ +import pytest +import utilities as u + + +class FluxDataSingle: + nvars = 5 + ndim = 3 + dirs = {"x": 1, "y": 2, "z": 3} + + def __init__(self, states_str, fluxes_str, direction): + self.states = u.transposed_array_from_string(states_str) + self.fluxes = u.transposed_array_from_string(fluxes_str) + self.direction = self.dirs[direction] + + +uniformData = {} +uniformData["Case a:x"] = FluxDataSingle( + "2 4 4 4 20,1 1 1 1 5.5", + "4 11.2 8 8 46.4,1 2.6 1 1 7.1", + "x") +uniformData["Case a:y"] = FluxDataSingle( + "2 4 4 4 20,1 1 1 1 5.5", + "4 8 11.2 8 46.4,1 1 2.6 1 7.1", + "y") +uniformData["Case a:z"] = FluxDataSingle( + "2 4 4 4 20,1 1 1 1 5.5", + "4 8 8 11.2 46.4,1 1 1 2.6 7.1", + "z") +uniformData["Case b:x"] = FluxDataSingle( + "1 -1 -1 -1 5.5,2 -4 -4 -4 20", + "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + "x") +uniformData["Case b:y"] = FluxDataSingle( + "1 -1 -1 -1 5.5,2 -4 -4 -4 20", + "-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", + "y") +uniformData["Case b:z"] = FluxDataSingle( + "1 -1 -1 -1 5.5,2 -4 -4 -4 20", + "-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", + "z") +uniformData["Case c:x"] = FluxDataSingle( + "2 4 8 12 64,1 1 2 3 11", + "4 11.2 16 24 134.4,1 2.6 2 3 12.6", + "x") +uniformData["Case c:y"] = FluxDataSingle( + "2 4 8 12 64,1 1 2 3 11", + "8 16 35.2 48 268.8,2 2 5.6 6 25.2", + "y") +uniformData["Case c:z"] = FluxDataSingle( + "2 4 8 12 64,1 1 2 3 11", + "12 24 48 75.2 403.2,3 3 6 10.6 37.8", + "z") +uniformData["Case d:x"] = FluxDataSingle( + "1 -1 -2 -3 11,2 -4 -8 -12 64", + "-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", + "x") +uniformData["Case d:y"] = FluxDataSingle( + "1 -1 -2 -3 11,2 -4 -8 -12 64", + "-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", + "y") +uniformData["Case d:z"] = FluxDataSingle( + "1 -1 -2 -3 11,2 -4 -8 -12 64", + "-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", + "z") + + +@pytest.fixture(scope="session", params=[ + "Case a:x", "Case a:y", "Case a:z", + "Case b:x", "Case b:y", "Case b:z", + "Case c:x", "Case c:y", "Case c:z", + "Case d:x", "Case d:y", "Case d:z"]) +def data(request): + return uniformData[request.param] + + diff --git a/test.py b/test.py index 995067a..6b7d044 100644 --- a/test.py +++ b/test.py @@ -15,6 +15,7 @@ from pyopencl.tools import ( # noqa as pytest_generate_tests) import utilities as u +from input import data @pytest.mark.parametrize(("gen_fluxes_str,char_fluxes_pos_str,char_fluxes_neg_str," @@ -356,77 +357,6 @@ def test_pointwise_eigenvalues_ideal_gas( u.compare_arrays(lam_dev.get(), lam_expected) -class FluxDataSingle: - nvars = 5 - ndim = 3 - dirs = {"x": 1, "y": 2, "z": 3} - - def __init__(self, states_str, fluxes_str, direction): - self.states = u.transposed_array_from_string(states_str) - self.fluxes = u.transposed_array_from_string(fluxes_str) - self.direction = self.dirs[direction] - - -uniformData = {} -uniformData["Case a:x"] = FluxDataSingle( - "2 4 4 4 20,1 1 1 1 5.5", - "4 11.2 8 8 46.4,1 2.6 1 1 7.1", - "x") -uniformData["Case a:y"] = FluxDataSingle( - "2 4 4 4 20,1 1 1 1 5.5", - "4 8 11.2 8 46.4,1 1 2.6 1 7.1", - "y") -uniformData["Case a:z"] = FluxDataSingle( - "2 4 4 4 20,1 1 1 1 5.5", - "4 8 8 11.2 46.4,1 1 1 2.6 7.1", - "z") -uniformData["Case b:x"] = FluxDataSingle( - "1 -1 -1 -1 5.5,2 -4 -4 -4 20", - "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", - "x") -uniformData["Case b:y"] = FluxDataSingle( - "1 -1 -1 -1 5.5,2 -4 -4 -4 20", - "-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", - "y") -uniformData["Case b:z"] = FluxDataSingle( - "1 -1 -1 -1 5.5,2 -4 -4 -4 20", - "-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", - "z") -uniformData["Case c:x"] = FluxDataSingle( - "2 4 8 12 64,1 1 2 3 11", - "4 11.2 16 24 134.4,1 2.6 2 3 12.6", - "x") -uniformData["Case c:y"] = FluxDataSingle( - "2 4 8 12 64,1 1 2 3 11", - "8 16 35.2 48 268.8,2 2 5.6 6 25.2", - "y") -uniformData["Case c:z"] = FluxDataSingle( - "2 4 8 12 64,1 1 2 3 11", - "12 24 48 75.2 403.2,3 3 6 10.6 37.8", - "z") -uniformData["Case d:x"] = FluxDataSingle( - "1 -1 -2 -3 11,2 -4 -8 -12 64", - "-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", - "x") -uniformData["Case d:y"] = FluxDataSingle( - "1 -1 -2 -3 11,2 -4 -8 -12 64", - "-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", - "y") -uniformData["Case d:z"] = FluxDataSingle( - "1 -1 -2 -3 11,2 -4 -8 -12 64", - "-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", - "z") - - -@pytest.fixture(params=[ - "Case a:x", "Case a:y", "Case a:z", - "Case b:x", "Case b:y", "Case b:z", - "Case c:x", "Case c:y", "Case c:z", - "Case d:x", "Case d:y", "Case d:z"]) -def data(request): - return uniformData[request.param] - - def test_roe_uniform_grid_ideal_gas(ctx_factory, data): def identity_matrix(n): return np.identity(n).astype(np.float32).copy(order="F") -- GitLab From 0fbd04f474dc7b0490f7ab4295f7c1924ff5b564 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sun, 21 Jul 2019 23:41:38 -0500 Subject: [PATCH 12/60] rename data storage dictionary --- input.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/input.py b/input.py index 7f808dc..38b7118 100644 --- a/input.py +++ b/input.py @@ -13,52 +13,52 @@ class FluxDataSingle: self.direction = self.dirs[direction] -uniformData = {} -uniformData["Case a:x"] = FluxDataSingle( +singleData = {} +singleData["Case a:x"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 11.2 8 8 46.4,1 2.6 1 1 7.1", "x") -uniformData["Case a:y"] = FluxDataSingle( +singleData["Case a:y"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 8 11.2 8 46.4,1 1 2.6 1 7.1", "y") -uniformData["Case a:z"] = FluxDataSingle( +singleData["Case a:z"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 8 8 11.2 46.4,1 1 1 2.6 7.1", "z") -uniformData["Case b:x"] = FluxDataSingle( +singleData["Case b:x"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", "x") -uniformData["Case b:y"] = FluxDataSingle( +singleData["Case b:y"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", "y") -uniformData["Case b:z"] = FluxDataSingle( +singleData["Case b:z"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", "z") -uniformData["Case c:x"] = FluxDataSingle( +singleData["Case c:x"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "4 11.2 16 24 134.4,1 2.6 2 3 12.6", "x") -uniformData["Case c:y"] = FluxDataSingle( +singleData["Case c:y"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "8 16 35.2 48 268.8,2 2 5.6 6 25.2", "y") -uniformData["Case c:z"] = FluxDataSingle( +singleData["Case c:z"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "12 24 48 75.2 403.2,3 3 6 10.6 37.8", "z") -uniformData["Case d:x"] = FluxDataSingle( +singleData["Case d:x"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", "x") -uniformData["Case d:y"] = FluxDataSingle( +singleData["Case d:y"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", "y") -uniformData["Case d:z"] = FluxDataSingle( +singleData["Case d:z"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", "z") @@ -70,6 +70,6 @@ uniformData["Case d:z"] = FluxDataSingle( "Case c:x", "Case c:y", "Case c:z", "Case d:x", "Case d:y", "Case d:z"]) def data(request): - return uniformData[request.param] + return singleData[request.param] -- GitLab From ab8f4adea52b83730f826f847fc2fdccff878022 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sun, 21 Jul 2019 23:49:05 -0500 Subject: [PATCH 13/60] for uniform grid, combined_metric is always 1 so it shouldn't be an argument --- test.py | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/test.py b/test.py index 6b7d044..fbbe67c 100644 --- a/test.py +++ b/test.py @@ -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) -- GitLab From 4a3a9f8c01ee467b461dd59199cb5a1e7fb6073d Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 00:07:23 -0500 Subject: [PATCH 14/60] convert pointwise eigenvalue test to use new fixture --- input.py | 35 ++++++++++++++++++++++++++++++++--- test.py | 48 ++++++++---------------------------------------- 2 files changed, 40 insertions(+), 43 deletions(-) diff --git a/input.py b/input.py index 38b7118..fe5bd6b 100644 --- a/input.py +++ b/input.py @@ -7,9 +7,14 @@ class FluxDataSingle: ndim = 3 dirs = {"x": 1, "y": 2, "z": 3} - def __init__(self, states_str, fluxes_str, direction): - self.states = u.transposed_array_from_string(states_str) - self.fluxes = u.transposed_array_from_string(fluxes_str) + def __init__(self, states_str, fluxes_str, lam_str, direction): + self.state_pair = u.transposed_array_from_string(states_str) + self.states = u.expand_to_6(self.state_pair) + self.flux_pair = u.transposed_array_from_string(fluxes_str) + + self.lam_pointwise = u.expand_to_6( + u.transposed_array_from_string(lam_str)) + self.direction = self.dirs[direction] @@ -17,50 +22,74 @@ singleData = {} singleData["Case a:x"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 11.2 8 8 46.4,1 2.6 1 1 7.1", + ("2. 2. 2. 3.4966629547095764 0.5033370452904236," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), "x") singleData["Case a:y"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 8 11.2 8 46.4,1 1 2.6 1 7.1", + ("2. 2. 2. 3.4966629547095764 0.5033370452904236," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), "y") singleData["Case a:z"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 8 8 11.2 46.4,1 1 1 2.6 7.1", + ("2. 2. 2. 3.4966629547095764 0.5033370452904236," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), "z") singleData["Case b:x"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), "x") singleData["Case b:y"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", + ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), "y") singleData["Case b:z"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", + ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), "z") singleData["Case c:x"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "4 11.2 16 24 134.4,1 2.6 2 3 12.6", + ("2. 2. 2. 3.4966629547095764 0.5033370452904236," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), "x") singleData["Case c:y"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "8 16 35.2 48 268.8,2 2 5.6 6 25.2", + ("4. 4. 4. 5.496662954709576 2.5033370452904236," + "2. 2. 2. 3.4966629547095764 0.5033370452904236"), "y") singleData["Case c:z"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "12 24 48 75.2 403.2,3 3 6 10.6 37.8", + ("6. 6. 6. 7.496662954709576 4.503337045290424," + "3. 3. 3. 4.496662954709576 1.5033370452904236"), "z") singleData["Case d:x"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", + ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), "x") singleData["Case d:y"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", + ("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," + "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), "y") singleData["Case d:z"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", + ("-3. -3. -3. -1.5033370452904236 -4.496662954709576," + "-6. -6. -6. -4.503337045290424 -7.496662954709576"), "z") diff --git a/test.py b/test.py index fbbe67c..879b26d 100644 --- a/test.py +++ b/test.py @@ -303,48 +303,16 @@ def test_flux_splitting_uniform_grid( u.compare_arrays(fluxes_neg_dev.get(), fluxes_neg_expected) -@pytest.mark.parametrize("states_str,direction,lam_expected_str", [ - ("2 4 4 4 20,1 1 1 1 5.5", "x", - "2 2 2 3.49666295 0.503337045,1 1 1 2.49666295 -0.496662955"), - ("2 4 4 4 20,1 1 1 1 5.5", "y", - "2 2 2 3.49666295 0.503337045,1 1 1 2.49666295 -0.496662955"), - ("2 4 4 4 20,1 1 1 1 5.5", "z", - "2 2 2 3.49666295 0.503337045,1 1 1 2.49666295 -0.496662955"), - ("1 -1 -1 -1 5.5,2 -4 -4 -4 20", "x", - "-1 -1 -1 0.496662955 -2.49666295,-2 -2 -2 -0.503337045 -3.49666295"), - ("1 -1 -1 -1 5.5,2 -4 -4 -4 20", "y", - "-1 -1 -1 0.496662955 -2.49666295,-2 -2 -2 -0.503337045 -3.49666295"), - ("1 -1 -1 -1 5.5,2 -4 -4 -4 20", "z", - "-1 -1 -1 0.496662955 -2.49666295,-2 -2 -2 -0.503337045 -3.49666295"), - ("2 4 8 12 64,1 1 2 3 11", "x", - "2 2 2 3.49666295 0.503337045,1 1 1 2.49666295 -0.496662955"), - ("2 4 8 12 64,1 1 2 3 11", "y", - "4 4 4 5.49666295 2.50333705,2 2 2 3.49666295 0.503337045"), - ("2 4 8 12 64,1 1 2 3 11", "z", - "6 6 6 7.49666295 4.50333705,3 3 3 4.49666295 1.503337045"), - ("1 -1 -2 -3 11,2 -4 -8 -12 64", "x", - "-1 -1 -1 0.496662955 -2.49666295,-2 -2 -2 -0.503337045 -3.49666295"), - ("1 -1 -2 -3 11,2 -4 -8 -12 64", "y", - "-2 -2 -2 -0.503337045 -3.49666295,-4 -4 -4 -2.50333705 -5.49666295"), - ("1 -1 -2 -3 11,2 -4 -8 -12 64", "z", - "-3 -3 -3 -1.50333705 -4.49666295,-6 -6 -6 -4.50333705 -7.49666295") - ]) -def test_pointwise_eigenvalues_ideal_gas( - ctx_factory, states_str, direction, lam_expected_str): +def test_pointwise_eigenvalues_ideal_gas(ctx_factory, data): prg = u.get_weno_program_with_root_kernel("pointwise_eigenvalues") queue = u.get_queue(ctx_factory) - nvars = 5 - dirs = {"x": 1, "y": 2, "z": 3} + lam_dev = u.empty_array_on_device(queue, data.nvars, 6) - states = u.expand_to_6(u.transposed_array_from_string(states_str)) - lam_dev = u.empty_array_on_device(queue, nvars, 6) + prg(queue, nvars=data.nvars, d=data.direction, + states=data.states, lambda_pointwise=lam_dev) - prg(queue, nvars=nvars, d=dirs[direction], - states=states, lambda_pointwise=lam_dev) - - lam_expected = u.expand_to_6(u.transposed_array_from_string(lam_expected_str)) - u.compare_arrays(lam_dev.get(), lam_expected) + u.compare_arrays(lam_dev.get(), data.lam_pointwise) def test_roe_uniform_grid_ideal_gas(ctx_factory, data): @@ -373,15 +341,15 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, data): lam_dev = u.empty_array_on_device(queue, data.nvars) prg(queue, nvars=data.nvars, ndim=data.ndim, d=data.direction, - states=data.states, metrics_frozen=metrics_frozen, + states=data.state_pair, metrics_frozen=metrics_frozen, R=R_dev, R_inv=R_inv_dev, lambda_roe=lam_dev) R = R_dev.get() R_inv = R_inv_dev.get() lam = lam_dev.get() - check_roe_identity(data.states, R, R_inv) - check_roe_property(data.states, data.fluxes, R, R_inv, lam) + check_roe_identity(data.state_pair, R, R_inv) + check_roe_property(data.state_pair, data.flux_pair, R, R_inv, lam) @pytest.mark.slow -- GitLab From f865327fc5c669737e222c6b0f176a3dbde078f0 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 00:08:21 -0500 Subject: [PATCH 15/60] use consistent capitalization for single_data --- input.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/input.py b/input.py index fe5bd6b..6eb96de 100644 --- a/input.py +++ b/input.py @@ -18,74 +18,74 @@ class FluxDataSingle: self.direction = self.dirs[direction] -singleData = {} -singleData["Case a:x"] = FluxDataSingle( +single_data = {} +single_data["Case a:x"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 11.2 8 8 46.4,1 2.6 1 1 7.1", ("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), "x") -singleData["Case a:y"] = FluxDataSingle( +single_data["Case a:y"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 8 11.2 8 46.4,1 1 2.6 1 7.1", ("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), "y") -singleData["Case a:z"] = FluxDataSingle( +single_data["Case a:z"] = FluxDataSingle( "2 4 4 4 20,1 1 1 1 5.5", "4 8 8 11.2 46.4,1 1 1 2.6 7.1", ("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), "z") -singleData["Case b:x"] = FluxDataSingle( +single_data["Case b:x"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), "x") -singleData["Case b:y"] = FluxDataSingle( +single_data["Case b:y"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), "y") -singleData["Case b:z"] = FluxDataSingle( +single_data["Case b:z"] = FluxDataSingle( "1 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), "z") -singleData["Case c:x"] = FluxDataSingle( +single_data["Case c:x"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "4 11.2 16 24 134.4,1 2.6 2 3 12.6", ("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), "x") -singleData["Case c:y"] = FluxDataSingle( +single_data["Case c:y"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "8 16 35.2 48 268.8,2 2 5.6 6 25.2", ("4. 4. 4. 5.496662954709576 2.5033370452904236," "2. 2. 2. 3.4966629547095764 0.5033370452904236"), "y") -singleData["Case c:z"] = FluxDataSingle( +single_data["Case c:z"] = FluxDataSingle( "2 4 8 12 64,1 1 2 3 11", "12 24 48 75.2 403.2,3 3 6 10.6 37.8", ("6. 6. 6. 7.496662954709576 4.503337045290424," "3. 3. 3. 4.496662954709576 1.5033370452904236"), "z") -singleData["Case d:x"] = FluxDataSingle( +single_data["Case d:x"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), "x") -singleData["Case d:y"] = FluxDataSingle( +single_data["Case d:y"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", ("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), "y") -singleData["Case d:z"] = FluxDataSingle( +single_data["Case d:z"] = FluxDataSingle( "1 -1 -2 -3 11,2 -4 -8 -12 64", "-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", ("-3. -3. -3. -1.5033370452904236 -4.496662954709576," @@ -99,6 +99,6 @@ singleData["Case d:z"] = FluxDataSingle( "Case c:x", "Case c:y", "Case c:z", "Case d:x", "Case d:y", "Case d:z"]) def data(request): - return singleData[request.param] + return single_data[request.param] -- GitLab From 82917ff08f145a24e1d7b056a4051e319da0ab3d Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 14:25:07 -0500 Subject: [PATCH 16/60] for now, only testing x direction --- input.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/input.py b/input.py index 6eb96de..c3a8a12 100644 --- a/input.py +++ b/input.py @@ -94,10 +94,10 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - "Case a:x", "Case a:y", "Case a:z", - "Case b:x", "Case b:y", "Case b:z", - "Case c:x", "Case c:y", "Case c:z", - "Case d:x", "Case d:y", "Case d:z"]) + "Case a:x",# "Case a:y", "Case a:z", + "Case b:x",# "Case b:y", "Case b:z", + "Case c:x",# "Case c:y", "Case c:z", + "Case d:x"])#, "Case d:y", "Case d:z"]) def data(request): return single_data[request.param] -- GitLab From 276be411c0ace79f13f94ccd5ff9a164201e8b40 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 14:29:58 -0500 Subject: [PATCH 17/60] Revert "for now, only testing x direction" This reverts commit 82917ff08f145a24e1d7b056a4051e319da0ab3d. --- input.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/input.py b/input.py index c3a8a12..6eb96de 100644 --- a/input.py +++ b/input.py @@ -94,10 +94,10 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - "Case a:x",# "Case a:y", "Case a:z", - "Case b:x",# "Case b:y", "Case b:z", - "Case c:x",# "Case c:y", "Case c:z", - "Case d:x"])#, "Case d:y", "Case d:z"]) + "Case a:x", "Case a:y", "Case a:z", + "Case b:x", "Case b:y", "Case b:z", + "Case c:x", "Case c:y", "Case c:z", + "Case d:x", "Case d:y", "Case d:z"]) def data(request): return single_data[request.param] -- GitLab From 76b86e238d17797333572c02b93320981c6339f6 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 14:35:34 -0500 Subject: [PATCH 18/60] added variable names to data initialization --- input.py | 96 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/input.py b/input.py index 6eb96de..9efa77b 100644 --- a/input.py +++ b/input.py @@ -20,77 +20,77 @@ class FluxDataSingle: single_data = {} single_data["Case a:x"] = FluxDataSingle( - "2 4 4 4 20,1 1 1 1 5.5", - "4 11.2 8 8 46.4,1 2.6 1 1 7.1", - ("2. 2. 2. 3.4966629547095764 0.5033370452904236," + states_str="2 4 4 4 20,1 1 1 1 5.5", + fluxes_str="4 11.2 8 8 46.4,1 2.6 1 1 7.1", + lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - "x") + direction="x") single_data["Case a:y"] = FluxDataSingle( - "2 4 4 4 20,1 1 1 1 5.5", - "4 8 11.2 8 46.4,1 1 2.6 1 7.1", - ("2. 2. 2. 3.4966629547095764 0.5033370452904236," + states_str="2 4 4 4 20,1 1 1 1 5.5", + fluxes_str="4 8 11.2 8 46.4,1 1 2.6 1 7.1", + lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - "y") + direction="y") single_data["Case a:z"] = FluxDataSingle( - "2 4 4 4 20,1 1 1 1 5.5", - "4 8 8 11.2 46.4,1 1 1 2.6 7.1", - ("2. 2. 2. 3.4966629547095764 0.5033370452904236," + states_str="2 4 4 4 20,1 1 1 1 5.5", + fluxes_str="4 8 8 11.2 46.4,1 1 1 2.6 7.1", + lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - "z") + direction="z") single_data["Case b:x"] = FluxDataSingle( - "1 -1 -1 -1 5.5,2 -4 -4 -4 20", - "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", - ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", + fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - "x") + direction="x") single_data["Case b:y"] = FluxDataSingle( - "1 -1 -1 -1 5.5,2 -4 -4 -4 20", - "-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", - ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", + fluxes_str="-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - "y") + direction="y") single_data["Case b:z"] = FluxDataSingle( - "1 -1 -1 -1 5.5,2 -4 -4 -4 20", - "-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", - ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", + fluxes_str="-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - "z") + direction="z") single_data["Case c:x"] = FluxDataSingle( - "2 4 8 12 64,1 1 2 3 11", - "4 11.2 16 24 134.4,1 2.6 2 3 12.6", - ("2. 2. 2. 3.4966629547095764 0.5033370452904236," + states_str="2 4 8 12 64,1 1 2 3 11", + fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", + lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - "x") + direction="x") single_data["Case c:y"] = FluxDataSingle( - "2 4 8 12 64,1 1 2 3 11", - "8 16 35.2 48 268.8,2 2 5.6 6 25.2", - ("4. 4. 4. 5.496662954709576 2.5033370452904236," + states_str="2 4 8 12 64,1 1 2 3 11", + fluxes_str="8 16 35.2 48 268.8,2 2 5.6 6 25.2", + lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," "2. 2. 2. 3.4966629547095764 0.5033370452904236"), - "y") + direction="y") single_data["Case c:z"] = FluxDataSingle( - "2 4 8 12 64,1 1 2 3 11", - "12 24 48 75.2 403.2,3 3 6 10.6 37.8", - ("6. 6. 6. 7.496662954709576 4.503337045290424," + states_str="2 4 8 12 64,1 1 2 3 11", + fluxes_str="12 24 48 75.2 403.2,3 3 6 10.6 37.8", + lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," "3. 3. 3. 4.496662954709576 1.5033370452904236"), - "z") + direction="z") single_data["Case d:x"] = FluxDataSingle( - "1 -1 -2 -3 11,2 -4 -8 -12 64", - "-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", - ("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", + fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - "x") + direction="x") single_data["Case d:y"] = FluxDataSingle( - "1 -1 -2 -3 11,2 -4 -8 -12 64", - "-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", - ("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," + states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", + fluxes_str="-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", + lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), - "y") + direction="y") single_data["Case d:z"] = FluxDataSingle( - "1 -1 -2 -3 11,2 -4 -8 -12 64", - "-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", - ("-3. -3. -3. -1.5033370452904236 -4.496662954709576," + states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", + fluxes_str="-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", + lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," "-6. -6. -6. -4.503337045290424 -7.496662954709576"), - "z") + direction="z") @pytest.fixture(scope="session", params=[ -- GitLab From 3baf90211cda6055878fb6b3b6a9b3ab86f23d83 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 14:56:31 -0500 Subject: [PATCH 19/60] added new arguments to data object constructor, started adding new cases --- input.py | 303 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 302 insertions(+), 1 deletion(-) diff --git a/input.py b/input.py index 9efa77b..3223d50 100644 --- a/input.py +++ b/input.py @@ -7,13 +7,36 @@ class FluxDataSingle: ndim = 3 dirs = {"x": 1, "y": 2, "z": 3} - def __init__(self, states_str, fluxes_str, lam_str, direction): + def __init__(self, states_str, fluxes_str, + lam_str, R_str, R_inv_str, wavespeeds_str, + char_fluxes_pos_str, char_fluxes_neg_str, + weno_weights_pos_str, weno_weights_neg_str, + consistent_str, dissipation_pos_str, dissipation_neg_str, + weno_flux_str, direction): + self.state_pair = u.transposed_array_from_string(states_str) self.states = u.expand_to_6(self.state_pair) self.flux_pair = u.transposed_array_from_string(fluxes_str) self.lam_pointwise = u.expand_to_6( u.transposed_array_from_string(lam_str)) + self.R = u.array_from_string(R_str) + self.R_inv = u.array_from_string(R_inv_str) + self.wavespeeds = u.array_from_string(wavespeeds_str) + + self.char_fluxes_pos = u.expand_to_6( + u.transposed_array_from_string(char_fluxes_pos_str)) + self.char_fluxes_neg = u.expand_to_6( + u.transposed_array_from_string(char_fluxes_neg_str)) + + self.weno_weights_pos = u.transposed_array_from_string(weno_weights_pos_str) + self.weno_weights_neg = u.transposed_array_from_string(weno_weights_neg_str) + + self.consistent = u.array_from_string(consistent_str) + self.dissipation_pos = u.array_from_string(dissipation_pos_str) + self.dissipation_neg = u.array_from_string(dissipation_neg_str) + + self.weno_flux = u.array_from_string(weno_flux_str) self.direction = self.dirs[direction] @@ -24,72 +47,350 @@ single_data["Case a:x"] = FluxDataSingle( fluxes_str="4 11.2 8 8 46.4,1 2.6 1 1 7.1", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="x") single_data["Case a:y"] = FluxDataSingle( states_str="2 4 4 4 20,1 1 1 1 5.5", fluxes_str="4 8 11.2 8 46.4,1 1 2.6 1 7.1", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="y") single_data["Case a:z"] = FluxDataSingle( states_str="2 4 4 4 20,1 1 1 1 5.5", fluxes_str="4 8 8 11.2 46.4,1 1 1 2.6 7.1", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="z") single_data["Case b:x"] = FluxDataSingle( states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="x") single_data["Case b:y"] = FluxDataSingle( states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", fluxes_str="-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="y") single_data["Case b:z"] = FluxDataSingle( states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", fluxes_str="-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="z") single_data["Case c:x"] = FluxDataSingle( states_str="2 4 8 12 64,1 1 2 3 11", fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="x") single_data["Case c:y"] = FluxDataSingle( states_str="2 4 8 12 64,1 1 2 3 11", fluxes_str="8 16 35.2 48 268.8,2 2 5.6 6 25.2", lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," "2. 2. 2. 3.4966629547095764 0.5033370452904236"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="y") single_data["Case c:z"] = FluxDataSingle( states_str="2 4 8 12 64,1 1 2 3 11", fluxes_str="12 24 48 75.2 403.2,3 3 6 10.6 37.8", lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," "3. 3. 3. 4.496662954709576 1.5033370452904236"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="z") single_data["Case d:x"] = FluxDataSingle( states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="x") single_data["Case d:y"] = FluxDataSingle( states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", fluxes_str="-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), + R_str= + + R_inv_str= + + wavespeeds_str= + + char_fluxes_pos_str= + + char_fluxes_neg_str= + + weno_weights_pos_str= + + weno_weights_neg_str= + + consistent_str= + + dissipation_pos_str= + + dissipation_neg_str= + + weno_flux= + direction="y") single_data["Case d:z"] = FluxDataSingle( states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", fluxes_str="-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," "-6. -6. -6. -4.503337045290424 -7.496662954709576"), + R_str=1 0 0 0.41384589551844686 0.41384589551844686 + -1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262 + -3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 + -1.3125424167614286 + -4.757359312880716 0 1.4142135623730951 -1.968813625142143 + -1.968813625142143 + 17.60303038033002 -4.485281374238571 -6.727922061357858 + 9.184069510080404 11.42671019719969 + + R_inv_str=-1.4118746341171051 -0.21727611674823194 + -0.4345522334964639 -0.6518283502446959 -0.13701474018997217 + 2.2426406871192857 0 0.7071067811865475 0 0 + 3.3639610306789285 0 0 0.7071067811865475 0 + 4.035297092194084 0.9696152645388333 0.5250169667045714 + 0.7875254500568571 0.16553835820737872 + 1.7926564050747988 -0.4445982978342618 0.5250169667045714 + 0.7875254500568571 0.16553835820737872 + + wavespeeds_str=2.2,2.2,2.2,0.553670749819466,3.8463292501805344 + + char_fluxes_pos_str=0.009488213714461069,0.49705627484771453,0.7455844122715716,0.31431832174320373,0.4306378813126712},{0.1482823715615963,-0.1171572875253809,-0.1757359312880714,0.20004041758408686,0.8893252542028551 + + char_fluxes_neg_str=-0.26073527447612554,-1.3254833995939053,-1.9882250993908572,-0.5017887559695788,-2.052422890589809},{-1.1162114029572359,2.4603030380329987,3.690454557049497,-0.4290108979594782,-7.986924884679773 + + weno_weights_pos_str=0.9999990185022956,0.9999999974390363,0.9999999994941201,0.9999978651320311,0.9999999917661908},{9.08762722250494*10^-7,2.3712585027633853*10^-9,4.684070887233427*10^-10,1.976628702372801*10^-6,7.62387333908512*10^-9},{7.27349821618269*10^-8,1.897052057748541*10^-10,3.747296441221644*10^-11,1.5823926647977797*10^-7,6.099359570650648*10^-10 + + weno_weights_neg_str=0.999999999319454,0.9999999999982254,0.9999999999996494,0.9999870425235151,0.9999999999997061},{6.301345524776077*10^-10,1.6430428067143077*10^-12,3.245518542322869*10^-13,0.000011996153712066484,2.721049684463335*10^-13},{5.041138413805998*10^-11,1.3144350707803127*10^-13,2.5964155584975223*10^-14,9.613227729623656*10^-7,2.1768403038595738*10^-14 + + consistent_str=-2.5,6.899999999999999,9.,13.5,-73.5 + + dissipation_pos_str=-0.14066328824586258,0.42563568844302985,0.8804384437989112,1.3206576666570364,-7.7942206041633595 + + dissipation_neg_str=-1.6406634409601506,4.725635754575325,7.88043892893644,11.820658393408754,-68.69422377699841 + + weno_flux=-4.281326729206013,12.051271443018354,17.76087737273535,26.641316060065794,-149.98844438116177 + direction="z") -- GitLab From 708ac8cc0a5fea37b79d55b615a3d8deee89ba83 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 15:28:07 -0500 Subject: [PATCH 20/60] added data for cases c and d, still incomplete --- input.py | 226 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 148 insertions(+), 78 deletions(-) diff --git a/input.py b/input.py index 3223d50..46c8fd5 100644 --- a/input.py +++ b/input.py @@ -215,27 +215,41 @@ single_data["Case c:x"] = FluxDataSingle( fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str= + R_str=1 0 0 0.41384589551844686 0.41384589551844686 + 1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326 + 3.1715728752538106 1.4142135623730951 0 1.3125424167614286 + 1.3125424167614286 + 4.757359312880716 0 1.4142135623730951 1.968813625142143 + 1.968813625142143 + 17.60303038033002 4.485281374238571 6.727922061357858 + 11.42671019719969 9.184069510080404 - R_inv_str= + R_inv_str=-1.4118746341171051 0.21727611674823194 0.4345522334964639 + 0.6518283502446959 -0.13701474018997217 + -2.2426406871192857 0 0.7071067811865475 0 0 + -3.3639610306789285 0 0 0.7071067811865475 0 + 1.7926564050747988 0.4445982978342618 -0.5250169667045714 + -0.7875254500568571 0.16553835820737872 + 4.035297092194084 -0.9696152645388333 -0.5250169667045714 + -0.7875254500568571 0.16553835820737872 - wavespeeds_str= + wavespeeds_str=2.2,2.2,2.2,3.8463292501805344,0.553670749819466 - char_fluxes_pos_str= + char_fluxes_pos_str=1.1162114029572359,2.4603030380329987,3.690454557049497,7.986924884679773,0.4290108979594782},{0.26073527447612554,-1.3254833995939053,-1.9882250993908572,2.052422890589809,0.5017887559695788 - char_fluxes_neg_str= + char_fluxes_neg_str=-0.1482823715615963,-0.1171572875253809,-0.1757359312880714,-0.8893252542028551,-0.20004041758408686},{-0.009488213714461069,0.49705627484771453,0.7455844122715716,-0.4306378813126712,-0.31431832174320373 - weno_weights_pos_str= + weno_weights_pos_str=0.999999999319454,0.9999999999982254,0.9999999999996494,0.9999999999997061,0.9999870425235151},{6.301345524776077*10^-10,1.6430428067143077*10^-12,3.245518542322869*10^-13,2.721049684463335*10^-13,0.000011996153712066484},{5.041138413805998*10^-11,1.3144350707803127*10^-13,2.5964155584975223*10^-14,2.1768403038595738*10^-14,9.613227729623656*10^-7 - weno_weights_neg_str= + weno_weights_neg_str=0.9999990185022956,0.9999999974390363,0.9999999994941201,0.9999999917661908,0.9999978651320311},{9.08762722250494*10^-7,2.3712585027633853*10^-9,4.684070887233427*10^-10,7.62387333908512*10^-9,1.976628702372801*10^-6},{7.27349821618269*10^-8,1.897052057748541*10^-10,3.747296441221644*10^-11,6.099359570650648*10^-10,1.5823926647977797*10^-7 - consistent_str= + consistent_str=2.5,6.9,9.,13.5,73.5 - dissipation_pos_str= + dissipation_pos_str=1.6406634409601506,4.725635754575325,7.88043892893644,11.820658393408754,68.69422377699841 - dissipation_neg_str= + dissipation_neg_str=0.14066328824586258,0.4256356884430299,0.8804384437989111,1.3206576666570364,7.7942206041633595 - weno_flux= + weno_flux=4.281326729206013,12.051271443018354,17.76087737273535,26.64131606006579,149.98844438116177 direction="x") single_data["Case c:y"] = FluxDataSingle( @@ -243,27 +257,41 @@ single_data["Case c:y"] = FluxDataSingle( fluxes_str="8 16 35.2 48 268.8,2 2 5.6 6 25.2", lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," "2. 2. 2. 3.4966629547095764 0.5033370452904236"), - R_str= + R_str=1 0 0 0.41384589551844686 0.41384589551844686 + 3.1715728752538106 0 0 2.019649197947976 0.605435635574881 + 4.757359312880716 1.4142135623730951 0 1.968813625142143 + 1.968813625142143 + 1.5857864376269053 0 1.4142135623730951 0.6562712083807143 + 0.6562712083807143 + 17.60303038033002 6.727922061357858 2.2426406871192857 + 12.548030540759331 8.062749166520762 - R_inv_str= + R_inv_str=-1.4118746341171051 0.4345522334964639 0.6518283502446959 + 0.21727611674823194 -0.13701474018997217 + -3.3639610306789285 0 0.7071067811865475 0 0 + -1.1213203435596428 0 0 0.7071067811865475 0 + 0.671336061515156 0.18208981448197611 -0.7875254500568571 + -0.2625084833522857 0.16553835820737872 + 5.156617435753728 -1.2321237478911191 -0.7875254500568571 + -0.2625084833522857 0.16553835820737872 - wavespeeds_str= + wavespeeds_str=4.4,4.4,4.4,6.046329250180534,2.753670749819466 - char_fluxes_pos_str= + char_fluxes_pos_str=2.2324228059144673,7.380909114098994,2.4603030380329987,15.885347333048884,0.9465242322295992},{0.5214705489522515,-3.9764501987817145,-1.3254833995939053,1.3413036144786457,3.767119678640133 - char_fluxes_neg_str= + char_fluxes_neg_str=-0.2965647431231918,-0.3514718625761428,-0.1171572875253809,-1.6097440213843948,-0.5689873221894901},{-0.018976427428922138,1.4911688245431431,0.49705627484771453,-0.05753157056903602,-1.432380835542713 - weno_weights_pos_str= + weno_weights_pos_str=0.9999999999574652,0.999999999999978,0.9999999999982254,0.9999999999999919,0.9999999999942413},{3.9384014966385437*10^-11,2.0284497966079935*10^-14,1.6430428067143077*10^-12,7.542808138536806*10^-15,5.332240836330361*10^-12},{3.1507308840273685*10^-12,1.622759950511315*10^-15,1.3144350707803127*10^-13,6.034246767570432*10^-16,4.265797494767529*10^-13 - weno_weights_neg_str= + weno_weights_neg_str=0.9999999386221037,0.9999999999683822,0.9999999974390363,0.9999999999372101,0.9999999993440752},{5.68308936788955*10^-8,2.9275831062158654*10^-11,2.3712585027633853*10^-9,5.8138848037057226*10^-11,6.073372407373299*10^-10},{4.547002513715645*10^-9,2.3420726930957915*10^-12,1.897052057748541*10^-10,4.6511252168302*10^-12,4.8587565862160355*10^-11 - consistent_str= + consistent_str=5.,20.4,27.,9.,147. - dissipation_pos_str= + dissipation_pos_str=3.281326602835503,16.54629350160538,23.641315459112736,7.8804384863675505,137.3884413587739 - dissipation_neg_str= + dissipation_neg_str=0.2813265968286516,1.7462934823903076,2.641315430506613,0.8804384760489334,15.588441251607525 - weno_flux= + weno_flux=8.562653199664155,38.69258698399568,53.28263088961935,17.760876962416482,299.9768826103814 direction="y") single_data["Case c:z"] = FluxDataSingle( @@ -271,27 +299,41 @@ single_data["Case c:z"] = FluxDataSingle( fluxes_str="12 24 48 75.2 403.2,3 3 6 10.6 37.8", lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," "3. 3. 3. 4.496662954709576 1.5033370452904236"), - R_str= + R_str=1 0 0 0.41384589551844686 0.41384589551844686 + 4.757359312880716 0 0 2.6759204063286903 1.2617068439555954 + 1.5857864376269053 1.4142135623730951 0 0.6562712083807143 + 0.6562712083807143 + 3.1715728752538106 0 1.4142135623730951 1.3125424167614286 + 1.3125424167614286 + 17.60303038033002 2.2426406871192857 4.485281374238571 + 13.669350884318975 6.941428822961119 - R_inv_str= + R_inv_str=-1.4118746341171051 0.6518283502446959 + 0.21727611674823194 0.4345522334964639 -0.13701474018997217 + -1.1213203435596428 0 0.7071067811865475 0 0 + -2.2426406871192857 0 0 0.7071067811865475 0 + -0.4499842820444868 -0.08041866887030964 -0.2625084833522857 + -0.5250169667045714 0.16553835820737872 + 6.27793777931337 -1.4946322312434048 -0.2625084833522857 + -0.5250169667045714 0.16553835820737872 - wavespeeds_str= + wavespeeds_str=6.6,6.6,6.6,8.246329250180533,4.953670749819467 - char_fluxes_pos_str= + char_fluxes_pos_str=3.348634208871708,3.690454557049497,7.380909114098994,26.24407281945101,-0.9962654715332988},{0.7822058234283737,-1.9882250993908581,-3.9764501987817162,-0.6952990612264269,8.357934000904585 - char_fluxes_neg_str= + char_fluxes_neg_str=-0.44484711468478866,-0.1757359312880714,-0.3514718625761428,-2.447320076091316,-0.8207769392695052},{-0.02846464114338254,0.7455844122715716,1.4911688245431431,0.8126310150223119,-3.0474996241899346 - weno_weights_pos_str= + weno_weights_pos_str=0.999999999991598,0.9999999999996494,0.999999999999978,0.9999999999999993,0.9999999999999524},{7.779580658268568*10^-12,3.2455185423228674*10^-13,2.028449796607992*10^-14,6.408020704124379*10^-16,4.408056940300416*10^-14},{6.223673030753551*10^-13,2.596415558497523*10^-14,1.6227599505113154*10^-15,5.126416626873783*10^-17,3.526445914956101*10^-15 - weno_weights_neg_str= + weno_weights_neg_str=0.9999999878747177,0.9999999994941201,0.9999999999683822,0.9999999999967727,0.9999999999851737},{1.1227070122726888*10^-8,4.684070887233427*10^-10,2.9275831062158654*10^-11,2.988331869942141*10^-12,1.372802081812638*10^-11},{8.982122341016933*10^-10,3.747296441221644*10^-11,2.3420726930957915*10^-12,2.390667520553204*10^-13,1.0982436589127136*10^-12 - consistent_str= + consistent_str=7.5,42.9,13.5,27.,220.5 - dissipation_pos_str= + dissipation_pos_str=4.921989904281101,36.24738971766925,11.82065772959958,23.641315459201046,206.08266203865145 - dissipation_neg_str= + dissipation_neg_str=0.4219899024845117,3.9473897091113366,1.3206577265155963,2.6413154534736667,23.382662006532225 - weno_flux= + weno_flux=12.843979806765613,83.09477942678058,26.641315456115176,53.28263091267471,449.9653240451837 direction="z") single_data["Case d:x"] = FluxDataSingle( @@ -299,27 +341,41 @@ single_data["Case d:x"] = FluxDataSingle( fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str= + R_str=1 0 0 0.41384589551844686 0.41384589551844686 + -1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262 + -3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 + -1.3125424167614286 + -4.757359312880716 0 1.4142135623730951 -1.968813625142143 + -1.968813625142143 + 17.60303038033002 -4.485281374238571 -6.727922061357858 + 9.184069510080404 11.42671019719969 - R_inv_str= + R_inv_str=-1.4118746341171051 -0.21727611674823194 + -0.4345522334964639 -0.6518283502446959 -0.13701474018997217 + 2.2426406871192857 0 0.7071067811865475 0 0 + 3.3639610306789285 0 0 0.7071067811865475 0 + 4.035297092194084 0.9696152645388333 0.5250169667045714 + 0.7875254500568571 0.16553835820737872 + 1.7926564050747988 -0.4445982978342618 0.5250169667045714 + 0.7875254500568571 0.16553835820737872 - wavespeeds_str= + wavespeeds_str=2.2,2.2,2.2,0.553670749819466,3.8463292501805344 - char_fluxes_pos_str= + char_fluxes_pos_str=0.009488213714461069,0.49705627484771453,0.7455844122715716,0.31431832174320373,0.4306378813126712},{0.1482823715615963,-0.1171572875253809,-0.1757359312880714,0.20004041758408686,0.8893252542028551 - char_fluxes_neg_str= + char_fluxes_neg_str=-0.26073527447612554,-1.3254833995939053,-1.9882250993908572,-0.5017887559695788,-2.052422890589809},{-1.1162114029572359,2.4603030380329987,3.690454557049497,-0.4290108979594782,-7.986924884679773 - weno_weights_pos_str= + weno_weights_pos_str=0.9999990185022956,0.9999999974390363,0.9999999994941201,0.9999978651320311,0.9999999917661908},{9.08762722250494*10^-7,2.3712585027633853*10^-9,4.684070887233427*10^-10,1.976628702372801*10^-6,7.62387333908512*10^-9},{7.27349821618269*10^-8,1.897052057748541*10^-10,3.747296441221644*10^-11,1.5823926647977797*10^-7,6.099359570650648*10^-10 - weno_weights_neg_str= + weno_weights_neg_str=0.999999999319454,0.9999999999982254,0.9999999999996494,0.9999870425235151,0.9999999999997061},{6.301345524776077*10^-10,1.6430428067143077*10^-12,3.245518542322869*10^-13,0.000011996153712066484,2.721049684463335*10^-13},{5.041138413805998*10^-11,1.3144350707803127*10^-13,2.5964155584975223*10^-14,9.613227729623656*10^-7,2.1768403038595738*10^-14 - consistent_str= + consistent_str=-2.5,6.9,9.,13.5,-73.5 - dissipation_pos_str= + dissipation_pos_str=-0.14066328824586258,0.42563568844302985,0.8804384437989112,1.3206576666570364,-7.7942206041633595 - dissipation_neg_str= + dissipation_neg_str=-1.6406634409601506,4.725635754575325,7.88043892893644,11.820658393408754,-68.69422377699841 - weno_flux= + weno_flux=-4.281326729206013,12.051271443018354,17.76087737273535,26.641316060065794,-149.98844438116177 direction="x") single_data["Case d:y"] = FluxDataSingle( @@ -327,27 +383,41 @@ single_data["Case d:y"] = FluxDataSingle( fluxes_str="-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), - R_str= + R_str=1 0 0 0.41384589551844686 0.41384589551844686 + -3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976 + -4.757359312880716 1.4142135623730951 0 -1.968813625142143 + -1.968813625142143 + -1.5857864376269053 0 1.4142135623730951 -0.6562712083807143 + -0.6562712083807143 + 17.60303038033002 -6.727922061357858 -2.2426406871192857 + 8.062749166520762 12.548030540759331 - R_inv_str= + R_inv_str=-1.4118746341171051 -0.4345522334964639 + -0.6518283502446959 -0.21727611674823194 -0.13701474018997217 + 3.3639610306789285 0 0.7071067811865475 0 0 + 1.1213203435596428 0 0 0.7071067811865475 0 + 5.156617435753728 1.2321237478911191 0.7875254500568571 + 0.2625084833522857 0.16553835820737872 + 0.671336061515156 -0.18208981448197611 0.7875254500568571 + 0.2625084833522857 0.16553835820737872 - wavespeeds_str= + wavespeeds_str=4.4,4.4,4.4,2.753670749819466,6.046329250180534 - char_fluxes_pos_str= + char_fluxes_pos_str=0.018976427428922138,1.4911688245431431,0.49705627484771453,1.432380835542713,0.05753157056903602},{0.2965647431231918,-0.3514718625761428,-0.1171572875253809,0.5689873221894901,1.6097440213843948 - char_fluxes_neg_str= + char_fluxes_neg_str=-0.5214705489522515,-3.9764501987817145,-1.3254833995939053,-3.767119678640133,-1.3413036144786457},{-2.2324228059144673,7.380909114098994,2.4603030380329987,-0.9465242322295992,-15.885347333048884 - weno_weights_pos_str= + weno_weights_pos_str=0.9999999386221037,0.9999999999683822,0.9999999974390363,0.9999999993440752,0.9999999999372101},{5.68308936788955*10^-8,2.9275831062158654*10^-11,2.3712585027633853*10^-9,6.073372407373299*10^-10,5.8138848037057226*10^-11},{4.547002513715645*10^-9,2.3420726930957915*10^-12,1.897052057748541*10^-10,4.8587565862160355*10^-11,4.6511252168302*10^-12 - weno_weights_neg_str= + weno_weights_neg_str=0.9999999999574652,0.999999999999978,0.9999999999982254,0.9999999999942413,0.9999999999999919},{3.9384014966385437*10^-11,2.0284497966079935*10^-14,1.6430428067143077*10^-12,5.332240836330361*10^-12,7.542808138536806*10^-15},{3.1507308840273685*10^-12,1.622759950511315*10^-15,1.3144350707803127*10^-13,4.265797494767529*10^-13,6.034246767570432*10^-16 - consistent_str= + consistent_str=-5.,20.4,27.,9.,-147. - dissipation_pos_str= + dissipation_pos_str=-0.2813265968286516,1.7462934823903074,2.641315430506612,0.8804384760489334,-15.588441251607525 - dissipation_neg_str= + dissipation_neg_str=-3.281326602835503,16.54629350160538,23.641315459112736,7.880438486367551,-137.3884413587739 - weno_flux= + weno_flux=-8.562653199664155,38.69258698399569,53.28263088961934,17.760876962416486,-299.97688261038144 direction="y") single_data["Case d:z"] = FluxDataSingle( @@ -356,40 +426,40 @@ single_data["Case d:z"] = FluxDataSingle( lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," "-6. -6. -6. -4.503337045290424 -7.496662954709576"), R_str=1 0 0 0.41384589551844686 0.41384589551844686 - -1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262 - -3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 + -4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903 + -1.5857864376269053 1.4142135623730951 0 -0.6562712083807143 + -0.6562712083807143 + -3.1715728752538106 0 1.4142135623730951 -1.3125424167614286 -1.3125424167614286 - -4.757359312880716 0 1.4142135623730951 -1.968813625142143 - -1.968813625142143 - 17.60303038033002 -4.485281374238571 -6.727922061357858 - 9.184069510080404 11.42671019719969 + 17.60303038033002 -2.2426406871192857 -4.485281374238571 + 6.941428822961119 13.669350884318975 - R_inv_str=-1.4118746341171051 -0.21727611674823194 - -0.4345522334964639 -0.6518283502446959 -0.13701474018997217 - 2.2426406871192857 0 0.7071067811865475 0 0 - 3.3639610306789285 0 0 0.7071067811865475 0 - 4.035297092194084 0.9696152645388333 0.5250169667045714 - 0.7875254500568571 0.16553835820737872 - 1.7926564050747988 -0.4445982978342618 0.5250169667045714 - 0.7875254500568571 0.16553835820737872 + R_inv_str=-1.4118746341171051 -0.6518283502446959 + -0.21727611674823194 -0.4345522334964639 -0.13701474018997217 + 1.1213203435596428 0 0.7071067811865475 0 0 + 2.2426406871192857 0 0 0.7071067811865475 0 + 6.27793777931337 1.4946322312434048 0.2625084833522857 + 0.5250169667045714 0.16553835820737872 + -0.4499842820444868 0.08041866887030964 0.2625084833522857 + 0.5250169667045714 0.16553835820737872 - wavespeeds_str=2.2,2.2,2.2,0.553670749819466,3.8463292501805344 + wavespeeds_str=6.6,6.6,6.6,4.953670749819467,8.246329250180533 - char_fluxes_pos_str=0.009488213714461069,0.49705627484771453,0.7455844122715716,0.31431832174320373,0.4306378813126712},{0.1482823715615963,-0.1171572875253809,-0.1757359312880714,0.20004041758408686,0.8893252542028551 + char_fluxes_pos_str=0.02846464114338254,0.7455844122715716,1.4911688245431431,3.0474996241899346,-0.8126310150223119},{0.44484711468478866,-0.1757359312880714,-0.3514718625761428,0.8207769392695052,2.447320076091316 - char_fluxes_neg_str=-0.26073527447612554,-1.3254833995939053,-1.9882250993908572,-0.5017887559695788,-2.052422890589809},{-1.1162114029572359,2.4603030380329987,3.690454557049497,-0.4290108979594782,-7.986924884679773 + char_fluxes_neg_str=-0.7822058234283737,-1.9882250993908581,-3.9764501987817162,-8.357934000904585,0.6952990612264269},{-3.348634208871708,3.690454557049497,7.380909114098994,0.9962654715332988,-26.24407281945101 - weno_weights_pos_str=0.9999990185022956,0.9999999974390363,0.9999999994941201,0.9999978651320311,0.9999999917661908},{9.08762722250494*10^-7,2.3712585027633853*10^-9,4.684070887233427*10^-10,1.976628702372801*10^-6,7.62387333908512*10^-9},{7.27349821618269*10^-8,1.897052057748541*10^-10,3.747296441221644*10^-11,1.5823926647977797*10^-7,6.099359570650648*10^-10 + weno_weights_pos_str=0.9999999878747177,0.9999999994941201,0.9999999999683822,0.9999999999851737,0.9999999999967727},{1.1227070122726888*10^-8,4.684070887233427*10^-10,2.9275831062158654*10^-11,1.372802081812638*10^-11,2.988331869942141*10^-12},{8.982122341016933*10^-10,3.747296441221644*10^-11,2.3420726930957915*10^-12,1.0982436589127136*10^-12,2.390667520553204*10^-13 - weno_weights_neg_str=0.999999999319454,0.9999999999982254,0.9999999999996494,0.9999870425235151,0.9999999999997061},{6.301345524776077*10^-10,1.6430428067143077*10^-12,3.245518542322869*10^-13,0.000011996153712066484,2.721049684463335*10^-13},{5.041138413805998*10^-11,1.3144350707803127*10^-13,2.5964155584975223*10^-14,9.613227729623656*10^-7,2.1768403038595738*10^-14 + weno_weights_neg_str=0.999999999991598,0.9999999999996494,0.999999999999978,0.9999999999999524,0.9999999999999993},{7.779580658268568*10^-12,3.2455185423228674*10^-13,2.028449796607992*10^-14,4.408056940300416*10^-14,6.408020704124379*10^-16},{6.223673030753551*10^-13,2.596415558497523*10^-14,1.6227599505113154*10^-15,3.526445914956101*10^-15,5.126416626873783*10^-17 - consistent_str=-2.5,6.899999999999999,9.,13.5,-73.5 + consistent_str=-7.5,42.9,13.5,27.,-220.5 - dissipation_pos_str=-0.14066328824586258,0.42563568844302985,0.8804384437989112,1.3206576666570364,-7.7942206041633595 + dissipation_pos_str=-0.42198990248451174,3.947389709111337,1.3206577265155963,2.6413154534736667,-23.382662006532225 - dissipation_neg_str=-1.6406634409601506,4.725635754575325,7.88043892893644,11.820658393408754,-68.69422377699841 + dissipation_neg_str=-4.9219899042811,36.247389717669265,11.820657729599578,23.641315459201046,-206.08266203865145 - weno_flux=-4.281326729206013,12.051271443018354,17.76087737273535,26.641316060065794,-149.98844438116177 + weno_flux=-12.843979806765612,83.09477942678059,26.641315456115173,53.28263091267471,-449.9653240451837 direction="z") -- GitLab From 273ca58f2826e3ed63e88e6d74a6798ff923dc7e Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 16:13:12 -0500 Subject: [PATCH 21/60] more partial progress --- input.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/input.py b/input.py index 46c8fd5..690e74c 100644 --- a/input.py +++ b/input.py @@ -40,7 +40,13 @@ class FluxDataSingle: self.direction = self.dirs[direction] - +# FIXME: +# - finish adding data from B (one case for all) +# - add data from A (one case for all) +# - rotate fluxes in input for all y,z +# - add rotation routines so y,z data is setup correctly +# (even though values are different, we are still working with x as the +# dominant frame, so need to swap at the end) single_data = {} single_data["Case a:x"] = FluxDataSingle( states_str="2 4 4 4 20,1 1 1 1 5.5", @@ -197,17 +203,17 @@ single_data["Case b:z"] = FluxDataSingle( char_fluxes_neg_str= - weno_weights_pos_str= + weno_weights_pos_str=0.9999965203327451,0.999999959029252,0.999999959029252,0.9999835300215946,0.9999999975371708},{3.2217041402391125*10^-6,3.793560951911702*10^-8,3.793560951911702*10^-8,0.000015247816238787948,2.2803933579018906*10^-9},{2.579631146567429*10^-7,3.0351383606886035*10^-9,3.0351383606886035*10^-9,1.2221621667041045*10^-6,1.824357365679662*10^-10 - weno_weights_neg_str= + weno_weights_neg_str=0.999999997585736,0.9999999999716082,0.9999999999716082,0.9999909282503908,0.9999999999997268},{2.2354258683870077*10^-9,2.6288602366075745*10^-11,2.6288602366075745*10^-11,8.39888391917283*10^-6,2.5299566294114733*10^-13},{1.788382117901561*10^-10,2.1030934718853924*10^-12,2.1030934718853924*10^-12,6.728656898188601*10^-7,2.0239658022589593*10^-14 - consistent_str= + consistent_str=-2.5,6.899999999999999,4.5,4.5,-26.75 - dissipation_pos_str= + dissipation_pos_str=-0.17685508040141606,0.523974175351619,0.49761166908056337,0.49761166908056337,-2.495196349669178 - dissipation_neg_str= + dissipation_neg_str=-1.6768551393982627,4.823974372333487,3.9976117689805504,3.9976117689805504,-22.145196359962693 - weno_flux= + weno_flux=4.353710219799678,12.247948547685105,8.995223438061114,8.995223438061114,-51.390392709631875 direction="z") single_data["Case c:x"] = FluxDataSingle( -- GitLab From 4d9078e28ff64d24ff114958411e556414e6c4cc Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:15:32 -0500 Subject: [PATCH 22/60] initial data entry done --- input.py | 761 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 382 insertions(+), 379 deletions(-) diff --git a/input.py b/input.py index 690e74c..4aec1c5 100644 --- a/input.py +++ b/input.py @@ -1,6 +1,7 @@ import pytest import utilities as u +# {{{ FluxDataSingle class FluxDataSingle: nvars = 5 @@ -40,442 +41,444 @@ class FluxDataSingle: self.direction = self.dirs[direction] +# }}} + # FIXME: -# - finish adding data from B (one case for all) -# - add data from A (one case for all) -# - rotate fluxes in input for all y,z # - add rotation routines so y,z data is setup correctly # (even though values are different, we are still working with x as the # dominant frame, so need to swap at the end) + single_data = {} + +# {{{ Input data: Case (a) + single_data["Case a:x"] = FluxDataSingle( states_str="2 4 4 4 20,1 1 1 1 5.5", fluxes_str="4 11.2 8 8 46.4,1 2.6 1 1 7.1", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str= - - R_inv_str= - - wavespeeds_str= - - char_fluxes_pos_str= - - char_fluxes_neg_str= - - weno_weights_pos_str= - - weno_weights_neg_str= - - consistent_str= - - dissipation_pos_str= - - dissipation_neg_str= - - weno_flux= - + R_str=("1 0 0 0.45781245952886396 0.45781245952886396,", + "1.5857864376269053 0 0 1.4330995704840366 0.018886008110941373,", + "1.5857864376269053 1.4142135623730951 0 0.7259927892974889", + "0.7259927892974889,", + "1.5857864376269053 0 1.4142135623730951 0.7259927892974889", + "0.7259927892974889,", + "3.7720779386421466 2.2426406871192857 2.2426406871192857", + "5.578600290173388 3.335959603054103"), + R_inv_str=("0.36752136386566203 0.265894835574803 0.265894835574803", + "0.265894835574803 -0.16767379847989416,", + "-1.1213203435596428 0 0.7071067811865475 0 0,", + "-1.1213203435596428 0 0 0.7071067811865475 0,", + "-0.43055863210991147 0.41670966546755195 -0.2903971157189956", + "-0.2903971157189956 0.1831249838115456,", + "1.8120820550093746 -0.9975038969055432 -0.2903971157189956", + "-0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", + char_fluxes_pos_str=("1.0907156303492833 1.2301515190164993", + "1.2301515190164993 7.523052586013577 0.23295627081394965,", + "0.4673767959969717 -0.6627416997969526", + "-0.6627416997969526 1.4795302623674356 0.3125273038443238"), + char_fluxes_neg_str=("-0.16835489671908455 -0.05857864376269045", + "-0.05857864376269045 -0.7274934638648571 -0.30602629876675014,", + "-0.06722315769446469 0.24852813742385726", + "0.24852813742385726 -0.10725061063772967 -0.37456222716537935"), + weno_weights_pos_str=("0.999999997585736 0.9999999999716082", + "0.9999999999716082 0.9999999999997268 0.9999909282503908,", + "2.2354258683870077e-9 2.6288602366075745e-11", + "2.6288602366075745e-11 2.5299566294114733e-13 8.39888391917283e-6,", + "1.788382117901561e-10 2.1030934718853924e-12", + "2.1030934718853924e-12 2.0239658022589593e-14 6.728656898188601e-7"), + weno_weights_neg_str=("0.9999965203327451 0.999999959029252", + "0.999999959029252 0.9999999975371708 0.9999835300215946,", + "3.2217041402391125e-6 3.793560951911702e-8", + "3.793560951911702e-8 2.2803933579018906e-9 0.000015247816238787948,", + "2.579631146567429e-7 3.0351383606886035e-9", + "3.0351383606886035e-9 1.824357365679662e-10 1.2221621667041045e-6"), + consistent_str="2.5 6.9 4.5 4.5 26.75", + dissipation_pos_str=("1.6768551393982627 4.8239743723334865", + "3.997611768980551 3.997611768980551 22.145196359962693"), + dissipation_neg_str=("0.1768550804014161 0.523974175351619", + "0.4976116690805634 0.4976116690805634 2.495196349669178"), + weno_flux=("4.353710219799678 12.247948547685105 8.995223438061114", + "8.995223438061114 51.39039270963187"), direction="x") -single_data["Case a:y"] = FluxDataSingle( - states_str="2 4 4 4 20,1 1 1 1 5.5", - fluxes_str="4 8 11.2 8 46.4,1 1 2.6 1 7.1", - lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," - "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str= - - R_inv_str= - - wavespeeds_str= - - char_fluxes_pos_str= - - char_fluxes_neg_str= - - weno_weights_pos_str= - - weno_weights_neg_str= - - consistent_str= - - dissipation_pos_str= - - dissipation_neg_str= - - weno_flux= - - direction="y") -single_data["Case a:z"] = FluxDataSingle( - states_str="2 4 4 4 20,1 1 1 1 5.5", - fluxes_str="4 8 8 11.2 46.4,1 1 1 2.6 7.1", - lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," - "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str= - - R_inv_str= - - wavespeeds_str= - - char_fluxes_pos_str= - - char_fluxes_neg_str= - - weno_weights_pos_str= - weno_weights_neg_str= +# }}} - consistent_str= +# {{{ Input data: Case (b) - dissipation_pos_str= - - dissipation_neg_str= - - weno_flux= - - direction="z") single_data["Case b:x"] = FluxDataSingle( states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str= - - R_inv_str= - - wavespeeds_str= - - char_fluxes_pos_str= - - char_fluxes_neg_str= - - weno_weights_pos_str= - - weno_weights_neg_str= - - consistent_str= - - dissipation_pos_str= - - dissipation_neg_str= - - weno_flux= - + R_str=("1 0 0 0.45781245952886396 0.45781245952886396,", + "-1.5857864376269053 0 0 -0.018886008110941373", + "-1.4330995704840366,", + "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889", + "-0.7259927892974889,", + "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889", + "-0.7259927892974889,", + "3.7720779386421466 -2.2426406871192857 -2.2426406871192857", + "3.335959603054103 5.578600290173388"), + R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803", + "-0.265894835574803 -0.16767379847989416,", + "1.1213203435596428 0 0.7071067811865475 0 0,", + "1.1213203435596428 0 0 0.7071067811865475 0,", + "1.8120820550093746 0.9975038969055432 0.2903971157189956", + "0.2903971157189956 0.1831249838115456,", + "-0.43055863210991147 -0.41670966546755195 0.2903971157189956", + "0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", + char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726", + "0.24852813742385726 0.37456222716537935 0.10725061063772967,", + "0.16835489671908455 -0.05857864376269045", + "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), + char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526", + "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356,", + "-1.0907156303492833 1.2301515190164993", + "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), + weno_weights_pos_str=("0.9999965203327451 0.999999959029252", + "0.999999959029252 0.9999835300215946 0.9999999975371708,", + "3.2217041402391125e-6 3.793560951911702e-8", + "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9,", + "2.579631146567429e-7 3.0351383606886035e-9", + "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), + weno_weights_neg_str=("0.999999997585736 0.9999999999716082", + "0.9999999999716082 0.9999909282503908 0.9999999999997268,", + "2.2354258683870077e-9 2.6288602366075745e-11", + "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13,", + "1.788382117901561e-10 2.1030934718853924e-12", + "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), + consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", + dissipation_pos_str=("-0.17685508040141606 0.523974175351619", + "0.49761166908056337 0.49761166908056337 -2.495196349669178"), + dissipation_neg_str=("-1.6768551393982627 4.823974372333487", + "3.9976117689805504 3.9976117689805504 -22.145196359962693"), + weno_flux=("4.353710219799678 12.247948547685105", + "8.995223438061114 8.995223438061114 -51.390392709631875"), direction="x") -single_data["Case b:y"] = FluxDataSingle( - states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", - fluxes_str="-1 1 2.6 1 -7.1,-4 8 11.2 8 -46.4", - lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," - "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str= - - R_inv_str= - - wavespeeds_str= - - char_fluxes_pos_str= - - char_fluxes_neg_str= - - weno_weights_pos_str= - - weno_weights_neg_str= - - consistent_str= - - dissipation_pos_str= - - dissipation_neg_str= - - weno_flux= - - direction="y") -single_data["Case b:z"] = FluxDataSingle( - states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", - fluxes_str="-1 1 1 2.6 -7.1,-4 8 8 11.2 -46.4", - lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," - "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str= - - R_inv_str= - - wavespeeds_str= - - char_fluxes_pos_str= - - char_fluxes_neg_str= - weno_weights_pos_str=0.9999965203327451,0.999999959029252,0.999999959029252,0.9999835300215946,0.9999999975371708},{3.2217041402391125*10^-6,3.793560951911702*10^-8,3.793560951911702*10^-8,0.000015247816238787948,2.2803933579018906*10^-9},{2.579631146567429*10^-7,3.0351383606886035*10^-9,3.0351383606886035*10^-9,1.2221621667041045*10^-6,1.824357365679662*10^-10 +# }}} - weno_weights_neg_str=0.999999997585736,0.9999999999716082,0.9999999999716082,0.9999909282503908,0.9999999999997268},{2.2354258683870077*10^-9,2.6288602366075745*10^-11,2.6288602366075745*10^-11,8.39888391917283*10^-6,2.5299566294114733*10^-13},{1.788382117901561*10^-10,2.1030934718853924*10^-12,2.1030934718853924*10^-12,6.728656898188601*10^-7,2.0239658022589593*10^-14 +# {{{ Input data: Case (c) - consistent_str=-2.5,6.899999999999999,4.5,4.5,-26.75 - - dissipation_pos_str=-0.17685508040141606,0.523974175351619,0.49761166908056337,0.49761166908056337,-2.495196349669178 - - dissipation_neg_str=-1.6768551393982627,4.823974372333487,3.9976117689805504,3.9976117689805504,-22.145196359962693 - - weno_flux=4.353710219799678,12.247948547685105,8.995223438061114,8.995223438061114,-51.390392709631875 - - direction="z") single_data["Case c:x"] = FluxDataSingle( states_str="2 4 8 12 64,1 1 2 3 11", fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str=1 0 0 0.41384589551844686 0.41384589551844686 - 1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326 - 3.1715728752538106 1.4142135623730951 0 1.3125424167614286 - 1.3125424167614286 - 4.757359312880716 0 1.4142135623730951 1.968813625142143 - 1.968813625142143 - 17.60303038033002 4.485281374238571 6.727922061357858 - 11.42671019719969 9.184069510080404 - - R_inv_str=-1.4118746341171051 0.21727611674823194 0.4345522334964639 - 0.6518283502446959 -0.13701474018997217 - -2.2426406871192857 0 0.7071067811865475 0 0 - -3.3639610306789285 0 0 0.7071067811865475 0 - 1.7926564050747988 0.4445982978342618 -0.5250169667045714 - -0.7875254500568571 0.16553835820737872 - 4.035297092194084 -0.9696152645388333 -0.5250169667045714 - -0.7875254500568571 0.16553835820737872 - - wavespeeds_str=2.2,2.2,2.2,3.8463292501805344,0.553670749819466 - - char_fluxes_pos_str=1.1162114029572359,2.4603030380329987,3.690454557049497,7.986924884679773,0.4290108979594782},{0.26073527447612554,-1.3254833995939053,-1.9882250993908572,2.052422890589809,0.5017887559695788 - - char_fluxes_neg_str=-0.1482823715615963,-0.1171572875253809,-0.1757359312880714,-0.8893252542028551,-0.20004041758408686},{-0.009488213714461069,0.49705627484771453,0.7455844122715716,-0.4306378813126712,-0.31431832174320373 - - weno_weights_pos_str=0.999999999319454,0.9999999999982254,0.9999999999996494,0.9999999999997061,0.9999870425235151},{6.301345524776077*10^-10,1.6430428067143077*10^-12,3.245518542322869*10^-13,2.721049684463335*10^-13,0.000011996153712066484},{5.041138413805998*10^-11,1.3144350707803127*10^-13,2.5964155584975223*10^-14,2.1768403038595738*10^-14,9.613227729623656*10^-7 - - weno_weights_neg_str=0.9999990185022956,0.9999999974390363,0.9999999994941201,0.9999999917661908,0.9999978651320311},{9.08762722250494*10^-7,2.3712585027633853*10^-9,4.684070887233427*10^-10,7.62387333908512*10^-9,1.976628702372801*10^-6},{7.27349821618269*10^-8,1.897052057748541*10^-10,3.747296441221644*10^-11,6.099359570650648*10^-10,1.5823926647977797*10^-7 - - consistent_str=2.5,6.9,9.,13.5,73.5 - - dissipation_pos_str=1.6406634409601506,4.725635754575325,7.88043892893644,11.820658393408754,68.69422377699841 - - dissipation_neg_str=0.14066328824586258,0.4256356884430299,0.8804384437989111,1.3206576666570364,7.7942206041633595 - - weno_flux=4.281326729206013,12.051271443018354,17.76087737273535,26.64131606006579,149.98844438116177 - + R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", + "1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326,", + "3.1715728752538106 1.4142135623730951 0 1.3125424167614286", + "1.3125424167614286,", + "4.757359312880716 0 1.4142135623730951 1.968813625142143", + "1.968813625142143,", + "17.60303038033002 4.485281374238571 6.727922061357858", + "11.42671019719969 9.184069510080404"), + R_inv_str=("-1.4118746341171051 0.21727611674823194 0.4345522334964639", + "0.6518283502446959 -0.13701474018997217,", + "-2.2426406871192857 0 0.7071067811865475 0 0,", + "-3.3639610306789285 0 0 0.7071067811865475 0,", + "1.7926564050747988 0.4445982978342618 -0.5250169667045714", + "-0.7875254500568571 0.16553835820737872,", + "4.035297092194084 -0.9696152645388333 -0.5250169667045714", + "-0.7875254500568571 0.16553835820737872"), + wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", + char_fluxes_pos_str=("1.1162114029572359 2.4603030380329987", + "3.690454557049497 7.986924884679773 0.4290108979594782,", + "0.26073527447612554 -1.3254833995939053", + "-1.9882250993908572 2.052422890589809 0.5017887559695788"), + char_fluxes_neg_str=("-0.1482823715615963 -0.1171572875253809", + "-0.1757359312880714 -0.8893252542028551 -0.20004041758408686,", + "-0.009488213714461069 0.49705627484771453", + "0.7455844122715716 -0.4306378813126712 -0.31431832174320373"), + weno_weights_pos_str=("0.999999999319454 0.9999999999982254", + "0.9999999999996494 0.9999999999997061 0.9999870425235151,", + "6.301345524776077e-10 1.6430428067143077e-12", + "3.245518542322869e-13 2.721049684463335e-13 0.000011996153712066484,", + "5.041138413805998e-11 1.3144350707803127e-13", + "2.5964155584975223e-14 2.1768403038595738e-14 9.613227729623656e-7"), + weno_weights_neg_str=("0.9999990185022956 0.9999999974390363", + "0.9999999994941201 0.9999999917661908 0.9999978651320311,", + "9.08762722250494e-7 2.3712585027633853e-9", + "4.684070887233427e-10 7.62387333908512e-9 1.976628702372801e-6,", + "7.27349821618269e-8 1.897052057748541e-10", + "3.747296441221644e-11 6.099359570650648e-10 1.5823926647977797e-7"), + consistent_str="2.5 6.9 9. 13.5 73.5", + dissipation_pos_str=("1.6406634409601506 4.725635754575325", + "7.88043892893644 11.820658393408754 68.69422377699841"), + dissipation_neg_str=("0.14066328824586258 0.4256356884430299", + "0.8804384437989111 1.3206576666570364 7.7942206041633595"), + weno_flux=("4.281326729206013 12.051271443018354", + "17.76087737273535 26.64131606006579 149.98844438116177"), direction="x") single_data["Case c:y"] = FluxDataSingle( - states_str="2 4 8 12 64,1 1 2 3 11", - fluxes_str="8 16 35.2 48 268.8,2 2 5.6 6 25.2", + states_str="2 8 12 4 64,1 2 3 1 11", + fluxes_str="8 35.2 48 16 268.8,2 5.6 6 2 25.2", lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," "2. 2. 2. 3.4966629547095764 0.5033370452904236"), - R_str=1 0 0 0.41384589551844686 0.41384589551844686 - 3.1715728752538106 0 0 2.019649197947976 0.605435635574881 - 4.757359312880716 1.4142135623730951 0 1.968813625142143 - 1.968813625142143 - 1.5857864376269053 0 1.4142135623730951 0.6562712083807143 - 0.6562712083807143 - 17.60303038033002 6.727922061357858 2.2426406871192857 - 12.548030540759331 8.062749166520762 - - R_inv_str=-1.4118746341171051 0.4345522334964639 0.6518283502446959 - 0.21727611674823194 -0.13701474018997217 - -3.3639610306789285 0 0.7071067811865475 0 0 - -1.1213203435596428 0 0 0.7071067811865475 0 - 0.671336061515156 0.18208981448197611 -0.7875254500568571 - -0.2625084833522857 0.16553835820737872 - 5.156617435753728 -1.2321237478911191 -0.7875254500568571 - -0.2625084833522857 0.16553835820737872 - - wavespeeds_str=4.4,4.4,4.4,6.046329250180534,2.753670749819466 - - char_fluxes_pos_str=2.2324228059144673,7.380909114098994,2.4603030380329987,15.885347333048884,0.9465242322295992},{0.5214705489522515,-3.9764501987817145,-1.3254833995939053,1.3413036144786457,3.767119678640133 - - char_fluxes_neg_str=-0.2965647431231918,-0.3514718625761428,-0.1171572875253809,-1.6097440213843948,-0.5689873221894901},{-0.018976427428922138,1.4911688245431431,0.49705627484771453,-0.05753157056903602,-1.432380835542713 - - weno_weights_pos_str=0.9999999999574652,0.999999999999978,0.9999999999982254,0.9999999999999919,0.9999999999942413},{3.9384014966385437*10^-11,2.0284497966079935*10^-14,1.6430428067143077*10^-12,7.542808138536806*10^-15,5.332240836330361*10^-12},{3.1507308840273685*10^-12,1.622759950511315*10^-15,1.3144350707803127*10^-13,6.034246767570432*10^-16,4.265797494767529*10^-13 - - weno_weights_neg_str=0.9999999386221037,0.9999999999683822,0.9999999974390363,0.9999999999372101,0.9999999993440752},{5.68308936788955*10^-8,2.9275831062158654*10^-11,2.3712585027633853*10^-9,5.8138848037057226*10^-11,6.073372407373299*10^-10},{4.547002513715645*10^-9,2.3420726930957915*10^-12,1.897052057748541*10^-10,4.6511252168302*10^-12,4.8587565862160355*10^-11 - - consistent_str=5.,20.4,27.,9.,147. - - dissipation_pos_str=3.281326602835503,16.54629350160538,23.641315459112736,7.8804384863675505,137.3884413587739 - - dissipation_neg_str=0.2813265968286516,1.7462934823903076,2.641315430506613,0.8804384760489334,15.588441251607525 - - weno_flux=8.562653199664155,38.69258698399568,53.28263088961935,17.760876962416482,299.9768826103814 - + R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", + "3.1715728752538106 0 0 2.019649197947976 0.605435635574881,", + "4.757359312880716 1.4142135623730951 0 1.968813625142143", + "1.968813625142143,", + "1.5857864376269053 0 1.4142135623730951 0.6562712083807143", + "0.6562712083807143,", + "17.60303038033002 6.727922061357858 2.2426406871192857", + "12.548030540759331 8.062749166520762"), + R_inv_str=("-1.4118746341171051 0.4345522334964639 0.6518283502446959", + "0.21727611674823194 -0.13701474018997217,", + "-3.3639610306789285 0 0.7071067811865475 0 0,", + "-1.1213203435596428 0 0 0.7071067811865475 0,", + "0.671336061515156 0.18208981448197611 -0.7875254500568571", + "-0.2625084833522857 0.16553835820737872,", + "5.156617435753728 -1.2321237478911191 -0.7875254500568571", + "-0.2625084833522857 0.16553835820737872"), + wavespeeds_str="4.4 4.4 4.4 6.046329250180534 2.753670749819466", + char_fluxes_pos_str=("2.2324228059144673 7.380909114098994", + "2.4603030380329987 15.885347333048884 0.9465242322295992,", + "0.5214705489522515 -3.9764501987817145", + "-1.3254833995939053 1.3413036144786457 3.767119678640133"), + char_fluxes_neg_str=("-0.2965647431231918 -0.3514718625761428", + "-0.1171572875253809 -1.6097440213843948 -0.5689873221894901,", + "-0.018976427428922138 1.4911688245431431", + "0.49705627484771453 -0.05753157056903602 -1.432380835542713"), + weno_weights_pos_str=("0.9999999999574652 0.999999999999978", + "0.9999999999982254 0.9999999999999919 0.9999999999942413,", + "3.9384014966385437e-11 2.0284497966079935e-14", + "1.6430428067143077e-12 7.542808138536806e-15 5.332240836330361e-12,", + "3.1507308840273685e-12 1.622759950511315e-15", + "1.3144350707803127e-13 6.034246767570432e-16 4.265797494767529e-13"), + weno_weights_neg_str=("0.9999999386221037 0.9999999999683822", + "0.9999999974390363 0.9999999999372101 0.9999999993440752,", + "5.68308936788955e-8 2.9275831062158654e-11", + "2.3712585027633853e-9 5.8138848037057226e-11 6.073372407373299e-10,", + "4.547002513715645e-9 2.3420726930957915e-12", + "1.897052057748541e-10 4.6511252168302e-12 4.8587565862160355e-11"), + consistent_str="5. 20.4 27. 9. 147.", + dissipation_pos_str=("3.281326602835503 16.54629350160538", + "23.641315459112736 7.8804384863675505 137.3884413587739"), + dissipation_neg_str=("0.2813265968286516 1.7462934823903076", + "2.641315430506613 0.8804384760489334 15.588441251607525"), + weno_flux=("8.562653199664155 38.69258698399568", + "53.28263088961935 17.760876962416482 299.9768826103814"), direction="y") single_data["Case c:z"] = FluxDataSingle( - states_str="2 4 8 12 64,1 1 2 3 11", - fluxes_str="12 24 48 75.2 403.2,3 3 6 10.6 37.8", + states_str="2 12 4 8 64,1 3 1 2 11", + fluxes_str="12 75.2 24 48 403.2,3 10.6 3 6 37.8", lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," "3. 3. 3. 4.496662954709576 1.5033370452904236"), - R_str=1 0 0 0.41384589551844686 0.41384589551844686 - 4.757359312880716 0 0 2.6759204063286903 1.2617068439555954 - 1.5857864376269053 1.4142135623730951 0 0.6562712083807143 - 0.6562712083807143 - 3.1715728752538106 0 1.4142135623730951 1.3125424167614286 - 1.3125424167614286 - 17.60303038033002 2.2426406871192857 4.485281374238571 - 13.669350884318975 6.941428822961119 - - R_inv_str=-1.4118746341171051 0.6518283502446959 - 0.21727611674823194 0.4345522334964639 -0.13701474018997217 - -1.1213203435596428 0 0.7071067811865475 0 0 - -2.2426406871192857 0 0 0.7071067811865475 0 - -0.4499842820444868 -0.08041866887030964 -0.2625084833522857 - -0.5250169667045714 0.16553835820737872 - 6.27793777931337 -1.4946322312434048 -0.2625084833522857 - -0.5250169667045714 0.16553835820737872 - - wavespeeds_str=6.6,6.6,6.6,8.246329250180533,4.953670749819467 - - char_fluxes_pos_str=3.348634208871708,3.690454557049497,7.380909114098994,26.24407281945101,-0.9962654715332988},{0.7822058234283737,-1.9882250993908581,-3.9764501987817162,-0.6952990612264269,8.357934000904585 - - char_fluxes_neg_str=-0.44484711468478866,-0.1757359312880714,-0.3514718625761428,-2.447320076091316,-0.8207769392695052},{-0.02846464114338254,0.7455844122715716,1.4911688245431431,0.8126310150223119,-3.0474996241899346 - - weno_weights_pos_str=0.999999999991598,0.9999999999996494,0.999999999999978,0.9999999999999993,0.9999999999999524},{7.779580658268568*10^-12,3.2455185423228674*10^-13,2.028449796607992*10^-14,6.408020704124379*10^-16,4.408056940300416*10^-14},{6.223673030753551*10^-13,2.596415558497523*10^-14,1.6227599505113154*10^-15,5.126416626873783*10^-17,3.526445914956101*10^-15 - - weno_weights_neg_str=0.9999999878747177,0.9999999994941201,0.9999999999683822,0.9999999999967727,0.9999999999851737},{1.1227070122726888*10^-8,4.684070887233427*10^-10,2.9275831062158654*10^-11,2.988331869942141*10^-12,1.372802081812638*10^-11},{8.982122341016933*10^-10,3.747296441221644*10^-11,2.3420726930957915*10^-12,2.390667520553204*10^-13,1.0982436589127136*10^-12 - - consistent_str=7.5,42.9,13.5,27.,220.5 - - dissipation_pos_str=4.921989904281101,36.24738971766925,11.82065772959958,23.641315459201046,206.08266203865145 + R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", + "4.757359312880716 0 0 2.6759204063286903 1.2617068439555954,", + "1.5857864376269053 1.4142135623730951 0 0.6562712083807143", + "0.6562712083807143,", + "3.1715728752538106 0 1.4142135623730951 1.3125424167614286", + "1.3125424167614286,", + "17.60303038033002 2.2426406871192857 4.485281374238571", + "13.669350884318975 6.941428822961119"), + R_inv_str=("-1.4118746341171051 0.6518283502446959", + "0.21727611674823194 0.4345522334964639 -0.13701474018997217,", + "-1.1213203435596428 0 0.7071067811865475 0 0,", + "-2.2426406871192857 0 0 0.7071067811865475 0,", + "-0.4499842820444868 -0.08041866887030964 -0.2625084833522857", + "-0.5250169667045714 0.16553835820737872,", + "6.27793777931337 -1.4946322312434048 -0.2625084833522857", + "-0.5250169667045714 0.16553835820737872"), + wavespeeds_str="6.6 6.6 6.6 8.246329250180533 4.953670749819467", + char_fluxes_pos_str=("3.348634208871708 3.690454557049497", + "7.380909114098994 26.24407281945101 -0.9962654715332988,", + "0.7822058234283737 -1.9882250993908581", + "-3.9764501987817162 -0.6952990612264269 8.357934000904585"), + char_fluxes_neg_str=("-0.44484711468478866 -0.1757359312880714", + "-0.3514718625761428 -2.447320076091316 -0.8207769392695052,", + "-0.02846464114338254 0.7455844122715716", + "1.4911688245431431 0.8126310150223119 -3.0474996241899346"), + weno_weights_pos_str=("0.999999999991598 0.9999999999996494", + "0.999999999999978 0.9999999999999993 0.9999999999999524,", + "7.779580658268568e-12 3.2455185423228674e-13", + "2.028449796607992e-14 6.408020704124379e-16 4.408056940300416e-14,", + "6.223673030753551e-13 2.596415558497523e-14", + "1.6227599505113154e-15 5.126416626873783e-17 3.526445914956101e-15"), + weno_weights_neg_str=("0.9999999878747177 0.9999999994941201", + "0.9999999999683822 0.9999999999967727 0.9999999999851737,", + "1.1227070122726888e-8 4.684070887233427e-10", + "2.9275831062158654e-11 2.988331869942141e-12 1.372802081812638e-11,", + "8.982122341016933e-10 3.747296441221644e-11", + "2.3420726930957915e-12 2.390667520553204e-13 1.0982436589127136e-12"), + consistent_str="7.5 42.9 13.5 27. 220.5", + dissipation_pos_str=("4.921989904281101 36.24738971766925", + "11.82065772959958 23.641315459201046 206.08266203865145"), + dissipation_neg_str=("0.4219899024845117 3.9473897091113366", + "1.3206577265155963 2.6413154534736667 23.382662006532225"), + weno_flux=("12.843979806765613 83.09477942678058", + "26.641315456115176 53.28263091267471 449.9653240451837"), + direction="z") - dissipation_neg_str=0.4219899024845117,3.9473897091113366,1.3206577265155963,2.6413154534736667,23.382662006532225 +# }}} - weno_flux=12.843979806765613,83.09477942678058,26.641315456115176,53.28263091267471,449.9653240451837 +# {{{ Input data: Case (d) - direction="z") single_data["Case d:x"] = FluxDataSingle( states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str=1 0 0 0.41384589551844686 0.41384589551844686 - -1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262 - -3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 - -1.3125424167614286 - -4.757359312880716 0 1.4142135623730951 -1.968813625142143 - -1.968813625142143 - 17.60303038033002 -4.485281374238571 -6.727922061357858 - 9.184069510080404 11.42671019719969 - - R_inv_str=-1.4118746341171051 -0.21727611674823194 - -0.4345522334964639 -0.6518283502446959 -0.13701474018997217 - 2.2426406871192857 0 0.7071067811865475 0 0 - 3.3639610306789285 0 0 0.7071067811865475 0 - 4.035297092194084 0.9696152645388333 0.5250169667045714 - 0.7875254500568571 0.16553835820737872 - 1.7926564050747988 -0.4445982978342618 0.5250169667045714 - 0.7875254500568571 0.16553835820737872 - - wavespeeds_str=2.2,2.2,2.2,0.553670749819466,3.8463292501805344 - - char_fluxes_pos_str=0.009488213714461069,0.49705627484771453,0.7455844122715716,0.31431832174320373,0.4306378813126712},{0.1482823715615963,-0.1171572875253809,-0.1757359312880714,0.20004041758408686,0.8893252542028551 - - char_fluxes_neg_str=-0.26073527447612554,-1.3254833995939053,-1.9882250993908572,-0.5017887559695788,-2.052422890589809},{-1.1162114029572359,2.4603030380329987,3.690454557049497,-0.4290108979594782,-7.986924884679773 - - weno_weights_pos_str=0.9999990185022956,0.9999999974390363,0.9999999994941201,0.9999978651320311,0.9999999917661908},{9.08762722250494*10^-7,2.3712585027633853*10^-9,4.684070887233427*10^-10,1.976628702372801*10^-6,7.62387333908512*10^-9},{7.27349821618269*10^-8,1.897052057748541*10^-10,3.747296441221644*10^-11,1.5823926647977797*10^-7,6.099359570650648*10^-10 - - weno_weights_neg_str=0.999999999319454,0.9999999999982254,0.9999999999996494,0.9999870425235151,0.9999999999997061},{6.301345524776077*10^-10,1.6430428067143077*10^-12,3.245518542322869*10^-13,0.000011996153712066484,2.721049684463335*10^-13},{5.041138413805998*10^-11,1.3144350707803127*10^-13,2.5964155584975223*10^-14,9.613227729623656*10^-7,2.1768403038595738*10^-14 - - consistent_str=-2.5,6.9,9.,13.5,-73.5 - - dissipation_pos_str=-0.14066328824586258,0.42563568844302985,0.8804384437989112,1.3206576666570364,-7.7942206041633595 - - dissipation_neg_str=-1.6406634409601506,4.725635754575325,7.88043892893644,11.820658393408754,-68.69422377699841 - - weno_flux=-4.281326729206013,12.051271443018354,17.76087737273535,26.641316060065794,-149.98844438116177 - + R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", + "-1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262,", + "-3.1715728752538106 1.4142135623730951 0 -1.3125424167614286", + "-1.3125424167614286,", + "-4.757359312880716 0 1.4142135623730951 -1.968813625142143", + "-1.968813625142143,", + "17.60303038033002 -4.485281374238571 -6.727922061357858", + "9.184069510080404 11.42671019719969"), + R_inv_str=("-1.4118746341171051 -0.21727611674823194", + "-0.4345522334964639 -0.6518283502446959 -0.13701474018997217,", + "2.2426406871192857 0 0.7071067811865475 0 0,", + "3.3639610306789285 0 0 0.7071067811865475 0,", + "4.035297092194084 0.9696152645388333 0.5250169667045714", + "0.7875254500568571 0.16553835820737872,", + "1.7926564050747988 -0.4445982978342618 0.5250169667045714", + "0.7875254500568571 0.16553835820737872"), + wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", + char_fluxes_pos_str=("0.009488213714461069 0.49705627484771453", + "0.7455844122715716 0.31431832174320373 0.4306378813126712,", + "0.1482823715615963 -0.1171572875253809", + "-0.1757359312880714 0.20004041758408686 0.8893252542028551"), + char_fluxes_neg_str=("-0.26073527447612554 -1.3254833995939053", + "-1.9882250993908572 -0.5017887559695788 -2.052422890589809,", + "-1.1162114029572359 2.4603030380329987", + "3.690454557049497 -0.4290108979594782 -7.986924884679773"), + weno_weights_pos_str=("0.9999990185022956 0.9999999974390363", + "0.9999999994941201 0.9999978651320311 0.9999999917661908,", + "9.08762722250494e-7 2.3712585027633853e-9", + "4.684070887233427e-10 1.976628702372801e-6 7.62387333908512e-9,", + "7.27349821618269e-8 1.897052057748541e-10", + "3.747296441221644e-11 1.5823926647977797e-7 6.099359570650648e-10"), + weno_weights_neg_str=("0.999999999319454 0.9999999999982254", + "0.9999999999996494 0.9999870425235151 0.9999999999997061,", + "6.301345524776077e-10 1.6430428067143077e-12", + "3.245518542322869e-13 0.000011996153712066484 2.721049684463335e-13,", + "5.041138413805998e-11 1.3144350707803127e-13", + "2.5964155584975223e-14 9.613227729623656e-7 2.1768403038595738e-14"), + consistent_str="-2.5 6.9 9. 13.5 -73.5", + dissipation_pos_str=("-0.14066328824586258 0.42563568844302985", + "0.8804384437989112 1.3206576666570364 -7.7942206041633595"), + dissipation_neg_str=("-1.6406634409601506 4.725635754575325", + "7.88043892893644 11.820658393408754 -68.69422377699841"), + weno_flux=("-4.281326729206013 12.051271443018354", + "17.76087737273535 26.641316060065794 -149.98844438116177"), direction="x") single_data["Case d:y"] = FluxDataSingle( - states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", - fluxes_str="-2 2 5.6 6 -25.2,-8 16 35.2 48 -268.8", + states_str="1 -2 -3 -1 11,2 -8 -12 -4 64", + fluxes_str="-2 5.6 6 2 -25.2,-8 35.2 48 16 -268.8", lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), - R_str=1 0 0 0.41384589551844686 0.41384589551844686 - -3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976 - -4.757359312880716 1.4142135623730951 0 -1.968813625142143 - -1.968813625142143 - -1.5857864376269053 0 1.4142135623730951 -0.6562712083807143 - -0.6562712083807143 - 17.60303038033002 -6.727922061357858 -2.2426406871192857 - 8.062749166520762 12.548030540759331 - - R_inv_str=-1.4118746341171051 -0.4345522334964639 - -0.6518283502446959 -0.21727611674823194 -0.13701474018997217 - 3.3639610306789285 0 0.7071067811865475 0 0 - 1.1213203435596428 0 0 0.7071067811865475 0 - 5.156617435753728 1.2321237478911191 0.7875254500568571 - 0.2625084833522857 0.16553835820737872 - 0.671336061515156 -0.18208981448197611 0.7875254500568571 - 0.2625084833522857 0.16553835820737872 - - wavespeeds_str=4.4,4.4,4.4,2.753670749819466,6.046329250180534 - - char_fluxes_pos_str=0.018976427428922138,1.4911688245431431,0.49705627484771453,1.432380835542713,0.05753157056903602},{0.2965647431231918,-0.3514718625761428,-0.1171572875253809,0.5689873221894901,1.6097440213843948 - - char_fluxes_neg_str=-0.5214705489522515,-3.9764501987817145,-1.3254833995939053,-3.767119678640133,-1.3413036144786457},{-2.2324228059144673,7.380909114098994,2.4603030380329987,-0.9465242322295992,-15.885347333048884 - - weno_weights_pos_str=0.9999999386221037,0.9999999999683822,0.9999999974390363,0.9999999993440752,0.9999999999372101},{5.68308936788955*10^-8,2.9275831062158654*10^-11,2.3712585027633853*10^-9,6.073372407373299*10^-10,5.8138848037057226*10^-11},{4.547002513715645*10^-9,2.3420726930957915*10^-12,1.897052057748541*10^-10,4.8587565862160355*10^-11,4.6511252168302*10^-12 - - weno_weights_neg_str=0.9999999999574652,0.999999999999978,0.9999999999982254,0.9999999999942413,0.9999999999999919},{3.9384014966385437*10^-11,2.0284497966079935*10^-14,1.6430428067143077*10^-12,5.332240836330361*10^-12,7.542808138536806*10^-15},{3.1507308840273685*10^-12,1.622759950511315*10^-15,1.3144350707803127*10^-13,4.265797494767529*10^-13,6.034246767570432*10^-16 - - consistent_str=-5.,20.4,27.,9.,-147. - - dissipation_pos_str=-0.2813265968286516,1.7462934823903074,2.641315430506612,0.8804384760489334,-15.588441251607525 - - dissipation_neg_str=-3.281326602835503,16.54629350160538,23.641315459112736,7.880438486367551,-137.3884413587739 - - weno_flux=-8.562653199664155,38.69258698399569,53.28263088961934,17.760876962416486,-299.97688261038144 - + R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", + "-3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976,", + "-4.757359312880716 1.4142135623730951 0 -1.968813625142143", + "-1.968813625142143,", + "-1.5857864376269053 0 1.4142135623730951 -0.6562712083807143", + "-0.6562712083807143,", + "17.60303038033002 -6.727922061357858 -2.2426406871192857", + "8.062749166520762 12.548030540759331"), + R_inv_str=("-1.4118746341171051 -0.4345522334964639", + "-0.6518283502446959 -0.21727611674823194 -0.13701474018997217,", + "3.3639610306789285 0 0.7071067811865475 0 0,", + "1.1213203435596428 0 0 0.7071067811865475 0,", + "5.156617435753728 1.2321237478911191 0.7875254500568571", + "0.2625084833522857 0.16553835820737872,", + "0.671336061515156 -0.18208981448197611 0.7875254500568571", + "0.2625084833522857 0.16553835820737872"), + wavespeeds_str="4.4 4.4 4.4 2.753670749819466 6.046329250180534", + char_fluxes_pos_str=("0.018976427428922138 1.4911688245431431", + "0.49705627484771453 1.432380835542713 0.05753157056903602,", + "0.2965647431231918 -0.3514718625761428", + "-0.1171572875253809 0.5689873221894901 1.6097440213843948"), + char_fluxes_neg_str=("-0.5214705489522515 -3.9764501987817145", + "-1.3254833995939053 -3.767119678640133 -1.3413036144786457,", + "-2.2324228059144673 7.380909114098994", + "2.4603030380329987 -0.9465242322295992 -15.885347333048884"), + weno_weights_pos_str=("0.9999999386221037 0.9999999999683822", + "0.9999999974390363 0.9999999993440752 0.9999999999372101,", + "5.68308936788955e-8 2.9275831062158654e-11", + "2.3712585027633853e-9 6.073372407373299e-10 5.8138848037057226e-11,", + "4.547002513715645e-9 2.3420726930957915e-12", + "1.897052057748541e-10 4.8587565862160355e-11 4.6511252168302e-12"), + weno_weights_neg_str=("0.9999999999574652 0.999999999999978", + "0.9999999999982254 0.9999999999942413 0.9999999999999919,", + "3.9384014966385437e-11 2.0284497966079935e-14", + "1.6430428067143077e-12 5.332240836330361e-12 7.542808138536806e-15,", + "3.1507308840273685e-12 1.622759950511315e-15", + "1.3144350707803127e-13 4.265797494767529e-13 6.034246767570432e-16"), + consistent_str="-5. 20.4 27. 9. -147.", + dissipation_pos_str=("-0.2813265968286516 1.7462934823903074", + "2.641315430506612 0.8804384760489334 -15.588441251607525"), + dissipation_neg_str=("-3.281326602835503 16.54629350160538", + "23.641315459112736 7.880438486367551 -137.3884413587739"), + weno_flux=("-8.562653199664155 38.69258698399569", + "53.28263088961934 17.760876962416486 -299.97688261038144"), direction="y") single_data["Case d:z"] = FluxDataSingle( - states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", - fluxes_str="-3 3 6 10.6 -37.8,-12 24 48 75.2 -403.2", + states_str="1 -3 -1 -2 11,2 -12 -4 -8 64", + fluxes_str="-3 10.6 3 6 -37.8,-12 75.2 24 48 -403.2", lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," "-6. -6. -6. -4.503337045290424 -7.496662954709576"), - R_str=1 0 0 0.41384589551844686 0.41384589551844686 - -4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903 - -1.5857864376269053 1.4142135623730951 0 -0.6562712083807143 - -0.6562712083807143 - -3.1715728752538106 0 1.4142135623730951 -1.3125424167614286 - -1.3125424167614286 - 17.60303038033002 -2.2426406871192857 -4.485281374238571 - 6.941428822961119 13.669350884318975 - - R_inv_str=-1.4118746341171051 -0.6518283502446959 - -0.21727611674823194 -0.4345522334964639 -0.13701474018997217 - 1.1213203435596428 0 0.7071067811865475 0 0 - 2.2426406871192857 0 0 0.7071067811865475 0 - 6.27793777931337 1.4946322312434048 0.2625084833522857 - 0.5250169667045714 0.16553835820737872 - -0.4499842820444868 0.08041866887030964 0.2625084833522857 - 0.5250169667045714 0.16553835820737872 - - wavespeeds_str=6.6,6.6,6.6,4.953670749819467,8.246329250180533 - - char_fluxes_pos_str=0.02846464114338254,0.7455844122715716,1.4911688245431431,3.0474996241899346,-0.8126310150223119},{0.44484711468478866,-0.1757359312880714,-0.3514718625761428,0.8207769392695052,2.447320076091316 - - char_fluxes_neg_str=-0.7822058234283737,-1.9882250993908581,-3.9764501987817162,-8.357934000904585,0.6952990612264269},{-3.348634208871708,3.690454557049497,7.380909114098994,0.9962654715332988,-26.24407281945101 - - weno_weights_pos_str=0.9999999878747177,0.9999999994941201,0.9999999999683822,0.9999999999851737,0.9999999999967727},{1.1227070122726888*10^-8,4.684070887233427*10^-10,2.9275831062158654*10^-11,1.372802081812638*10^-11,2.988331869942141*10^-12},{8.982122341016933*10^-10,3.747296441221644*10^-11,2.3420726930957915*10^-12,1.0982436589127136*10^-12,2.390667520553204*10^-13 - - weno_weights_neg_str=0.999999999991598,0.9999999999996494,0.999999999999978,0.9999999999999524,0.9999999999999993},{7.779580658268568*10^-12,3.2455185423228674*10^-13,2.028449796607992*10^-14,4.408056940300416*10^-14,6.408020704124379*10^-16},{6.223673030753551*10^-13,2.596415558497523*10^-14,1.6227599505113154*10^-15,3.526445914956101*10^-15,5.126416626873783*10^-17 - - consistent_str=-7.5,42.9,13.5,27.,-220.5 - - dissipation_pos_str=-0.42198990248451174,3.947389709111337,1.3206577265155963,2.6413154534736667,-23.382662006532225 - - dissipation_neg_str=-4.9219899042811,36.247389717669265,11.820657729599578,23.641315459201046,-206.08266203865145 - - weno_flux=-12.843979806765612,83.09477942678059,26.641315456115173,53.28263091267471,-449.9653240451837 - + R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", + "-4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903,", + "-1.5857864376269053 1.4142135623730951 0 -0.6562712083807143", + "-0.6562712083807143,", + "-3.1715728752538106 0 1.4142135623730951 -1.3125424167614286", + "-1.3125424167614286,", + "17.60303038033002 -2.2426406871192857 -4.485281374238571", + "6.941428822961119 13.669350884318975"), + R_inv_str=("-1.4118746341171051 -0.6518283502446959", + "-0.21727611674823194 -0.4345522334964639 -0.13701474018997217,", + "1.1213203435596428 0 0.7071067811865475 0 0,", + "2.2426406871192857 0 0 0.7071067811865475 0,", + "6.27793777931337 1.4946322312434048 0.2625084833522857", + "0.5250169667045714 0.16553835820737872,", + "-0.4499842820444868 0.08041866887030964 0.2625084833522857", + "0.5250169667045714 0.16553835820737872"), + wavespeeds_str="6.6 6.6 6.6 4.953670749819467 8.246329250180533", + char_fluxes_pos_str=("0.02846464114338254 0.7455844122715716", + "1.4911688245431431 3.0474996241899346 -0.8126310150223119,", + "0.44484711468478866 -0.1757359312880714", + "-0.3514718625761428 0.8207769392695052 2.447320076091316"), + char_fluxes_neg_str=("-0.7822058234283737 -1.9882250993908581", + "-3.9764501987817162 -8.357934000904585 0.6952990612264269,", + "-3.348634208871708 3.690454557049497", + "7.380909114098994 0.9962654715332988 -26.24407281945101"), + weno_weights_pos_str=("0.9999999878747177 0.9999999994941201", + "0.9999999999683822 0.9999999999851737 0.9999999999967727,", + "1.1227070122726888e-8 4.684070887233427e-10", + "2.9275831062158654e-11 1.372802081812638e-11 2.988331869942141e-12,", + "8.982122341016933e-10 3.747296441221644e-11", + "2.3420726930957915e-12 1.0982436589127136e-12 2.390667520553204e-13"), + weno_weights_neg_str=("0.999999999991598 0.9999999999996494", + "0.999999999999978 0.9999999999999524 0.9999999999999993,", + "7.779580658268568e-12 3.2455185423228674e-13", + "2.028449796607992e-14 4.408056940300416e-14 6.408020704124379e-16,", + "6.223673030753551e-13 2.596415558497523e-14", + "1.6227599505113154e-15 3.526445914956101e-15 5.126416626873783e-17"), + consistent_str="-7.5 42.9 13.5 27. -220.5", + dissipation_pos_str=("-0.42198990248451174 3.947389709111337", + "1.3206577265155963 2.6413154534736667 -23.382662006532225"), + dissipation_neg_str=("-4.9219899042811 36.247389717669265", + "11.820657729599578 23.641315459201046 -206.08266203865145"), + weno_flux=("-12.843979806765612 83.09477942678059", + "26.641315456115173 53.28263091267471 -449.9653240451837"), direction="z") +# }}} + @pytest.fixture(scope="session", params=[ - "Case a:x", "Case a:y", "Case a:z", - "Case b:x", "Case b:y", "Case b:z", - "Case c:x", "Case c:y", "Case c:z", - "Case d:x", "Case d:y", "Case d:z"]) + "Case a:x"#, "Case a:y", "Case a:z", + "Case b:x"#, "Case b:y", "Case b:z", + "Case c:x"#, "Case c:y", "Case c:z", + "Case d:x"])#, "Case d:y", "Case d:z"]) def data(request): return single_data[request.param] +# vim: foldmethod=marker -- GitLab From a19a12efc3f8277768df6968ab1f5be0516584c7 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:33:15 -0500 Subject: [PATCH 23/60] fix some formatting/syntax issues with data --- input.py | 536 +++++++++++++++++++++++++++---------------------------- 1 file changed, 268 insertions(+), 268 deletions(-) diff --git a/input.py b/input.py index 4aec1c5..204fcba 100644 --- a/input.py +++ b/input.py @@ -57,49 +57,49 @@ single_data["Case a:x"] = FluxDataSingle( fluxes_str="4 11.2 8 8 46.4,1 2.6 1 1 7.1", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str=("1 0 0 0.45781245952886396 0.45781245952886396,", - "1.5857864376269053 0 0 1.4330995704840366 0.018886008110941373,", - "1.5857864376269053 1.4142135623730951 0 0.7259927892974889", - "0.7259927892974889,", - "1.5857864376269053 0 1.4142135623730951 0.7259927892974889", - "0.7259927892974889,", - "3.7720779386421466 2.2426406871192857 2.2426406871192857", + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "1.5857864376269053 0 0 1.4330995704840366 0.018886008110941373," + "1.5857864376269053 1.4142135623730951 0 0.7259927892974889 " + "0.7259927892974889," + "1.5857864376269053 0 1.4142135623730951 0.7259927892974889 " + "0.7259927892974889," + "3.7720779386421466 2.2426406871192857 2.2426406871192857 " "5.578600290173388 3.335959603054103"), - R_inv_str=("0.36752136386566203 0.265894835574803 0.265894835574803", - "0.265894835574803 -0.16767379847989416,", - "-1.1213203435596428 0 0.7071067811865475 0 0,", - "-1.1213203435596428 0 0 0.7071067811865475 0,", - "-0.43055863210991147 0.41670966546755195 -0.2903971157189956", - "-0.2903971157189956 0.1831249838115456,", - "1.8120820550093746 -0.9975038969055432 -0.2903971157189956", + R_inv_str=("0.36752136386566203 0.265894835574803 0.265894835574803 " + "0.265894835574803 -0.16767379847989416," + "-1.1213203435596428 0 0.7071067811865475 0 0," + "-1.1213203435596428 0 0 0.7071067811865475 0," + "-0.43055863210991147 0.41670966546755195 -0.2903971157189956 " + "-0.2903971157189956 0.1831249838115456," + "1.8120820550093746 -0.9975038969055432 -0.2903971157189956 " "-0.2903971157189956 0.1831249838115456"), wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", - char_fluxes_pos_str=("1.0907156303492833 1.2301515190164993", - "1.2301515190164993 7.523052586013577 0.23295627081394965,", - "0.4673767959969717 -0.6627416997969526", + char_fluxes_pos_str=("1.0907156303492833 1.2301515190164993 " + "1.2301515190164993 7.523052586013577 0.23295627081394965," + "0.4673767959969717 -0.6627416997969526 " "-0.6627416997969526 1.4795302623674356 0.3125273038443238"), - char_fluxes_neg_str=("-0.16835489671908455 -0.05857864376269045", - "-0.05857864376269045 -0.7274934638648571 -0.30602629876675014,", - "-0.06722315769446469 0.24852813742385726", + char_fluxes_neg_str=("-0.16835489671908455 -0.05857864376269045 " + "-0.05857864376269045 -0.7274934638648571 -0.30602629876675014," + "-0.06722315769446469 0.24852813742385726 " "0.24852813742385726 -0.10725061063772967 -0.37456222716537935"), - weno_weights_pos_str=("0.999999997585736 0.9999999999716082", - "0.9999999999716082 0.9999999999997268 0.9999909282503908,", - "2.2354258683870077e-9 2.6288602366075745e-11", - "2.6288602366075745e-11 2.5299566294114733e-13 8.39888391917283e-6,", - "1.788382117901561e-10 2.1030934718853924e-12", + weno_weights_pos_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999999999997268 0.9999909282503908," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 2.5299566294114733e-13 8.39888391917283e-6," + "1.788382117901561e-10 2.1030934718853924e-12 " "2.1030934718853924e-12 2.0239658022589593e-14 6.728656898188601e-7"), - weno_weights_neg_str=("0.9999965203327451 0.999999959029252", - "0.999999959029252 0.9999999975371708 0.9999835300215946,", - "3.2217041402391125e-6 3.793560951911702e-8", - "3.793560951911702e-8 2.2803933579018906e-9 0.000015247816238787948,", - "2.579631146567429e-7 3.0351383606886035e-9", + weno_weights_neg_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999999975371708 0.9999835300215946," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 2.2803933579018906e-9 0.000015247816238787948," + "2.579631146567429e-7 3.0351383606886035e-9 " "3.0351383606886035e-9 1.824357365679662e-10 1.2221621667041045e-6"), consistent_str="2.5 6.9 4.5 4.5 26.75", - dissipation_pos_str=("1.6768551393982627 4.8239743723334865", + dissipation_pos_str=("1.6768551393982627 4.8239743723334865 " "3.997611768980551 3.997611768980551 22.145196359962693"), - dissipation_neg_str=("0.1768550804014161 0.523974175351619", + dissipation_neg_str=("0.1768550804014161 0.523974175351619 " "0.4976116690805634 0.4976116690805634 2.495196349669178"), - weno_flux=("4.353710219799678 12.247948547685105 8.995223438061114", + weno_flux_str=("4.353710219799678 12.247948547685105 8.995223438061114 " "8.995223438061114 51.39039270963187"), direction="x") @@ -112,50 +112,50 @@ single_data["Case b:x"] = FluxDataSingle( fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str=("1 0 0 0.45781245952886396 0.45781245952886396,", - "-1.5857864376269053 0 0 -0.018886008110941373", - "-1.4330995704840366,", - "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889", - "-0.7259927892974889,", - "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889", - "-0.7259927892974889,", - "3.7720779386421466 -2.2426406871192857 -2.2426406871192857", + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "-1.5857864376269053 0 0 -0.018886008110941373 " + "-1.4330995704840366," + "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " + "-0.7259927892974889," + "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " + "-0.7259927892974889," + "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " "3.335959603054103 5.578600290173388"), - R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803", - "-0.265894835574803 -0.16767379847989416,", - "1.1213203435596428 0 0.7071067811865475 0 0,", - "1.1213203435596428 0 0 0.7071067811865475 0,", - "1.8120820550093746 0.9975038969055432 0.2903971157189956", - "0.2903971157189956 0.1831249838115456,", - "-0.43055863210991147 -0.41670966546755195 0.2903971157189956", + R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " + "-0.265894835574803 -0.16767379847989416," + "1.1213203435596428 0 0.7071067811865475 0 0," + "1.1213203435596428 0 0 0.7071067811865475 0," + "1.8120820550093746 0.9975038969055432 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456," + "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " "0.2903971157189956 0.1831249838115456"), wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", - char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726", - "0.24852813742385726 0.37456222716537935 0.10725061063772967,", - "0.16835489671908455 -0.05857864376269045", + char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " + "0.24852813742385726 0.37456222716537935 0.10725061063772967," + "0.16835489671908455 -0.05857864376269045 " "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), - char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526", - "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356,", - "-1.0907156303492833 1.2301515190164993", + char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " + "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," + "-1.0907156303492833 1.2301515190164993 " "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), - weno_weights_pos_str=("0.9999965203327451 0.999999959029252", - "0.999999959029252 0.9999835300215946 0.9999999975371708,", - "3.2217041402391125e-6 3.793560951911702e-8", - "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9,", - "2.579631146567429e-7 3.0351383606886035e-9", + weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999835300215946 0.9999999975371708," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," + "2.579631146567429e-7 3.0351383606886035e-9 " "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), - weno_weights_neg_str=("0.999999997585736 0.9999999999716082", - "0.9999999999716082 0.9999909282503908 0.9999999999997268,", - "2.2354258683870077e-9 2.6288602366075745e-11", - "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13,", - "1.788382117901561e-10 2.1030934718853924e-12", + weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999909282503908 0.9999999999997268," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," + "1.788382117901561e-10 2.1030934718853924e-12 " "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", - dissipation_pos_str=("-0.17685508040141606 0.523974175351619", + dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " "0.49761166908056337 0.49761166908056337 -2.495196349669178"), - dissipation_neg_str=("-1.6768551393982627 4.823974372333487", + dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " "3.9976117689805504 3.9976117689805504 -22.145196359962693"), - weno_flux=("4.353710219799678 12.247948547685105", + weno_flux_str=("4.353710219799678 12.247948547685105 " "8.995223438061114 8.995223438061114 -51.390392709631875"), direction="x") @@ -168,49 +168,49 @@ single_data["Case c:x"] = FluxDataSingle( fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", - "1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326,", - "3.1715728752538106 1.4142135623730951 0 1.3125424167614286", - "1.3125424167614286,", - "4.757359312880716 0 1.4142135623730951 1.968813625142143", - "1.968813625142143,", - "17.60303038033002 4.485281374238571 6.727922061357858", + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326," + "3.1715728752538106 1.4142135623730951 0 1.3125424167614286 " + "1.3125424167614286," + "4.757359312880716 0 1.4142135623730951 1.968813625142143 " + "1.968813625142143," + "17.60303038033002 4.485281374238571 6.727922061357858 " "11.42671019719969 9.184069510080404"), - R_inv_str=("-1.4118746341171051 0.21727611674823194 0.4345522334964639", - "0.6518283502446959 -0.13701474018997217,", - "-2.2426406871192857 0 0.7071067811865475 0 0,", - "-3.3639610306789285 0 0 0.7071067811865475 0,", - "1.7926564050747988 0.4445982978342618 -0.5250169667045714", - "-0.7875254500568571 0.16553835820737872,", - "4.035297092194084 -0.9696152645388333 -0.5250169667045714", + R_inv_str=("-1.4118746341171051 0.21727611674823194 0.4345522334964639 " + "0.6518283502446959 -0.13701474018997217," + "-2.2426406871192857 0 0.7071067811865475 0 0," + "-3.3639610306789285 0 0 0.7071067811865475 0," + "1.7926564050747988 0.4445982978342618 -0.5250169667045714 " + "-0.7875254500568571 0.16553835820737872," + "4.035297092194084 -0.9696152645388333 -0.5250169667045714 " "-0.7875254500568571 0.16553835820737872"), wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", - char_fluxes_pos_str=("1.1162114029572359 2.4603030380329987", - "3.690454557049497 7.986924884679773 0.4290108979594782,", - "0.26073527447612554 -1.3254833995939053", + char_fluxes_pos_str=("1.1162114029572359 2.4603030380329987 " + "3.690454557049497 7.986924884679773 0.4290108979594782," + "0.26073527447612554 -1.3254833995939053 " "-1.9882250993908572 2.052422890589809 0.5017887559695788"), - char_fluxes_neg_str=("-0.1482823715615963 -0.1171572875253809", - "-0.1757359312880714 -0.8893252542028551 -0.20004041758408686,", - "-0.009488213714461069 0.49705627484771453", + char_fluxes_neg_str=("-0.1482823715615963 -0.1171572875253809 " + "-0.1757359312880714 -0.8893252542028551 -0.20004041758408686," + "-0.009488213714461069 0.49705627484771453 " "0.7455844122715716 -0.4306378813126712 -0.31431832174320373"), - weno_weights_pos_str=("0.999999999319454 0.9999999999982254", - "0.9999999999996494 0.9999999999997061 0.9999870425235151,", - "6.301345524776077e-10 1.6430428067143077e-12", - "3.245518542322869e-13 2.721049684463335e-13 0.000011996153712066484,", - "5.041138413805998e-11 1.3144350707803127e-13", + weno_weights_pos_str=("0.999999999319454 0.9999999999982254 " + "0.9999999999996494 0.9999999999997061 0.9999870425235151," + "6.301345524776077e-10 1.6430428067143077e-12 " + "3.245518542322869e-13 2.721049684463335e-13 0.000011996153712066484," + "5.041138413805998e-11 1.3144350707803127e-13 " "2.5964155584975223e-14 2.1768403038595738e-14 9.613227729623656e-7"), - weno_weights_neg_str=("0.9999990185022956 0.9999999974390363", - "0.9999999994941201 0.9999999917661908 0.9999978651320311,", - "9.08762722250494e-7 2.3712585027633853e-9", - "4.684070887233427e-10 7.62387333908512e-9 1.976628702372801e-6,", - "7.27349821618269e-8 1.897052057748541e-10", + weno_weights_neg_str=("0.9999990185022956 0.9999999974390363 " + "0.9999999994941201 0.9999999917661908 0.9999978651320311," + "9.08762722250494e-7 2.3712585027633853e-9 " + "4.684070887233427e-10 7.62387333908512e-9 1.976628702372801e-6," + "7.27349821618269e-8 1.897052057748541e-10 " "3.747296441221644e-11 6.099359570650648e-10 1.5823926647977797e-7"), consistent_str="2.5 6.9 9. 13.5 73.5", - dissipation_pos_str=("1.6406634409601506 4.725635754575325", + dissipation_pos_str=("1.6406634409601506 4.725635754575325 " "7.88043892893644 11.820658393408754 68.69422377699841"), - dissipation_neg_str=("0.14066328824586258 0.4256356884430299", + dissipation_neg_str=("0.14066328824586258 0.4256356884430299 " "0.8804384437989111 1.3206576666570364 7.7942206041633595"), - weno_flux=("4.281326729206013 12.051271443018354", + weno_flux_str=("4.281326729206013 12.051271443018354 " "17.76087737273535 26.64131606006579 149.98844438116177"), direction="x") single_data["Case c:y"] = FluxDataSingle( @@ -218,49 +218,49 @@ single_data["Case c:y"] = FluxDataSingle( fluxes_str="8 35.2 48 16 268.8,2 5.6 6 2 25.2", lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," "2. 2. 2. 3.4966629547095764 0.5033370452904236"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", - "3.1715728752538106 0 0 2.019649197947976 0.605435635574881,", - "4.757359312880716 1.4142135623730951 0 1.968813625142143", - "1.968813625142143,", - "1.5857864376269053 0 1.4142135623730951 0.6562712083807143", - "0.6562712083807143,", - "17.60303038033002 6.727922061357858 2.2426406871192857", + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "3.1715728752538106 0 0 2.019649197947976 0.605435635574881," + "4.757359312880716 1.4142135623730951 0 1.968813625142143 " + "1.968813625142143," + "1.5857864376269053 0 1.4142135623730951 0.6562712083807143 " + "0.6562712083807143," + "17.60303038033002 6.727922061357858 2.2426406871192857 " "12.548030540759331 8.062749166520762"), - R_inv_str=("-1.4118746341171051 0.4345522334964639 0.6518283502446959", - "0.21727611674823194 -0.13701474018997217,", - "-3.3639610306789285 0 0.7071067811865475 0 0,", - "-1.1213203435596428 0 0 0.7071067811865475 0,", - "0.671336061515156 0.18208981448197611 -0.7875254500568571", - "-0.2625084833522857 0.16553835820737872,", - "5.156617435753728 -1.2321237478911191 -0.7875254500568571", + R_inv_str=("-1.4118746341171051 0.4345522334964639 0.6518283502446959 " + "0.21727611674823194 -0.13701474018997217," + "-3.3639610306789285 0 0.7071067811865475 0 0," + "-1.1213203435596428 0 0 0.7071067811865475 0," + "0.671336061515156 0.18208981448197611 -0.7875254500568571 " + "-0.2625084833522857 0.16553835820737872," + "5.156617435753728 -1.2321237478911191 -0.7875254500568571 " "-0.2625084833522857 0.16553835820737872"), wavespeeds_str="4.4 4.4 4.4 6.046329250180534 2.753670749819466", - char_fluxes_pos_str=("2.2324228059144673 7.380909114098994", - "2.4603030380329987 15.885347333048884 0.9465242322295992,", - "0.5214705489522515 -3.9764501987817145", + char_fluxes_pos_str=("2.2324228059144673 7.380909114098994 " + "2.4603030380329987 15.885347333048884 0.9465242322295992," + "0.5214705489522515 -3.9764501987817145 " "-1.3254833995939053 1.3413036144786457 3.767119678640133"), - char_fluxes_neg_str=("-0.2965647431231918 -0.3514718625761428", - "-0.1171572875253809 -1.6097440213843948 -0.5689873221894901,", - "-0.018976427428922138 1.4911688245431431", + char_fluxes_neg_str=("-0.2965647431231918 -0.3514718625761428 " + "-0.1171572875253809 -1.6097440213843948 -0.5689873221894901," + "-0.018976427428922138 1.4911688245431431 " "0.49705627484771453 -0.05753157056903602 -1.432380835542713"), - weno_weights_pos_str=("0.9999999999574652 0.999999999999978", - "0.9999999999982254 0.9999999999999919 0.9999999999942413,", - "3.9384014966385437e-11 2.0284497966079935e-14", - "1.6430428067143077e-12 7.542808138536806e-15 5.332240836330361e-12,", - "3.1507308840273685e-12 1.622759950511315e-15", + weno_weights_pos_str=("0.9999999999574652 0.999999999999978 " + "0.9999999999982254 0.9999999999999919 0.9999999999942413," + "3.9384014966385437e-11 2.0284497966079935e-14 " + "1.6430428067143077e-12 7.542808138536806e-15 5.332240836330361e-12," + "3.1507308840273685e-12 1.622759950511315e-15 " "1.3144350707803127e-13 6.034246767570432e-16 4.265797494767529e-13"), - weno_weights_neg_str=("0.9999999386221037 0.9999999999683822", - "0.9999999974390363 0.9999999999372101 0.9999999993440752,", - "5.68308936788955e-8 2.9275831062158654e-11", - "2.3712585027633853e-9 5.8138848037057226e-11 6.073372407373299e-10,", - "4.547002513715645e-9 2.3420726930957915e-12", + weno_weights_neg_str=("0.9999999386221037 0.9999999999683822 " + "0.9999999974390363 0.9999999999372101 0.9999999993440752," + "5.68308936788955e-8 2.9275831062158654e-11 " + "2.3712585027633853e-9 5.8138848037057226e-11 6.073372407373299e-10," + "4.547002513715645e-9 2.3420726930957915e-12 " "1.897052057748541e-10 4.6511252168302e-12 4.8587565862160355e-11"), consistent_str="5. 20.4 27. 9. 147.", - dissipation_pos_str=("3.281326602835503 16.54629350160538", + dissipation_pos_str=("3.281326602835503 16.54629350160538 " "23.641315459112736 7.8804384863675505 137.3884413587739"), - dissipation_neg_str=("0.2813265968286516 1.7462934823903076", + dissipation_neg_str=("0.2813265968286516 1.7462934823903076 " "2.641315430506613 0.8804384760489334 15.588441251607525"), - weno_flux=("8.562653199664155 38.69258698399568", + weno_flux_str=("8.562653199664155 38.69258698399568 " "53.28263088961935 17.760876962416482 299.9768826103814"), direction="y") single_data["Case c:z"] = FluxDataSingle( @@ -268,49 +268,49 @@ single_data["Case c:z"] = FluxDataSingle( fluxes_str="12 75.2 24 48 403.2,3 10.6 3 6 37.8", lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," "3. 3. 3. 4.496662954709576 1.5033370452904236"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", - "4.757359312880716 0 0 2.6759204063286903 1.2617068439555954,", - "1.5857864376269053 1.4142135623730951 0 0.6562712083807143", - "0.6562712083807143,", - "3.1715728752538106 0 1.4142135623730951 1.3125424167614286", - "1.3125424167614286,", - "17.60303038033002 2.2426406871192857 4.485281374238571", + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "4.757359312880716 0 0 2.6759204063286903 1.2617068439555954," + "1.5857864376269053 1.4142135623730951 0 0.6562712083807143 " + "0.6562712083807143," + "3.1715728752538106 0 1.4142135623730951 1.3125424167614286 " + "1.3125424167614286," + "17.60303038033002 2.2426406871192857 4.485281374238571 " "13.669350884318975 6.941428822961119"), - R_inv_str=("-1.4118746341171051 0.6518283502446959", - "0.21727611674823194 0.4345522334964639 -0.13701474018997217,", - "-1.1213203435596428 0 0.7071067811865475 0 0,", - "-2.2426406871192857 0 0 0.7071067811865475 0,", - "-0.4499842820444868 -0.08041866887030964 -0.2625084833522857", - "-0.5250169667045714 0.16553835820737872,", - "6.27793777931337 -1.4946322312434048 -0.2625084833522857", + R_inv_str=("-1.4118746341171051 0.6518283502446959 " + "0.21727611674823194 0.4345522334964639 -0.13701474018997217," + "-1.1213203435596428 0 0.7071067811865475 0 0," + "-2.2426406871192857 0 0 0.7071067811865475 0," + "-0.4499842820444868 -0.08041866887030964 -0.2625084833522857 " + "-0.5250169667045714 0.16553835820737872," + "6.27793777931337 -1.4946322312434048 -0.2625084833522857 " "-0.5250169667045714 0.16553835820737872"), wavespeeds_str="6.6 6.6 6.6 8.246329250180533 4.953670749819467", - char_fluxes_pos_str=("3.348634208871708 3.690454557049497", - "7.380909114098994 26.24407281945101 -0.9962654715332988,", - "0.7822058234283737 -1.9882250993908581", + char_fluxes_pos_str=("3.348634208871708 3.690454557049497 " + "7.380909114098994 26.24407281945101 -0.9962654715332988," + "0.7822058234283737 -1.9882250993908581 " "-3.9764501987817162 -0.6952990612264269 8.357934000904585"), - char_fluxes_neg_str=("-0.44484711468478866 -0.1757359312880714", - "-0.3514718625761428 -2.447320076091316 -0.8207769392695052,", - "-0.02846464114338254 0.7455844122715716", + char_fluxes_neg_str=("-0.44484711468478866 -0.1757359312880714 " + "-0.3514718625761428 -2.447320076091316 -0.8207769392695052," + "-0.02846464114338254 0.7455844122715716 " "1.4911688245431431 0.8126310150223119 -3.0474996241899346"), - weno_weights_pos_str=("0.999999999991598 0.9999999999996494", - "0.999999999999978 0.9999999999999993 0.9999999999999524,", - "7.779580658268568e-12 3.2455185423228674e-13", - "2.028449796607992e-14 6.408020704124379e-16 4.408056940300416e-14,", - "6.223673030753551e-13 2.596415558497523e-14", + weno_weights_pos_str=("0.999999999991598 0.9999999999996494 " + "0.999999999999978 0.9999999999999993 0.9999999999999524," + "7.779580658268568e-12 3.2455185423228674e-13 " + "2.028449796607992e-14 6.408020704124379e-16 4.408056940300416e-14," + "6.223673030753551e-13 2.596415558497523e-14 " "1.6227599505113154e-15 5.126416626873783e-17 3.526445914956101e-15"), - weno_weights_neg_str=("0.9999999878747177 0.9999999994941201", - "0.9999999999683822 0.9999999999967727 0.9999999999851737,", - "1.1227070122726888e-8 4.684070887233427e-10", - "2.9275831062158654e-11 2.988331869942141e-12 1.372802081812638e-11,", - "8.982122341016933e-10 3.747296441221644e-11", + weno_weights_neg_str=("0.9999999878747177 0.9999999994941201 " + "0.9999999999683822 0.9999999999967727 0.9999999999851737," + "1.1227070122726888e-8 4.684070887233427e-10 " + "2.9275831062158654e-11 2.988331869942141e-12 1.372802081812638e-11," + "8.982122341016933e-10 3.747296441221644e-11 " "2.3420726930957915e-12 2.390667520553204e-13 1.0982436589127136e-12"), consistent_str="7.5 42.9 13.5 27. 220.5", - dissipation_pos_str=("4.921989904281101 36.24738971766925", + dissipation_pos_str=("4.921989904281101 36.24738971766925 " "11.82065772959958 23.641315459201046 206.08266203865145"), - dissipation_neg_str=("0.4219899024845117 3.9473897091113366", + dissipation_neg_str=("0.4219899024845117 3.9473897091113366 " "1.3206577265155963 2.6413154534736667 23.382662006532225"), - weno_flux=("12.843979806765613 83.09477942678058", + weno_flux_str=("12.843979806765613 83.09477942678058 " "26.641315456115176 53.28263091267471 449.9653240451837"), direction="z") @@ -323,49 +323,49 @@ single_data["Case d:x"] = FluxDataSingle( fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", - "-1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262,", - "-3.1715728752538106 1.4142135623730951 0 -1.3125424167614286", - "-1.3125424167614286,", - "-4.757359312880716 0 1.4142135623730951 -1.968813625142143", - "-1.968813625142143,", - "17.60303038033002 -4.485281374238571 -6.727922061357858", + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "-1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262," + "-3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 " + "-1.3125424167614286," + "-4.757359312880716 0 1.4142135623730951 -1.968813625142143 " + "-1.968813625142143," + "17.60303038033002 -4.485281374238571 -6.727922061357858 " "9.184069510080404 11.42671019719969"), - R_inv_str=("-1.4118746341171051 -0.21727611674823194", - "-0.4345522334964639 -0.6518283502446959 -0.13701474018997217,", - "2.2426406871192857 0 0.7071067811865475 0 0,", - "3.3639610306789285 0 0 0.7071067811865475 0,", - "4.035297092194084 0.9696152645388333 0.5250169667045714", - "0.7875254500568571 0.16553835820737872,", - "1.7926564050747988 -0.4445982978342618 0.5250169667045714", + R_inv_str=("-1.4118746341171051 -0.21727611674823194 " + "-0.4345522334964639 -0.6518283502446959 -0.13701474018997217," + "2.2426406871192857 0 0.7071067811865475 0 0," + "3.3639610306789285 0 0 0.7071067811865475 0," + "4.035297092194084 0.9696152645388333 0.5250169667045714 " + "0.7875254500568571 0.16553835820737872," + "1.7926564050747988 -0.4445982978342618 0.5250169667045714 " "0.7875254500568571 0.16553835820737872"), wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", - char_fluxes_pos_str=("0.009488213714461069 0.49705627484771453", - "0.7455844122715716 0.31431832174320373 0.4306378813126712,", - "0.1482823715615963 -0.1171572875253809", + char_fluxes_pos_str=("0.009488213714461069 0.49705627484771453 " + "0.7455844122715716 0.31431832174320373 0.4306378813126712," + "0.1482823715615963 -0.1171572875253809 " "-0.1757359312880714 0.20004041758408686 0.8893252542028551"), - char_fluxes_neg_str=("-0.26073527447612554 -1.3254833995939053", - "-1.9882250993908572 -0.5017887559695788 -2.052422890589809,", - "-1.1162114029572359 2.4603030380329987", + char_fluxes_neg_str=("-0.26073527447612554 -1.3254833995939053 " + "-1.9882250993908572 -0.5017887559695788 -2.052422890589809," + "-1.1162114029572359 2.4603030380329987 " "3.690454557049497 -0.4290108979594782 -7.986924884679773"), - weno_weights_pos_str=("0.9999990185022956 0.9999999974390363", - "0.9999999994941201 0.9999978651320311 0.9999999917661908,", - "9.08762722250494e-7 2.3712585027633853e-9", - "4.684070887233427e-10 1.976628702372801e-6 7.62387333908512e-9,", - "7.27349821618269e-8 1.897052057748541e-10", + weno_weights_pos_str=("0.9999990185022956 0.9999999974390363 " + "0.9999999994941201 0.9999978651320311 0.9999999917661908," + "9.08762722250494e-7 2.3712585027633853e-9 " + "4.684070887233427e-10 1.976628702372801e-6 7.62387333908512e-9," + "7.27349821618269e-8 1.897052057748541e-10 " "3.747296441221644e-11 1.5823926647977797e-7 6.099359570650648e-10"), - weno_weights_neg_str=("0.999999999319454 0.9999999999982254", - "0.9999999999996494 0.9999870425235151 0.9999999999997061,", - "6.301345524776077e-10 1.6430428067143077e-12", - "3.245518542322869e-13 0.000011996153712066484 2.721049684463335e-13,", - "5.041138413805998e-11 1.3144350707803127e-13", + weno_weights_neg_str=("0.999999999319454 0.9999999999982254 " + "0.9999999999996494 0.9999870425235151 0.9999999999997061," + "6.301345524776077e-10 1.6430428067143077e-12 " + "3.245518542322869e-13 0.000011996153712066484 2.721049684463335e-13," + "5.041138413805998e-11 1.3144350707803127e-13 " "2.5964155584975223e-14 9.613227729623656e-7 2.1768403038595738e-14"), consistent_str="-2.5 6.9 9. 13.5 -73.5", - dissipation_pos_str=("-0.14066328824586258 0.42563568844302985", + dissipation_pos_str=("-0.14066328824586258 0.42563568844302985 " "0.8804384437989112 1.3206576666570364 -7.7942206041633595"), - dissipation_neg_str=("-1.6406634409601506 4.725635754575325", + dissipation_neg_str=("-1.6406634409601506 4.725635754575325 " "7.88043892893644 11.820658393408754 -68.69422377699841"), - weno_flux=("-4.281326729206013 12.051271443018354", + weno_flux_str=("-4.281326729206013 12.051271443018354 " "17.76087737273535 26.641316060065794 -149.98844438116177"), direction="x") single_data["Case d:y"] = FluxDataSingle( @@ -373,49 +373,49 @@ single_data["Case d:y"] = FluxDataSingle( fluxes_str="-2 5.6 6 2 -25.2,-8 35.2 48 16 -268.8", lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", - "-3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976,", - "-4.757359312880716 1.4142135623730951 0 -1.968813625142143", - "-1.968813625142143,", - "-1.5857864376269053 0 1.4142135623730951 -0.6562712083807143", - "-0.6562712083807143,", - "17.60303038033002 -6.727922061357858 -2.2426406871192857", + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "-3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976," + "-4.757359312880716 1.4142135623730951 0 -1.968813625142143 " + "-1.968813625142143," + "-1.5857864376269053 0 1.4142135623730951 -0.6562712083807143 " + "-0.6562712083807143," + "17.60303038033002 -6.727922061357858 -2.2426406871192857 " "8.062749166520762 12.548030540759331"), - R_inv_str=("-1.4118746341171051 -0.4345522334964639", - "-0.6518283502446959 -0.21727611674823194 -0.13701474018997217,", - "3.3639610306789285 0 0.7071067811865475 0 0,", - "1.1213203435596428 0 0 0.7071067811865475 0,", - "5.156617435753728 1.2321237478911191 0.7875254500568571", - "0.2625084833522857 0.16553835820737872,", - "0.671336061515156 -0.18208981448197611 0.7875254500568571", + R_inv_str=("-1.4118746341171051 -0.4345522334964639 " + "-0.6518283502446959 -0.21727611674823194 -0.13701474018997217," + "3.3639610306789285 0 0.7071067811865475 0 0," + "1.1213203435596428 0 0 0.7071067811865475 0," + "5.156617435753728 1.2321237478911191 0.7875254500568571 " + "0.2625084833522857 0.16553835820737872," + "0.671336061515156 -0.18208981448197611 0.7875254500568571 " "0.2625084833522857 0.16553835820737872"), wavespeeds_str="4.4 4.4 4.4 2.753670749819466 6.046329250180534", - char_fluxes_pos_str=("0.018976427428922138 1.4911688245431431", - "0.49705627484771453 1.432380835542713 0.05753157056903602,", - "0.2965647431231918 -0.3514718625761428", + char_fluxes_pos_str=("0.018976427428922138 1.4911688245431431 " + "0.49705627484771453 1.432380835542713 0.05753157056903602," + "0.2965647431231918 -0.3514718625761428 " "-0.1171572875253809 0.5689873221894901 1.6097440213843948"), - char_fluxes_neg_str=("-0.5214705489522515 -3.9764501987817145", - "-1.3254833995939053 -3.767119678640133 -1.3413036144786457,", - "-2.2324228059144673 7.380909114098994", + char_fluxes_neg_str=("-0.5214705489522515 -3.9764501987817145 " + "-1.3254833995939053 -3.767119678640133 -1.3413036144786457," + "-2.2324228059144673 7.380909114098994 " "2.4603030380329987 -0.9465242322295992 -15.885347333048884"), - weno_weights_pos_str=("0.9999999386221037 0.9999999999683822", - "0.9999999974390363 0.9999999993440752 0.9999999999372101,", - "5.68308936788955e-8 2.9275831062158654e-11", - "2.3712585027633853e-9 6.073372407373299e-10 5.8138848037057226e-11,", - "4.547002513715645e-9 2.3420726930957915e-12", + weno_weights_pos_str=("0.9999999386221037 0.9999999999683822 " + "0.9999999974390363 0.9999999993440752 0.9999999999372101," + "5.68308936788955e-8 2.9275831062158654e-11 " + "2.3712585027633853e-9 6.073372407373299e-10 5.8138848037057226e-11," + "4.547002513715645e-9 2.3420726930957915e-12 " "1.897052057748541e-10 4.8587565862160355e-11 4.6511252168302e-12"), - weno_weights_neg_str=("0.9999999999574652 0.999999999999978", - "0.9999999999982254 0.9999999999942413 0.9999999999999919,", - "3.9384014966385437e-11 2.0284497966079935e-14", - "1.6430428067143077e-12 5.332240836330361e-12 7.542808138536806e-15,", - "3.1507308840273685e-12 1.622759950511315e-15", + weno_weights_neg_str=("0.9999999999574652 0.999999999999978 " + "0.9999999999982254 0.9999999999942413 0.9999999999999919," + "3.9384014966385437e-11 2.0284497966079935e-14 " + "1.6430428067143077e-12 5.332240836330361e-12 7.542808138536806e-15," + "3.1507308840273685e-12 1.622759950511315e-15 " "1.3144350707803127e-13 4.265797494767529e-13 6.034246767570432e-16"), consistent_str="-5. 20.4 27. 9. -147.", - dissipation_pos_str=("-0.2813265968286516 1.7462934823903074", + dissipation_pos_str=("-0.2813265968286516 1.7462934823903074 " "2.641315430506612 0.8804384760489334 -15.588441251607525"), - dissipation_neg_str=("-3.281326602835503 16.54629350160538", + dissipation_neg_str=("-3.281326602835503 16.54629350160538 " "23.641315459112736 7.880438486367551 -137.3884413587739"), - weno_flux=("-8.562653199664155 38.69258698399569", + weno_flux_str=("-8.562653199664155 38.69258698399569 " "53.28263088961934 17.760876962416486 -299.97688261038144"), direction="y") single_data["Case d:z"] = FluxDataSingle( @@ -423,49 +423,49 @@ single_data["Case d:z"] = FluxDataSingle( fluxes_str="-3 10.6 3 6 -37.8,-12 75.2 24 48 -403.2", lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," "-6. -6. -6. -4.503337045290424 -7.496662954709576"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686,", - "-4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903,", - "-1.5857864376269053 1.4142135623730951 0 -0.6562712083807143", - "-0.6562712083807143,", - "-3.1715728752538106 0 1.4142135623730951 -1.3125424167614286", - "-1.3125424167614286,", - "17.60303038033002 -2.2426406871192857 -4.485281374238571", + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "-4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903," + "-1.5857864376269053 1.4142135623730951 0 -0.6562712083807143 " + "-0.6562712083807143," + "-3.1715728752538106 0 1.4142135623730951 -1.3125424167614286 " + "-1.3125424167614286," + "17.60303038033002 -2.2426406871192857 -4.485281374238571 " "6.941428822961119 13.669350884318975"), - R_inv_str=("-1.4118746341171051 -0.6518283502446959", - "-0.21727611674823194 -0.4345522334964639 -0.13701474018997217,", - "1.1213203435596428 0 0.7071067811865475 0 0,", - "2.2426406871192857 0 0 0.7071067811865475 0,", - "6.27793777931337 1.4946322312434048 0.2625084833522857", - "0.5250169667045714 0.16553835820737872,", - "-0.4499842820444868 0.08041866887030964 0.2625084833522857", + R_inv_str=("-1.4118746341171051 -0.6518283502446959 " + "-0.21727611674823194 -0.4345522334964639 -0.13701474018997217," + "1.1213203435596428 0 0.7071067811865475 0 0," + "2.2426406871192857 0 0 0.7071067811865475 0," + "6.27793777931337 1.4946322312434048 0.2625084833522857 " + "0.5250169667045714 0.16553835820737872," + "-0.4499842820444868 0.08041866887030964 0.2625084833522857 " "0.5250169667045714 0.16553835820737872"), wavespeeds_str="6.6 6.6 6.6 4.953670749819467 8.246329250180533", - char_fluxes_pos_str=("0.02846464114338254 0.7455844122715716", - "1.4911688245431431 3.0474996241899346 -0.8126310150223119,", - "0.44484711468478866 -0.1757359312880714", + char_fluxes_pos_str=("0.02846464114338254 0.7455844122715716 " + "1.4911688245431431 3.0474996241899346 -0.8126310150223119," + "0.44484711468478866 -0.1757359312880714 " "-0.3514718625761428 0.8207769392695052 2.447320076091316"), - char_fluxes_neg_str=("-0.7822058234283737 -1.9882250993908581", - "-3.9764501987817162 -8.357934000904585 0.6952990612264269,", - "-3.348634208871708 3.690454557049497", + char_fluxes_neg_str=("-0.7822058234283737 -1.9882250993908581 " + "-3.9764501987817162 -8.357934000904585 0.6952990612264269," + "-3.348634208871708 3.690454557049497 " "7.380909114098994 0.9962654715332988 -26.24407281945101"), - weno_weights_pos_str=("0.9999999878747177 0.9999999994941201", - "0.9999999999683822 0.9999999999851737 0.9999999999967727,", - "1.1227070122726888e-8 4.684070887233427e-10", - "2.9275831062158654e-11 1.372802081812638e-11 2.988331869942141e-12,", - "8.982122341016933e-10 3.747296441221644e-11", + weno_weights_pos_str=("0.9999999878747177 0.9999999994941201 " + "0.9999999999683822 0.9999999999851737 0.9999999999967727," + "1.1227070122726888e-8 4.684070887233427e-10 " + "2.9275831062158654e-11 1.372802081812638e-11 2.988331869942141e-12," + "8.982122341016933e-10 3.747296441221644e-11 " "2.3420726930957915e-12 1.0982436589127136e-12 2.390667520553204e-13"), - weno_weights_neg_str=("0.999999999991598 0.9999999999996494", - "0.999999999999978 0.9999999999999524 0.9999999999999993,", - "7.779580658268568e-12 3.2455185423228674e-13", - "2.028449796607992e-14 4.408056940300416e-14 6.408020704124379e-16,", - "6.223673030753551e-13 2.596415558497523e-14", + weno_weights_neg_str=("0.999999999991598 0.9999999999996494 " + "0.999999999999978 0.9999999999999524 0.9999999999999993," + "7.779580658268568e-12 3.2455185423228674e-13 " + "2.028449796607992e-14 4.408056940300416e-14 6.408020704124379e-16," + "6.223673030753551e-13 2.596415558497523e-14 " "1.6227599505113154e-15 3.526445914956101e-15 5.126416626873783e-17"), consistent_str="-7.5 42.9 13.5 27. -220.5", - dissipation_pos_str=("-0.42198990248451174 3.947389709111337", + dissipation_pos_str=("-0.42198990248451174 3.947389709111337 " "1.3206577265155963 2.6413154534736667 -23.382662006532225"), - dissipation_neg_str=("-4.9219899042811 36.247389717669265", + dissipation_neg_str=("-4.9219899042811 36.247389717669265 " "11.820657729599578 23.641315459201046 -206.08266203865145"), - weno_flux=("-12.843979806765612 83.09477942678059", + weno_flux_str=("-12.843979806765612 83.09477942678059 " "26.641315456115173 53.28263091267471 -449.9653240451837"), direction="z") @@ -473,9 +473,9 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - "Case a:x"#, "Case a:y", "Case a:z", - "Case b:x"#, "Case b:y", "Case b:z", - "Case c:x"#, "Case c:y", "Case c:z", + "Case a:x",#, "Case a:y", "Case a:z", + "Case b:x",#, "Case b:y", "Case b:z", + "Case c:x",#, "Case c:y", "Case c:z", "Case d:x"])#, "Case d:y", "Case d:z"]) def data(request): return single_data[request.param] -- GitLab From f278e126253db2830e63d8602f7037ec6372894f Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:37:41 -0500 Subject: [PATCH 24/60] rewrite flux splitting test to use new fixtures --- input.py | 1 + test.py | 69 ++++++++------------------------------------------------ 2 files changed, 11 insertions(+), 59 deletions(-) diff --git a/input.py b/input.py index 204fcba..2f9b86f 100644 --- a/input.py +++ b/input.py @@ -18,6 +18,7 @@ class FluxDataSingle: self.state_pair = u.transposed_array_from_string(states_str) self.states = u.expand_to_6(self.state_pair) self.flux_pair = u.transposed_array_from_string(fluxes_str) + self.fluxes = u.expand_to_6(self.flux_pair) self.lam_pointwise = u.expand_to_6( u.transposed_array_from_string(lam_str)) diff --git a/test.py b/test.py index 879b26d..16dc18a 100644 --- a/test.py +++ b/test.py @@ -235,72 +235,23 @@ def test_weno_weights_neg_uniform_grid( u.compare_arrays(weights_dev.get(), weights_expected) -@pytest.mark.parametrize(("states_str,fluxes_str,R_inv_str,wavespeeds_str," - "fluxes_pos_expected_str,fluxes_neg_expected_str"), [ - ("2 4 4 4 20,1 1 1 1 5.5", "4 11.2 8 8 46.4,1 2.6 1 1 7.1", - ("0.367521364 0.265894836 0.265894836 0.265894836 -0.167673798," - "-1.12132034 0 0.707106781 0 0," - "-1.12132034 0 0 0.707106781 0," - "-0.430558632 0.416709665 -0.290397116 -0.290397116 0.183124984," - "1.81208206 -0.997503897 -0.290397116 -0.290397116 0.183124984"), - "2.2 2.2 2.2 3.84632925 0.55367075", - ("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 -1 -1 -1 5.5,2 -4 -4 -4 20", "-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", - ("0.367521364 -0.265894836 -0.265894836 -0.265894836 -0.167673798," - "1.12132034 0 0.707106781 0 0," - "1.12132034 0 0 0.707106781 0," - "1.81208206 0.997503897 0.290397116 0.290397116 0.183124984," - "-0.430558632 -0.416709665 0.290397116 0.290397116 0.183124984"), - "2.2 2.2 2.2 0.55367075 3.84632925", - ("0.0672231577 0.248528137 0.248528137 0.374562227 0.107250611," - "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")), - ("2 4 8 12 64,1 1 2 3 11", "4 11.2 16 24 134.4,1 2.6 2 3 12.6", - ("-1.41187463 0.217276117 0.434552233 0.65182835 -0.13701474," - "-2.24264069 0 0.707106781 0 0," - "-3.36396103 0 0 0.707106781 0," - "1.79265641 0.444598298 -0.525016967 -0.78752545 0.165538358," - "4.03529709 -0.969615265 -0.525016967 -0.78752545 0.165538358"), - "2.2 2.2 2.2 3.84632925 0.55367075", - ("1.1162114 2.46030304 3.69045456 7.98692488 0.429010898," - "0.260735274 -1.3254834 -1.9882251 2.05242289 0.501788756"), - ("-0.148282372 -0.117157288 -0.175735931 -0.889325254 -0.200040418," - "-0.00948821371 0.497056275 0.745584412 -0.430637881 -0.314318322")), - ]) -def test_flux_splitting_uniform_grid( - ctx_factory, states_str, fluxes_str, R_inv_str, wavespeeds_str, - fluxes_pos_expected_str, fluxes_neg_expected_str): +def test_flux_splitting_uniform_grid(ctx_factory, data): prg = u.get_weno_program_with_root_kernel("split_characteristic_fluxes") queue = u.get_queue(ctx_factory) - nvars = 5 - - states = u.expand_to_6(u.transposed_array_from_string(states_str)) - fluxes = u.expand_to_6(u.transposed_array_from_string(fluxes_str)) - R_inv = u.array_from_string(R_inv_str) - wavespeeds = u.array_from_string(wavespeeds_str) - fluxes_pos_dev = u.empty_array_on_device(queue, nvars, 6) - fluxes_neg_dev = u.empty_array_on_device(queue, nvars, 6) + fluxes_pos_dev = u.empty_array_on_device(queue, data.nvars, 6) + fluxes_neg_dev = u.empty_array_on_device(queue, data.nvars, 6) - prg(queue, nvars=nvars, - generalized_states_frozen=states, - generalized_fluxes_frozen=fluxes, - R_inv=R_inv, - wavespeeds=wavespeeds, + prg(queue, nvars=data.nvars, + generalized_states_frozen=data.states, + generalized_fluxes_frozen=data.fluxes, + R_inv=data.R_inv, + wavespeeds=data.wavespeeds, characteristic_fluxes_pos=fluxes_pos_dev, characteristic_fluxes_neg=fluxes_neg_dev) - fluxes_pos_expected = u.expand_to_6( - u.transposed_array_from_string(fluxes_pos_expected_str)) - u.compare_arrays(fluxes_pos_dev.get(), fluxes_pos_expected) - - fluxes_neg_expected = u.expand_to_6( - u.transposed_array_from_string(fluxes_neg_expected_str)) - u.compare_arrays(fluxes_neg_dev.get(), fluxes_neg_expected) + u.compare_arrays(fluxes_pos_dev.get(), data.char_fluxes_pos) + u.compare_arrays(fluxes_neg_dev.get(), data.char_fluxes_neg) def test_pointwise_eigenvalues_ideal_gas(ctx_factory, data): -- GitLab From e7b6b0f39f8127ddd65889249140012e402f6dd3 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:43:07 -0500 Subject: [PATCH 25/60] rewrite WENO weight tests to use new fixtures --- test.py | 66 +++++++++++++++++---------------------------------------- 1 file changed, 19 insertions(+), 47 deletions(-) diff --git a/test.py b/test.py index 16dc18a..f204e96 100644 --- a/test.py +++ b/test.py @@ -138,35 +138,6 @@ def test_dissipation_part_pos_uniform_grid( u.compare_arrays(dissipation_dev.get(), dissipation_expected) -@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"), - ("0.999999998 1. 1. 1. 0.999990928," - "2.23542587e-9 2.62886024e-11 2.62886024e-11 2.52995663e-13 " - "8.39888392e-6," - "1.78838212e-10 2.10309347e-12 2.10309347e-12 2.0239658e-14 " - "6.7286569e-7")) - ]) -def test_weno_weights_pos_uniform_grid( - 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) - - nvars = 5 - - char_fluxes = u.expand_to_6( - u.transposed_array_from_string(char_fluxes_str)) - weights_dev = u.empty_array_on_device(queue, nvars, 3) - - prg(queue, nvars=nvars, - characteristic_fluxes=char_fluxes, - 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," "R_str,dissipation_expected_str"), [ (("-0.168354897 -0.0585786438 -0.0585786438 -0.727493464 -0.306026299," @@ -208,31 +179,32 @@ def test_dissipation_part_neg_uniform_grid( u.compare_arrays(dissipation_dev.get(), dissipation_expected) -@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"), - ("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, weights_expected_str): - prg = u.get_weno_program_with_root_kernel("weno_weights_neg") +def test_weno_weights_pos_uniform_grid(ctx_factory, data): + prg = u.get_weno_program_with_root_kernel("weno_weights_pos") queue = u.get_queue(ctx_factory) - nvars = 5 + weights_dev = u.empty_array_on_device(queue, data.nvars, 3) - char_fluxes = u.expand_to_6( - u.transposed_array_from_string(char_fluxes_str)) - weights_dev = u.empty_array_on_device(queue, nvars, 3) + prg(queue, nvars=data.nvars, + characteristic_fluxes=data.char_fluxes_pos, + combined_frozen_metrics=1.0, + w=weights_dev) - prg(queue, nvars=nvars, - characteristic_fluxes=char_fluxes, + u.compare_arrays(weights_dev.get(), data.weno_weights_pos) + + +def test_weno_weights_neg_uniform_grid(ctx_factory, data): + prg = u.get_weno_program_with_root_kernel("weno_weights_neg") + queue = u.get_queue(ctx_factory) + + weights_dev = u.empty_array_on_device(queue, data.nvars, 3) + + prg(queue, nvars=data.nvars, + characteristic_fluxes=data.char_fluxes_neg, 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) + u.compare_arrays(weights_dev.get(), data.weno_weights_neg) def test_flux_splitting_uniform_grid(ctx_factory, data): -- GitLab From 90389443b9239a492bee7cf21085996176cc0476 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:46:55 -0500 Subject: [PATCH 26/60] rewrite consistent and dissipation part tests for new fixtures --- test.py | 98 ++++++++++----------------------------------------------- 1 file changed, 17 insertions(+), 81 deletions(-) diff --git a/test.py b/test.py index f204e96..ae58e9c 100644 --- a/test.py +++ b/test.py @@ -72,111 +72,47 @@ def test_weno_flux_uniform_grid( u.compare_arrays(flux_dev.get(), flux_expected) -@pytest.mark.parametrize(("gen_fluxes_str,consistent_expected_str"), [ - ("4 11.2 8 8 46.4,1 2.6 1 1 7.1", - "2.5 6.9 4.5 4.5 26.75"), - ("-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", - "-2.5 6.9 4.5 4.5 -26.75") - ]) -def test_consistent_part_uniform_grid( - ctx_factory, gen_fluxes_str, consistent_expected_str): +def test_consistent_part_uniform_grid(ctx_factory, data): prg = u.get_weno_program_with_root_kernel("consistent_part") queue = u.get_queue(ctx_factory) - nvars = 5 - - gen_fluxes = u.expand_to_6( - u.transposed_array_from_string(gen_fluxes_str)) - consistent_dev = u.empty_array_on_device(queue, nvars) + consistent_dev = u.empty_array_on_device(queue, data.nvars) - prg(queue, nvars=nvars, - generalized_fluxes=gen_fluxes, + prg(queue, nvars=data.nvars, + generalized_fluxes=data.fluxes, consistent=consistent_dev) - consistent_expected = u.array_from_string(consistent_expected_str) - u.compare_arrays(consistent_dev.get(), consistent_expected) + u.compare_arrays(consistent_dev.get(), data.consistent) -@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 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 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, R_str, dissipation_expected_str): +def test_dissipation_part_pos_uniform_grid(ctx_factory, data): 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) + dissipation_dev = u.empty_array_on_device(queue, data.nvars) - prg(queue, nvars=nvars, - characteristic_fluxes=char_fluxes, + prg(queue, nvars=data.nvars, + characteristic_fluxes=data.char_fluxes_pos, combined_frozen_metrics=1.0, - R=R, + R=data.R, dissipation_pos=dissipation_dev) - dissipation_expected = u.array_from_string(dissipation_expected_str) - u.compare_arrays(dissipation_dev.get(), dissipation_expected) + u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) -@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 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 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, R_str, dissipation_expected_str): +def test_dissipation_part_neg_uniform_grid(ctx_factory, data): prg = u.get_weno_program_with_root_kernel("dissipation_part_neg") queue = u.get_queue(ctx_factory) - nvars = 5 + dissipation_dev = u.empty_array_on_device(queue, data.nvars) - 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, + prg(queue, nvars=data.nvars, + characteristic_fluxes=data.char_fluxes_neg, combined_frozen_metrics=1.0, - R=R, + R=data.R, dissipation_neg=dissipation_dev) - dissipation_expected = u.array_from_string(dissipation_expected_str) - u.compare_arrays(dissipation_dev.get(), dissipation_expected) + u.compare_arrays(dissipation_dev.get(), data.dissipation_neg) def test_weno_weights_pos_uniform_grid(ctx_factory, data): -- GitLab From 5aabe01fdc7e6461b1c7248901653dba87080dc2 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:49:36 -0500 Subject: [PATCH 27/60] rewrite weno flux test for new fixture --- test.py | 53 ++++++++--------------------------------------------- 1 file changed, 8 insertions(+), 45 deletions(-) diff --git a/test.py b/test.py index ae58e9c..0c1f86f 100644 --- a/test.py +++ b/test.py @@ -18,58 +18,21 @@ import utilities as u from input import data -@pytest.mark.parametrize(("gen_fluxes_str,char_fluxes_pos_str,char_fluxes_neg_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 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"), - "4.35371022 12.2479485 8.99522344 8.99522344 51.3903927"), - ("-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", - ("0.0672231577 0.248528137 0.248528137 0.374562227 0.107250611," - "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 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"), - "-4.35371022 12.2479485 8.99522344 8.99522344 -51.3903927") - ]) -def test_weno_flux_uniform_grid( - ctx_factory, gen_fluxes_str, char_fluxes_pos_str, char_fluxes_neg_str, - R_str, flux_expected_str): +def test_weno_flux_uniform_grid(ctx_factory, data): prg = u.get_weno_program_with_root_kernel("weno_flux") queue = u.get_queue(ctx_factory) - nvars = 5 + flux_dev = u.empty_array_on_device(queue, data.nvars) - gen_fluxes = u.expand_to_6( - u.transposed_array_from_string(gen_fluxes_str)) - char_fluxes_pos = u.expand_to_6( - u.transposed_array_from_string(char_fluxes_pos_str)) - char_fluxes_neg = u.expand_to_6( - u.transposed_array_from_string(char_fluxes_neg_str)) - R = u.array_from_string(R_str) - flux_dev = u.empty_array_on_device(queue, nvars) - - prg(queue, nvars=nvars, - generalized_fluxes=gen_fluxes, - characteristic_fluxes_pos=char_fluxes_pos, - characteristic_fluxes_neg=char_fluxes_neg, + prg(queue, nvars=data.nvars, + generalized_fluxes=data.fluxes, + characteristic_fluxes_pos=data.char_fluxes_pos, + characteristic_fluxes_neg=data.char_fluxes_neg, combined_frozen_metrics=1.0, - R=R, + R=data.R, flux=flux_dev) - flux_expected = u.array_from_string(flux_expected_str) - u.compare_arrays(flux_dev.get(), flux_expected) + u.compare_arrays(flux_dev.get(), data.weno_flux) def test_consistent_part_uniform_grid(ctx_factory, data): -- GitLab From 9b055d456fdacba266ecf71b09f9b75e9cbb7885 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:51:59 -0500 Subject: [PATCH 28/60] fix error in data for case b --- input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input.py b/input.py index 2f9b86f..cee2280 100644 --- a/input.py +++ b/input.py @@ -156,7 +156,7 @@ single_data["Case b:x"] = FluxDataSingle( "0.49761166908056337 0.49761166908056337 -2.495196349669178"), dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " "3.9976117689805504 3.9976117689805504 -22.145196359962693"), - weno_flux_str=("4.353710219799678 12.247948547685105 " + weno_flux_str=("-4.353710219799678 12.247948547685105 " "8.995223438061114 8.995223438061114 -51.390392709631875"), direction="x") -- GitLab From d9f100003e9ffa8a837718c9052ae23ab8a285fe Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:53:35 -0500 Subject: [PATCH 29/60] add y,z data for cases a,b --- input.py | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) diff --git a/input.py b/input.py index cee2280..d813ca9 100644 --- a/input.py +++ b/input.py @@ -103,6 +103,106 @@ single_data["Case a:x"] = FluxDataSingle( weno_flux_str=("4.353710219799678 12.247948547685105 8.995223438061114 " "8.995223438061114 51.39039270963187"), direction="x") +single_data["Case a:y"] = FluxDataSingle( + states_str="2 4 4 4 20,1 1 1 1 5.5", + fluxes_str="4 11.2 8 8 46.4,1 2.6 1 1 7.1", + lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "1.5857864376269053 0 0 1.4330995704840366 0.018886008110941373," + "1.5857864376269053 1.4142135623730951 0 0.7259927892974889 " + "0.7259927892974889," + "1.5857864376269053 0 1.4142135623730951 0.7259927892974889 " + "0.7259927892974889," + "3.7720779386421466 2.2426406871192857 2.2426406871192857 " + "5.578600290173388 3.335959603054103"), + R_inv_str=("0.36752136386566203 0.265894835574803 0.265894835574803 " + "0.265894835574803 -0.16767379847989416," + "-1.1213203435596428 0 0.7071067811865475 0 0," + "-1.1213203435596428 0 0 0.7071067811865475 0," + "-0.43055863210991147 0.41670966546755195 -0.2903971157189956 " + "-0.2903971157189956 0.1831249838115456," + "1.8120820550093746 -0.9975038969055432 -0.2903971157189956 " + "-0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", + char_fluxes_pos_str=("1.0907156303492833 1.2301515190164993 " + "1.2301515190164993 7.523052586013577 0.23295627081394965," + "0.4673767959969717 -0.6627416997969526 " + "-0.6627416997969526 1.4795302623674356 0.3125273038443238"), + char_fluxes_neg_str=("-0.16835489671908455 -0.05857864376269045 " + "-0.05857864376269045 -0.7274934638648571 -0.30602629876675014," + "-0.06722315769446469 0.24852813742385726 " + "0.24852813742385726 -0.10725061063772967 -0.37456222716537935"), + weno_weights_pos_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999999999997268 0.9999909282503908," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 2.5299566294114733e-13 8.39888391917283e-6," + "1.788382117901561e-10 2.1030934718853924e-12 " + "2.1030934718853924e-12 2.0239658022589593e-14 6.728656898188601e-7"), + weno_weights_neg_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999999975371708 0.9999835300215946," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 2.2803933579018906e-9 0.000015247816238787948," + "2.579631146567429e-7 3.0351383606886035e-9 " + "3.0351383606886035e-9 1.824357365679662e-10 1.2221621667041045e-6"), + consistent_str="2.5 6.9 4.5 4.5 26.75", + dissipation_pos_str=("1.6768551393982627 4.8239743723334865 " + "3.997611768980551 3.997611768980551 22.145196359962693"), + dissipation_neg_str=("0.1768550804014161 0.523974175351619 " + "0.4976116690805634 0.4976116690805634 2.495196349669178"), + weno_flux_str=("4.353710219799678 12.247948547685105 8.995223438061114 " + "8.995223438061114 51.39039270963187"), + direction="y") +single_data["Case a:z"] = FluxDataSingle( + states_str="2 4 4 4 20,1 1 1 1 5.5", + fluxes_str="4 11.2 8 8 46.4,1 2.6 1 1 7.1", + lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "1.5857864376269053 0 0 1.4330995704840366 0.018886008110941373," + "1.5857864376269053 1.4142135623730951 0 0.7259927892974889 " + "0.7259927892974889," + "1.5857864376269053 0 1.4142135623730951 0.7259927892974889 " + "0.7259927892974889," + "3.7720779386421466 2.2426406871192857 2.2426406871192857 " + "5.578600290173388 3.335959603054103"), + R_inv_str=("0.36752136386566203 0.265894835574803 0.265894835574803 " + "0.265894835574803 -0.16767379847989416," + "-1.1213203435596428 0 0.7071067811865475 0 0," + "-1.1213203435596428 0 0 0.7071067811865475 0," + "-0.43055863210991147 0.41670966546755195 -0.2903971157189956 " + "-0.2903971157189956 0.1831249838115456," + "1.8120820550093746 -0.9975038969055432 -0.2903971157189956 " + "-0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", + char_fluxes_pos_str=("1.0907156303492833 1.2301515190164993 " + "1.2301515190164993 7.523052586013577 0.23295627081394965," + "0.4673767959969717 -0.6627416997969526 " + "-0.6627416997969526 1.4795302623674356 0.3125273038443238"), + char_fluxes_neg_str=("-0.16835489671908455 -0.05857864376269045 " + "-0.05857864376269045 -0.7274934638648571 -0.30602629876675014," + "-0.06722315769446469 0.24852813742385726 " + "0.24852813742385726 -0.10725061063772967 -0.37456222716537935"), + weno_weights_pos_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999999999997268 0.9999909282503908," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 2.5299566294114733e-13 8.39888391917283e-6," + "1.788382117901561e-10 2.1030934718853924e-12 " + "2.1030934718853924e-12 2.0239658022589593e-14 6.728656898188601e-7"), + weno_weights_neg_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999999975371708 0.9999835300215946," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 2.2803933579018906e-9 0.000015247816238787948," + "2.579631146567429e-7 3.0351383606886035e-9 " + "3.0351383606886035e-9 1.824357365679662e-10 1.2221621667041045e-6"), + consistent_str="2.5 6.9 4.5 4.5 26.75", + dissipation_pos_str=("1.6768551393982627 4.8239743723334865 " + "3.997611768980551 3.997611768980551 22.145196359962693"), + dissipation_neg_str=("0.1768550804014161 0.523974175351619 " + "0.4976116690805634 0.4976116690805634 2.495196349669178"), + weno_flux_str=("4.353710219799678 12.247948547685105 8.995223438061114 " + "8.995223438061114 51.39039270963187"), + direction="z") # }}} @@ -159,6 +259,108 @@ single_data["Case b:x"] = FluxDataSingle( weno_flux_str=("-4.353710219799678 12.247948547685105 " "8.995223438061114 8.995223438061114 -51.390392709631875"), direction="x") +single_data["Case b:y"] = FluxDataSingle( + states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", + fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "-1.5857864376269053 0 0 -0.018886008110941373 " + "-1.4330995704840366," + "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " + "-0.7259927892974889," + "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " + "-0.7259927892974889," + "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " + "3.335959603054103 5.578600290173388"), + R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " + "-0.265894835574803 -0.16767379847989416," + "1.1213203435596428 0 0.7071067811865475 0 0," + "1.1213203435596428 0 0 0.7071067811865475 0," + "1.8120820550093746 0.9975038969055432 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456," + "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", + char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " + "0.24852813742385726 0.37456222716537935 0.10725061063772967," + "0.16835489671908455 -0.05857864376269045 " + "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), + char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " + "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," + "-1.0907156303492833 1.2301515190164993 " + "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), + weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999835300215946 0.9999999975371708," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," + "2.579631146567429e-7 3.0351383606886035e-9 " + "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), + weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999909282503908 0.9999999999997268," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," + "1.788382117901561e-10 2.1030934718853924e-12 " + "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), + consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", + dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " + "0.49761166908056337 0.49761166908056337 -2.495196349669178"), + dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " + "3.9976117689805504 3.9976117689805504 -22.145196359962693"), + weno_flux_str=("-4.353710219799678 12.247948547685105 " + "8.995223438061114 8.995223438061114 -51.390392709631875"), + direction="y") +single_data["Case b:z"] = FluxDataSingle( + states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", + fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "-1.5857864376269053 0 0 -0.018886008110941373 " + "-1.4330995704840366," + "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " + "-0.7259927892974889," + "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " + "-0.7259927892974889," + "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " + "3.335959603054103 5.578600290173388"), + R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " + "-0.265894835574803 -0.16767379847989416," + "1.1213203435596428 0 0.7071067811865475 0 0," + "1.1213203435596428 0 0 0.7071067811865475 0," + "1.8120820550093746 0.9975038969055432 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456," + "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", + char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " + "0.24852813742385726 0.37456222716537935 0.10725061063772967," + "0.16835489671908455 -0.05857864376269045 " + "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), + char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " + "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," + "-1.0907156303492833 1.2301515190164993 " + "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), + weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999835300215946 0.9999999975371708," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," + "2.579631146567429e-7 3.0351383606886035e-9 " + "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), + weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999909282503908 0.9999999999997268," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," + "1.788382117901561e-10 2.1030934718853924e-12 " + "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), + consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", + dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " + "0.49761166908056337 0.49761166908056337 -2.495196349669178"), + dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " + "3.9976117689805504 3.9976117689805504 -22.145196359962693"), + weno_flux_str=("-4.353710219799678 12.247948547685105 " + "8.995223438061114 8.995223438061114 -51.390392709631875"), + direction="z") # }}} -- GitLab From 90fbc71506276c4b40491cf43947a9677d416791 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 21:59:54 -0500 Subject: [PATCH 30/60] added y cases to run --- input.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/input.py b/input.py index d813ca9..63aecba 100644 --- a/input.py +++ b/input.py @@ -676,10 +676,10 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - "Case a:x",#, "Case a:y", "Case a:z", - "Case b:x",#, "Case b:y", "Case b:z", - "Case c:x",#, "Case c:y", "Case c:z", - "Case d:x"])#, "Case d:y", "Case d:z"]) + "Case a:x", "Case a:y",# "Case a:z", + "Case b:x", "Case b:y",# "Case b:z", + "Case c:x", "Case c:y",# "Case c:z", + "Case d:x", "Case d:y"])#, "Case d:z"]) def data(request): return single_data[request.param] -- GitLab From 2a9131a85edba22c96bf7994ffa025d10fb3a29f Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 22:53:30 -0500 Subject: [PATCH 31/60] add swap routines so y,z arrays are ordered correctly --- input.py | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/input.py b/input.py index 63aecba..b5fac04 100644 --- a/input.py +++ b/input.py @@ -15,15 +15,23 @@ class FluxDataSingle: consistent_str, dissipation_pos_str, dissipation_neg_str, weno_flux_str, direction): - self.state_pair = u.transposed_array_from_string(states_str) + self.direction = self.dirs[direction] + + self.state_pair = self.swap_array_rows( + u.transposed_array_from_string(states_str), self.direction) self.states = u.expand_to_6(self.state_pair) - self.flux_pair = u.transposed_array_from_string(fluxes_str) + + self.flux_pair = self.swap_array_rows( + u.transposed_array_from_string(fluxes_str), self.direction) self.fluxes = u.expand_to_6(self.flux_pair) self.lam_pointwise = u.expand_to_6( u.transposed_array_from_string(lam_str)) - self.R = u.array_from_string(R_str) - self.R_inv = u.array_from_string(R_inv_str) + + self.R = self.swap_array_rows( + u.array_from_string(R_str), self.direction) + self.R_inv = self.swap_array_cols( + u.array_from_string(R_inv_str), self.direction) self.wavespeeds = u.array_from_string(wavespeeds_str) self.char_fluxes_pos = u.expand_to_6( @@ -34,20 +42,35 @@ class FluxDataSingle: self.weno_weights_pos = u.transposed_array_from_string(weno_weights_pos_str) self.weno_weights_neg = u.transposed_array_from_string(weno_weights_neg_str) - self.consistent = u.array_from_string(consistent_str) - self.dissipation_pos = u.array_from_string(dissipation_pos_str) - self.dissipation_neg = u.array_from_string(dissipation_neg_str) + self.consistent = self.swap_array( + u.array_from_string(consistent_str), self.direction) + self.dissipation_pos = self.swap_array( + u.array_from_string(dissipation_pos_str), self.direction) + self.dissipation_neg = self.swap_array( + u.array_from_string(dissipation_neg_str), self.direction) - self.weno_flux = u.array_from_string(weno_flux_str) + self.weno_flux = self.swap_array( + u.array_from_string(weno_flux_str), self.direction) - self.direction = self.dirs[direction] + def swap_array(self, arr, d): + p = self.permutation(d) + arr[p] = arr[[1,2,3]] + return arr -# }}} + def swap_array_rows(self, arr, d): + p = self.permutation(d) + arr[p,:] = arr[[1,2,3],:] + return arr + + def swap_array_cols(self, arr, d): + p = self.permutation(d) + arr[:,p] = arr[:,[1,2,3]] + return arr -# FIXME: -# - add rotation routines so y,z data is setup correctly -# (even though values are different, we are still working with x as the -# dominant frame, so need to swap at the end) + def permutation(self, d): + return [(d-1+i)%3 + 1 for i in range(3)] + +# }}} single_data = {} -- GitLab From f72f75cd927bd3d083d7d23049b87eedf6f39818 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 22:56:38 -0500 Subject: [PATCH 32/60] add z-direction cases --- input.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/input.py b/input.py index b5fac04..f29c026 100644 --- a/input.py +++ b/input.py @@ -699,10 +699,10 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - "Case a:x", "Case a:y",# "Case a:z", - "Case b:x", "Case b:y",# "Case b:z", - "Case c:x", "Case c:y",# "Case c:z", - "Case d:x", "Case d:y"])#, "Case d:z"]) + "Case a:x", "Case a:y", "Case a:z", + "Case b:x", "Case b:y", "Case b:z", + "Case c:x", "Case c:y", "Case c:z", + "Case d:x", "Case d:y", "Case d:z"]) def data(request): return single_data[request.param] -- GitLab From ace78533b374289325e24e6bc737dd3fb4222418 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 22:56:57 -0500 Subject: [PATCH 33/60] remove slow marks from some tests that aren't actually slow --- test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test.py b/test.py index 0c1f86f..75fabad 100644 --- a/test.py +++ b/test.py @@ -174,7 +174,6 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, data): check_roe_property(data.state_pair, data.flux_pair, R, R_inv, lam) -@pytest.mark.slow @pytest.mark.parametrize("lam_pointwise_str,lam_roe_str,lam_expected_str", [ ("1 2 3 4 5,2 4 6 8 10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), ("1 2 3 4 5,-2 -4 -6 -8 -10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), @@ -200,7 +199,6 @@ def test_lax_wavespeeds( u.compare_arrays(lam_dev.get(), lam_expected) -@pytest.mark.slow def test_matvec(ctx_factory): prg = u.get_weno_program_with_root_kernel("mult_mat_vec") queue = u.get_queue(ctx_factory) -- GitLab From 683229ebca2498abd1e956e9e775da5f4071c5a5 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 22 Jul 2019 23:03:35 -0500 Subject: [PATCH 34/60] Flake doesn't recognize how pytest picks up fixtures, so need to ignore some complaints --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 6fdc175..f812af5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,3 @@ [flake8] -ignore = E126,E127,E128,E123,E226,E241,E242,E265,N802,N803,N806,W503,E402,N814,W504 +ignore = E126,E127,E128,E123,E226,E241,E242,E265,N802,N803,N806,W503,E402,N814,W504,F401,F811 max-line-length=85 -- GitLab From d27613b73af1d4fcb6212103c5faa00c3f7b08ca Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 28 Jul 2019 16:34:30 -0500 Subject: [PATCH 35/60] Suggested style fixes for data fixtures --- setup.cfg | 3 ++- test.py | 36 +++++++++++++++++++++++++++--------- input.py => test_data.py | 4 +++- 3 files changed, 32 insertions(+), 11 deletions(-) rename input.py => test_data.py (99%) diff --git a/setup.cfg b/setup.cfg index f812af5..7963e68 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,4 @@ [flake8] -ignore = E126,E127,E128,E123,E226,E241,E242,E265,N802,N803,N806,W503,E402,N814,W504,F401,F811 +ignore = E126,E127,E128,E123,E226,E241,E242,E265,N802,N803,N806,W503,E402,N814,W504 max-line-length=85 +per-file-ignores = test.py:F811 diff --git a/test.py b/test.py index 75fabad..543abaf 100644 --- a/test.py +++ b/test.py @@ -15,10 +15,12 @@ from pyopencl.tools import ( # noqa as pytest_generate_tests) import utilities as u -from input import data +from test_data import test_flux_data_fixture # noqa: F401 -def test_weno_flux_uniform_grid(ctx_factory, data): +def test_weno_flux_uniform_grid(ctx_factory, test_flux_data_fixture): + data = test_flux_data_fixture + prg = u.get_weno_program_with_root_kernel("weno_flux") queue = u.get_queue(ctx_factory) @@ -35,7 +37,9 @@ def test_weno_flux_uniform_grid(ctx_factory, data): u.compare_arrays(flux_dev.get(), data.weno_flux) -def test_consistent_part_uniform_grid(ctx_factory, data): +def test_consistent_part_uniform_grid(ctx_factory, test_flux_data_fixture): + data = test_flux_data_fixture + prg = u.get_weno_program_with_root_kernel("consistent_part") queue = u.get_queue(ctx_factory) @@ -48,7 +52,9 @@ def test_consistent_part_uniform_grid(ctx_factory, data): u.compare_arrays(consistent_dev.get(), data.consistent) -def test_dissipation_part_pos_uniform_grid(ctx_factory, data): +def test_dissipation_part_pos_uniform_grid(ctx_factory, test_flux_data_fixture): + data = test_flux_data_fixture + prg = u.get_weno_program_with_root_kernel("dissipation_part_pos") queue = u.get_queue(ctx_factory) @@ -63,7 +69,9 @@ def test_dissipation_part_pos_uniform_grid(ctx_factory, data): u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) -def test_dissipation_part_neg_uniform_grid(ctx_factory, data): +def test_dissipation_part_neg_uniform_grid(ctx_factory, test_flux_data_fixture): + data = test_flux_data_fixture + prg = u.get_weno_program_with_root_kernel("dissipation_part_neg") queue = u.get_queue(ctx_factory) @@ -78,7 +86,9 @@ def test_dissipation_part_neg_uniform_grid(ctx_factory, data): u.compare_arrays(dissipation_dev.get(), data.dissipation_neg) -def test_weno_weights_pos_uniform_grid(ctx_factory, data): +def test_weno_weights_pos_uniform_grid(ctx_factory, test_flux_data_fixture): + data = test_flux_data_fixture + prg = u.get_weno_program_with_root_kernel("weno_weights_pos") queue = u.get_queue(ctx_factory) @@ -92,7 +102,9 @@ def test_weno_weights_pos_uniform_grid(ctx_factory, data): u.compare_arrays(weights_dev.get(), data.weno_weights_pos) -def test_weno_weights_neg_uniform_grid(ctx_factory, data): +def test_weno_weights_neg_uniform_grid(ctx_factory, test_flux_data_fixture): + data = test_flux_data_fixture + prg = u.get_weno_program_with_root_kernel("weno_weights_neg") queue = u.get_queue(ctx_factory) @@ -106,7 +118,9 @@ def test_weno_weights_neg_uniform_grid(ctx_factory, data): u.compare_arrays(weights_dev.get(), data.weno_weights_neg) -def test_flux_splitting_uniform_grid(ctx_factory, data): +def test_flux_splitting_uniform_grid(ctx_factory, test_flux_data_fixture): + data = test_flux_data_fixture + prg = u.get_weno_program_with_root_kernel("split_characteristic_fluxes") queue = u.get_queue(ctx_factory) @@ -126,6 +140,8 @@ def test_flux_splitting_uniform_grid(ctx_factory, data): def test_pointwise_eigenvalues_ideal_gas(ctx_factory, data): + data = test_flux_data_fixture + prg = u.get_weno_program_with_root_kernel("pointwise_eigenvalues") queue = u.get_queue(ctx_factory) @@ -137,7 +153,9 @@ def test_pointwise_eigenvalues_ideal_gas(ctx_factory, data): u.compare_arrays(lam_dev.get(), data.lam_pointwise) -def test_roe_uniform_grid_ideal_gas(ctx_factory, data): +def test_roe_uniform_grid_ideal_gas(ctx_factory, test_flux_data_fixture): + data = test_flux_data_fixture + def identity_matrix(n): return np.identity(n).astype(np.float32).copy(order="F") diff --git a/input.py b/test_data.py similarity index 99% rename from input.py rename to test_data.py index f29c026..5319930 100644 --- a/input.py +++ b/test_data.py @@ -1,6 +1,7 @@ import pytest import utilities as u + # {{{ FluxDataSingle class FluxDataSingle: @@ -72,6 +73,7 @@ class FluxDataSingle: # }}} + single_data = {} # {{{ Input data: Case (a) @@ -703,7 +705,7 @@ single_data["Case d:z"] = FluxDataSingle( "Case b:x", "Case b:y", "Case b:z", "Case c:x", "Case c:y", "Case c:z", "Case d:x", "Case d:y", "Case d:z"]) -def data(request): +def test_flux_data_fixture(request): return single_data[request.param] -- GitLab From 55a528e67a744084a2689b4eeff2e85adc328180 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 28 Jul 2019 17:12:04 -0500 Subject: [PATCH 36/60] Rename test_data to avoid pytest confusion --- test_data.py => data_for_test.py | 0 test.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename test_data.py => data_for_test.py (100%) diff --git a/test_data.py b/data_for_test.py similarity index 100% rename from test_data.py rename to data_for_test.py diff --git a/test.py b/test.py index 543abaf..be05de0 100644 --- a/test.py +++ b/test.py @@ -15,7 +15,7 @@ from pyopencl.tools import ( # noqa as pytest_generate_tests) import utilities as u -from test_data import test_flux_data_fixture # noqa: F401 +from data_for_test import test_flux_data_fixture # noqa: F401 def test_weno_flux_uniform_grid(ctx_factory, test_flux_data_fixture): -- GitLab From 266f95dc04484bf4b6a58c2af7c0ad911b1f4233 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 28 Jul 2019 17:12:13 -0500 Subject: [PATCH 37/60] Flake8 fixes --- data_for_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data_for_test.py b/data_for_test.py index 5319930..8390952 100644 --- a/data_for_test.py +++ b/data_for_test.py @@ -55,21 +55,21 @@ class FluxDataSingle: def swap_array(self, arr, d): p = self.permutation(d) - arr[p] = arr[[1,2,3]] + arr[p] = arr[[1, 2, 3]] return arr def swap_array_rows(self, arr, d): p = self.permutation(d) - arr[p,:] = arr[[1,2,3],:] + arr[p, :] = arr[[1, 2, 3], :] return arr def swap_array_cols(self, arr, d): p = self.permutation(d) - arr[:,p] = arr[:,[1,2,3]] + arr[:, p] = arr[:, [1, 2, 3]] return arr def permutation(self, d): - return [(d-1+i)%3 + 1 for i in range(3)] + return [(d-1+i) % 3 + 1 for i in range(3)] # }}} -- GitLab From e98686197ebd49a4f33990dc5871768d251b6874 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 28 Jul 2019 17:18:15 -0500 Subject: [PATCH 38/60] Rename test_flux_data_fixture -> flux_test_data_fixture to avoid pytest confusion --- data_for_test.py | 2 +- test.py | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/data_for_test.py b/data_for_test.py index 8390952..c83dd53 100644 --- a/data_for_test.py +++ b/data_for_test.py @@ -705,7 +705,7 @@ single_data["Case d:z"] = FluxDataSingle( "Case b:x", "Case b:y", "Case b:z", "Case c:x", "Case c:y", "Case c:z", "Case d:x", "Case d:y", "Case d:z"]) -def test_flux_data_fixture(request): +def flux_test_data_fixture(request): return single_data[request.param] diff --git a/test.py b/test.py index be05de0..8ee0e49 100644 --- a/test.py +++ b/test.py @@ -15,11 +15,11 @@ from pyopencl.tools import ( # noqa as pytest_generate_tests) import utilities as u -from data_for_test import test_flux_data_fixture # noqa: F401 +from data_for_test import flux_test_data_fixture # noqa: F401 -def test_weno_flux_uniform_grid(ctx_factory, test_flux_data_fixture): - data = test_flux_data_fixture +def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("weno_flux") queue = u.get_queue(ctx_factory) @@ -37,8 +37,8 @@ def test_weno_flux_uniform_grid(ctx_factory, test_flux_data_fixture): u.compare_arrays(flux_dev.get(), data.weno_flux) -def test_consistent_part_uniform_grid(ctx_factory, test_flux_data_fixture): - data = test_flux_data_fixture +def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("consistent_part") queue = u.get_queue(ctx_factory) @@ -52,8 +52,8 @@ def test_consistent_part_uniform_grid(ctx_factory, test_flux_data_fixture): u.compare_arrays(consistent_dev.get(), data.consistent) -def test_dissipation_part_pos_uniform_grid(ctx_factory, test_flux_data_fixture): - data = test_flux_data_fixture +def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("dissipation_part_pos") queue = u.get_queue(ctx_factory) @@ -69,8 +69,8 @@ def test_dissipation_part_pos_uniform_grid(ctx_factory, test_flux_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) -def test_dissipation_part_neg_uniform_grid(ctx_factory, test_flux_data_fixture): - data = test_flux_data_fixture +def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("dissipation_part_neg") queue = u.get_queue(ctx_factory) @@ -86,8 +86,8 @@ def test_dissipation_part_neg_uniform_grid(ctx_factory, test_flux_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_neg) -def test_weno_weights_pos_uniform_grid(ctx_factory, test_flux_data_fixture): - data = test_flux_data_fixture +def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("weno_weights_pos") queue = u.get_queue(ctx_factory) @@ -102,8 +102,8 @@ def test_weno_weights_pos_uniform_grid(ctx_factory, test_flux_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_pos) -def test_weno_weights_neg_uniform_grid(ctx_factory, test_flux_data_fixture): - data = test_flux_data_fixture +def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("weno_weights_neg") queue = u.get_queue(ctx_factory) @@ -118,8 +118,8 @@ def test_weno_weights_neg_uniform_grid(ctx_factory, test_flux_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_neg) -def test_flux_splitting_uniform_grid(ctx_factory, test_flux_data_fixture): - data = test_flux_data_fixture +def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("split_characteristic_fluxes") queue = u.get_queue(ctx_factory) @@ -140,7 +140,7 @@ def test_flux_splitting_uniform_grid(ctx_factory, test_flux_data_fixture): def test_pointwise_eigenvalues_ideal_gas(ctx_factory, data): - data = test_flux_data_fixture + data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("pointwise_eigenvalues") queue = u.get_queue(ctx_factory) @@ -153,8 +153,8 @@ def test_pointwise_eigenvalues_ideal_gas(ctx_factory, data): u.compare_arrays(lam_dev.get(), data.lam_pointwise) -def test_roe_uniform_grid_ideal_gas(ctx_factory, test_flux_data_fixture): - data = test_flux_data_fixture +def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture def identity_matrix(n): return np.identity(n).astype(np.float32).copy(order="F") -- GitLab From 7f1e91319ca04091f0c94899d884f623d21c8294 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 28 Jul 2019 18:52:34 -0500 Subject: [PATCH 39/60] Fix an incorrect fixture argument --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 8ee0e49..ab1c138 100644 --- a/test.py +++ b/test.py @@ -139,7 +139,7 @@ def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(fluxes_neg_dev.get(), data.char_fluxes_neg) -def test_pointwise_eigenvalues_ideal_gas(ctx_factory, data): +def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture prg = u.get_weno_program_with_root_kernel("pointwise_eigenvalues") -- GitLab From 399099e3bce15643e41f6a65f34961d526cffe93 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Fri, 2 Aug 2019 23:23:20 -0500 Subject: [PATCH 40/60] only running weno_weights_pos test right now so we can focus on this issue --- test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test.py b/test.py index ab1c138..183d89b 100644 --- a/test.py +++ b/test.py @@ -18,6 +18,7 @@ import utilities as u from data_for_test import flux_test_data_fixture # noqa: F401 +@pytest.mark.slow def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -37,6 +38,7 @@ def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(flux_dev.get(), data.weno_flux) +@pytest.mark.slow def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -52,6 +54,7 @@ def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(consistent_dev.get(), data.consistent) +@pytest.mark.slow def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -69,6 +72,7 @@ def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) +@pytest.mark.slow def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -102,6 +106,7 @@ def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_pos) +@pytest.mark.slow def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -118,6 +123,7 @@ def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_neg) +@pytest.mark.slow def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -139,6 +145,7 @@ def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(fluxes_neg_dev.get(), data.char_fluxes_neg) +@pytest.mark.slow def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -153,6 +160,7 @@ def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): u.compare_arrays(lam_dev.get(), data.lam_pointwise) +@pytest.mark.slow def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -192,6 +200,7 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): check_roe_property(data.state_pair, data.flux_pair, R, R_inv, lam) +@pytest.mark.slow @pytest.mark.parametrize("lam_pointwise_str,lam_roe_str,lam_expected_str", [ ("1 2 3 4 5,2 4 6 8 10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), ("1 2 3 4 5,-2 -4 -6 -8 -10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), @@ -217,6 +226,7 @@ def test_lax_wavespeeds( u.compare_arrays(lam_dev.get(), lam_expected) +@pytest.mark.slow def test_matvec(ctx_factory): prg = u.get_weno_program_with_root_kernel("mult_mat_vec") queue = u.get_queue(ctx_factory) -- GitLab From 8762b67a7e0d02bc24eddebfb1fd8903664deade Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Fri, 2 Aug 2019 23:43:16 -0500 Subject: [PATCH 41/60] chasing weighted sum bug --- WENO.F90 | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index b6bc335..18e30b7 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -757,26 +757,28 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric p = 2 do i=1,nvars - IS(1) = (1.0/4)*(characteristic_fluxes(i,-2) - 4*characteristic_fluxes(i,-1) & - + 3*characteristic_fluxes(i,0))**2 + (13.0/12)*(characteristic_fluxes(i,-2) & - - 2*characteristic_fluxes(i,-1) + characteristic_fluxes(i,0))**2 - IS(2) = (1.0/4)*(-characteristic_fluxes(i,-1) - characteristic_fluxes(i,1))**2 & - + (13.0/12)*(characteristic_fluxes(i,-1) & - - 2*characteristic_fluxes(i,0) + characteristic_fluxes(i,1))**2 - IS(3) = (1.0/4)*(-3*characteristic_fluxes(i,0) + 4*characteristic_fluxes(i,1) & - - characteristic_fluxes(i,2))**2 + (13.0/12)*(characteristic_fluxes(i,0) & - - 2*characteristic_fluxes(i,1) + characteristic_fluxes(i,2))**2 - - !call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) - !call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) + !w1sum(1) = characteristic_fluxes(i,-2) - 4*characteristic_fluxes(i,-1) & + ! + 3*characteristic_fluxes(i,0) + w2sum(1) = -characteristic_fluxes(i,-1) - characteristic_fluxes(i,1) !!! BUG !!! + !w3sum(1) = -3*characteristic_fluxes(i,0) + 4*characteristic_fluxes(i,1) & + ! - characteristic_fluxes(i,2) + !c1sum(1) = characteristic_fluxes(i,-2) & + ! - 2*characteristic_fluxes(i,-1) + characteristic_fluxes(i,0) + !c2sum(1) = characteristic_fluxes(i,-1) & + ! - 2*characteristic_fluxes(i,0) + characteristic_fluxes(i,1) + c3sum(1) = characteristic_fluxes(i,0) & + - 2*characteristic_fluxes(i,1) + characteristic_fluxes(i,2) + + call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) + call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) !call weighted_sum(3, weights2, characteristic_fluxes(i,-1:1), w2sum) - !call weighted_sum(3, weightsc, characteristic_fluxes(i,-1:1), c2sum) - !call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) + call weighted_sum(3, weightsc, characteristic_fluxes(i,-1:1), c2sum) + call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) !call weighted_sum(3, weightsc, characteristic_fluxes(i,0:2), c3sum) - !IS(1) = (1.0/4)*w1sum(1)**2 + (13.0/12)*c1sum(1)**2 - !IS(2) = (1.0/4)*w2sum(1)**2 + (13.0/12)*c2sum(1)**2 - !IS(3) = (1.0/4)*w3sum(1)**2 + (13.0/12)*c3sum(1)**2 + IS(1) = (1.0/4)*w1sum(1)**2 + (13.0/12)*c1sum(1)**2 + IS(2) = (1.0/4)*w2sum(1)**2 + (13.0/12)*c2sum(1)**2 + IS(3) = (1.0/4)*w3sum(1)**2 + (13.0/12)*c3sum(1)**2 do j=1,3 alpha(j) = C(j)/(IS(j) + eps)**p -- GitLab From 083c17abc4b5753af444607c7c6c74d30dabd6f8 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Fri, 2 Aug 2019 23:57:21 -0500 Subject: [PATCH 42/60] Revert "only running weno_weights_pos test right now so we can focus on this issue" This reverts commit 399099e3bce15643e41f6a65f34961d526cffe93. --- test.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test.py b/test.py index 183d89b..ab1c138 100644 --- a/test.py +++ b/test.py @@ -18,7 +18,6 @@ import utilities as u from data_for_test import flux_test_data_fixture # noqa: F401 -@pytest.mark.slow def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -38,7 +37,6 @@ def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(flux_dev.get(), data.weno_flux) -@pytest.mark.slow def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -54,7 +52,6 @@ def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(consistent_dev.get(), data.consistent) -@pytest.mark.slow def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -72,7 +69,6 @@ def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) -@pytest.mark.slow def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -106,7 +102,6 @@ def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_pos) -@pytest.mark.slow def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -123,7 +118,6 @@ def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_neg) -@pytest.mark.slow def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -145,7 +139,6 @@ def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(fluxes_neg_dev.get(), data.char_fluxes_neg) -@pytest.mark.slow def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -160,7 +153,6 @@ def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): u.compare_arrays(lam_dev.get(), data.lam_pointwise) -@pytest.mark.slow def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -200,7 +192,6 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): check_roe_property(data.state_pair, data.flux_pair, R, R_inv, lam) -@pytest.mark.slow @pytest.mark.parametrize("lam_pointwise_str,lam_roe_str,lam_expected_str", [ ("1 2 3 4 5,2 4 6 8 10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), ("1 2 3 4 5,-2 -4 -6 -8 -10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), @@ -226,7 +217,6 @@ def test_lax_wavespeeds( u.compare_arrays(lam_dev.get(), lam_expected) -@pytest.mark.slow def test_matvec(ctx_factory): prg = u.get_weno_program_with_root_kernel("mult_mat_vec") queue = u.get_queue(ctx_factory) -- GitLab From 8440f1351830f5c67a3b4efb75b4dc7497c38db6 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 3 Aug 2019 00:01:00 -0500 Subject: [PATCH 43/60] convert code and tests to double precision --- WENO.F90 | 272 +++++++++++++++++++++++++-------------------------- test.py | 2 +- utilities.py | 4 +- 3 files changed, 139 insertions(+), 139 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index 18e30b7..162eba8 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -23,28 +23,28 @@ subroutine compute_flux_derivatives(nvars, ndim, nx, ny, nz, & implicit none integer, intent(in) :: nvars, ndim, nx, ny, nz - real, intent(in) :: states(nvars, -2:nx+3, -2:ny+3, -2:nz+3) - real, intent(in) :: fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - real, intent(in) :: metrics(ndim, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - real, intent(in) :: metric_jacobians(-2:nx+3, -2:ny+3, -2:nz+3) - real, intent(out) :: flux_derivatives(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - - real flux_derivatives_generalized(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - real weno_flux_tmp(nvars, 0:nx+1, 0:ny+1, 0:nz+1) - - real generalized_fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - real generalized_states_frozen(nvars, -2:3) - real generalized_fluxes_frozen(nvars, ndim, -2:3) - real metric_solve_tmp(ndim) - real R(nvars, nvars), R_inv(nvars, nvars), lambda_roe(nvars) - real lambda_pointwise(nvars, -2:3) - real wavespeeds(nvars) + real*8, intent(in) :: states(nvars, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: metrics(ndim, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: metric_jacobians(-2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(out) :: flux_derivatives(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + + real*8 flux_derivatives_generalized(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8 weno_flux_tmp(nvars, 0:nx+1, 0:ny+1, 0:nz+1) + + real*8 generalized_fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8 generalized_states_frozen(nvars, -2:3) + real*8 generalized_fluxes_frozen(nvars, ndim, -2:3) + real*8 metric_solve_tmp(ndim) + real*8 R(nvars, nvars), R_inv(nvars, nvars), lambda_roe(nvars) + real*8 lambda_pointwise(nvars, -2:3) + real*8 wavespeeds(nvars) integer i, j, k - real delta_xi, delta_eta, delta_zeta - real characteristic_fluxes_pos(nvars, -2:3) - real characteristic_fluxes_neg(nvars, -2:3) - real metrics_frozen(ndim, ndim) - real combined_frozen_metrics(ndim) + real*8 delta_xi, delta_eta, delta_zeta + real*8 characteristic_fluxes_pos(nvars, -2:3) + real*8 characteristic_fluxes_neg(nvars, -2:3) + real*8 metrics_frozen(ndim, ndim) + real*8 combined_frozen_metrics(ndim) integer v, d ! grid spacing in generalized coordinates @@ -250,10 +250,10 @@ subroutine pointwise_eigenvalues(nvars, d, states, lambda_pointwise) integer, intent(in) :: nvars integer, intent(in) :: d - real, intent(in) :: states(nvars, -2:3) - real, intent(out) :: lambda_pointwise(nvars, -2:3) + real*8, intent(in) :: states(nvars, -2:3) + real*8, intent(out) :: lambda_pointwise(nvars, -2:3) - real u(3), c, p, rho, ke + real*8 u(3), c, p, rho, ke integer v, k, i do k=-2,3 @@ -280,21 +280,21 @@ subroutine roe_eigensystem(nvars, ndim, d, states, metrics_frozen, R, R_inv, lam integer, intent(in) :: nvars integer, intent(in) :: ndim integer, intent(in) :: d - real, intent(in) :: states(nvars, 2) - real, intent(in) :: metrics_frozen(ndim, ndim) - real, intent(out) :: R(nvars, nvars) - real, intent(out) :: R_inv(nvars, nvars) - real, intent(out) :: lambda_roe(nvars) + real*8, intent(in) :: states(nvars, 2) + real*8, intent(in) :: metrics_frozen(ndim, ndim) + real*8, intent(out) :: R(nvars, nvars) + real*8, intent(out) :: R_inv(nvars, nvars) + real*8, intent(out) :: lambda_roe(nvars) integer ik, il, im - real metric_norm(ndim) - real p, ke - real u_orig(ndim, 2), H_orig(2) - real sqrt_rho(2), sqrt_rho_sum - real u(ndim), rho, c, H, q - real u_tilde(ndim), k(ndim), l(ndim), m(ndim) + real*8 metric_norm(ndim) + real*8 p, ke + real*8 u_orig(ndim, 2), H_orig(2) + real*8 sqrt_rho(2), sqrt_rho_sum + real*8 u(ndim), rho, c, H, q + real*8 u_tilde(ndim), k(ndim), l(ndim), m(ndim) integer i, j - real b1, b2, alpha, beta + real*8 b1, b2, alpha, beta ik = d il = d+1 @@ -441,11 +441,11 @@ subroutine lax_wavespeeds(nvars, lambda_pointwise, lambda_roe, wavespeeds) implicit none integer, intent(in) :: nvars - real, intent(in) :: lambda_pointwise(nvars, -2:3) - real, intent(in) :: lambda_roe(nvars) - real, intent(out) :: wavespeeds(nvars) + real*8, intent(in) :: lambda_pointwise(nvars, -2:3) + real*8, intent(in) :: lambda_roe(nvars) + real*8, intent(out) :: wavespeeds(nvars) - real kappa + real*8 kappa integer v integer k @@ -471,16 +471,16 @@ subroutine convert_to_generalized_frozen( & generalized_states_frozen, & generalized_fluxes_frozen) integer, intent(in) :: nvars, ndim - real, intent(in) :: states(nvars, -2:3) - real, intent(in) :: fluxes(nvars, ndim, -2:3) - real, intent(in) :: metrics(ndim, ndim, 2) - real, intent(in) :: metric_jacobians(2) - real, intent(out) :: metrics_frozen(ndim, ndim) - real, intent(out) :: combined_frozen_metrics(ndim) - real, intent(out) :: generalized_states_frozen(nvars, -2:3) - real, intent(out) :: generalized_fluxes_frozen(nvars, ndim, -2:3) + real*8, intent(in) :: states(nvars, -2:3) + real*8, intent(in) :: fluxes(nvars, ndim, -2:3) + real*8, intent(in) :: metrics(ndim, ndim, 2) + real*8, intent(in) :: metric_jacobians(2) + real*8, intent(out) :: metrics_frozen(ndim, ndim) + real*8, intent(out) :: combined_frozen_metrics(ndim) + real*8, intent(out) :: generalized_states_frozen(nvars, -2:3) + real*8, intent(out) :: generalized_fluxes_frozen(nvars, ndim, -2:3) - real jacobian_frozen + real*8 jacobian_frozen integer c, k, v integer i, j @@ -525,10 +525,10 @@ subroutine convert_to_generalized(nvars, ndim, nx, ny, nz, & implicit none integer, intent(in) :: nvars, ndim, nx, ny, nz - real, intent(in) :: fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - real, intent(in) :: metrics(ndim, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - real, intent(in) :: metric_jacobians(-2:nx+3, -2:ny+3, -2:nz+3) - real, intent(out) :: generalized_fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: metrics(ndim, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: metric_jacobians(-2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(out) :: generalized_fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) integer i, j, k, v @@ -552,10 +552,10 @@ subroutine convert_from_generalized(nvars, ndim, nx, ny, nz, & implicit none integer, intent(in) :: nvars, ndim, nx, ny, nz - real, intent(in) :: flux_derivatives_generalized(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - real, intent(in) :: metrics(ndim, ndim, -2:nx+3, -2:ny+3, -2:nz+3) - real, intent(in) :: metric_jacobians(-2:nx+3, -2:ny+3, -2:nz+3) - real, intent(out) :: flux_derivatives(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: flux_derivatives_generalized(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: metrics(ndim, ndim, -2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(in) :: metric_jacobians(-2:nx+3, -2:ny+3, -2:nz+3) + real*8, intent(out) :: flux_derivatives(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) integer i, j, k, v integer d @@ -579,11 +579,11 @@ end subroutine subroutine solve3x3(a, b, x) implicit none - real, intent(in) :: a(3,3), b(3) - real, intent(out) :: x(3) + real*8, intent(in) :: a(3,3), b(3) + real*8, intent(out) :: x(3) - real temp(3,3) - real det_a(1), det_temp(1) + real*8 temp(3,3) + real*8 det_a(1), det_temp(1) integer k integer i,j @@ -603,8 +603,8 @@ end subroutine subroutine determinant3x3(a, det) implicit none - real, intent(in) :: a(3,3) - real, intent(out) :: det(1) + real*8, intent(in) :: a(3,3) + real*8, intent(out) :: det(1) det(1) = a(1,1)*(a(2,2)*a(3,3) - a(2,3)*a(3,2)) & + a(1,2)*(a(2,3)*a(3,1) - a(2,1)*a(3,3)) & @@ -621,12 +621,12 @@ subroutine split_characteristic_fluxes(nvars, & implicit none integer, intent(in) :: nvars - real, intent(in) :: generalized_states_frozen(nvars, -2:3) - real, intent(in) :: generalized_fluxes_frozen(nvars, -2:3) - real, intent(in) :: R_inv(nvars, nvars) - real, intent(in) :: wavespeeds(nvars) - real, intent(out) :: characteristic_fluxes_pos(nvars, -2:3) - real, intent(out) :: characteristic_fluxes_neg(nvars, -2:3) + real*8, intent(in) :: generalized_states_frozen(nvars, -2:3) + real*8, intent(in) :: generalized_fluxes_frozen(nvars, -2:3) + real*8, intent(in) :: R_inv(nvars, nvars) + real*8, intent(in) :: wavespeeds(nvars) + real*8, intent(out) :: characteristic_fluxes_pos(nvars, -2:3) + real*8, intent(out) :: characteristic_fluxes_neg(nvars, -2:3) integer k, m integer l @@ -652,16 +652,16 @@ subroutine weno_flux(nvars, generalized_fluxes, characteristic_fluxes_pos, & implicit none integer, intent(in) :: nvars - real, intent(in) :: generalized_fluxes(nvars, -2:3) - real, intent(in) :: characteristic_fluxes_pos(nvars, -2:3) - real, intent(in) :: characteristic_fluxes_neg(nvars, -2:3) - real, intent(in) :: combined_frozen_metrics - real, intent(in) :: R(nvars, nvars) - real, intent(out) :: flux(nvars) - - real consistent(nvars) - real dissipation_pos(nvars) - real dissipation_neg(nvars) + real*8, intent(in) :: generalized_fluxes(nvars, -2:3) + real*8, intent(in) :: characteristic_fluxes_pos(nvars, -2:3) + real*8, intent(in) :: characteristic_fluxes_neg(nvars, -2:3) + real*8, intent(in) :: combined_frozen_metrics + real*8, intent(in) :: R(nvars, nvars) + real*8, intent(out) :: flux(nvars) + + real*8 consistent(nvars) + real*8 dissipation_pos(nvars) + real*8 dissipation_neg(nvars) integer v call consistent_part(nvars, generalized_fluxes, consistent) @@ -679,8 +679,8 @@ subroutine consistent_part(nvars, generalized_fluxes, consistent) implicit none integer, intent(in) :: nvars - real, intent(in) :: generalized_fluxes(nvars, -2:3) - real, intent(out) :: consistent(nvars) + real*8, intent(in) :: generalized_fluxes(nvars, -2:3) + real*8, intent(out) :: consistent(nvars) integer v @@ -697,12 +697,12 @@ subroutine dissipation_part_pos(nvars, characteristic_fluxes, & implicit none integer, intent(in) :: nvars - real, intent(in) :: characteristic_fluxes(nvars, -2:3) - real, intent(in) :: combined_frozen_metrics - real, intent(in) :: R(nvars, nvars) - real, intent(out) :: dissipation_pos(nvars) + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(in) :: combined_frozen_metrics + real*8, intent(in) :: R(nvars, nvars) + real*8, intent(out) :: dissipation_pos(nvars) - real combined_fluxes(nvars) + real*8 combined_fluxes(nvars) call weno_combination_pos(nvars, characteristic_fluxes, combined_frozen_metrics, combined_fluxes) @@ -714,12 +714,12 @@ subroutine weno_combination_pos(nvars, characteristic_fluxes, & implicit none integer, intent(in) :: nvars - real, intent(in) :: characteristic_fluxes(nvars, -2:3) - real, intent(in) :: combined_frozen_metrics - real, intent(out) :: combined_fluxes(nvars) + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(in) :: combined_frozen_metrics + real*8, intent(out) :: combined_fluxes(nvars) - real w(nvars, 3) - real flux_differences(nvars, 3) + real*8 w(nvars, 3) + real*8 flux_differences(nvars, 3) integer v call weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metrics, w) @@ -736,22 +736,22 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric implicit none integer, intent(in) :: nvars - real, intent(in) :: characteristic_fluxes(nvars, -2:3) - real, intent(in) :: combined_frozen_metrics - real, intent(out) :: w(nvars, 3) + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(in) :: combined_frozen_metrics + real*8, intent(out) :: w(nvars, 3) - real :: C(3) = (/0.1, 0.6, 0.3/) - real :: weights1(0:2) = (/1, -4, 3/) - real :: weights2(0:2) = (/-1, 0, 1/) - real :: weights3(0:2) = (/-3, 4, -1/) - real :: weightsc(0:2) = (/1, -2, 1/) + real*8 :: C(3) = (/0.1, 0.6, 0.3/) + real*8 :: weights1(0:2) = (/1, -4, 3/) + real*8 :: weights2(0:2) = (/-1, 0, 1/) + real*8 :: weights3(0:2) = (/-3, 4, -1/) + real*8 :: weightsc(0:2) = (/1, -2, 1/) - real IS(3), alpha(3), eps + real*8 IS(3), alpha(3), eps - real w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) + real*8 w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) integer p, i, j - real sum_alpha(1) + real*8 sum_alpha(1) eps = 1e-6*combined_frozen_metrics p = 2 @@ -794,8 +794,8 @@ subroutine flux_differences_pos(nvars, characteristic_fluxes, flux_differences) implicit none integer, intent(in) :: nvars - real, intent(in) :: characteristic_fluxes(nvars, -2:3) - real, intent(out) :: flux_differences(nvars, 3) + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(out) :: flux_differences(nvars, 3) integer i, v @@ -812,12 +812,12 @@ subroutine dissipation_part_neg(nvars, characteristic_fluxes, & implicit none integer, intent(in) :: nvars - real, intent(in) :: characteristic_fluxes(nvars, -2:3) - real, intent(in) :: combined_frozen_metrics - real, intent(in) :: R(nvars, nvars) - real, intent(out) :: dissipation_neg(nvars) + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(in) :: combined_frozen_metrics + real*8, intent(in) :: R(nvars, nvars) + real*8, intent(out) :: dissipation_neg(nvars) - real combined_fluxes(nvars) + real*8 combined_fluxes(nvars) call weno_combination_neg(nvars, characteristic_fluxes, combined_frozen_metrics, combined_fluxes) @@ -829,12 +829,12 @@ subroutine weno_combination_neg(nvars, characteristic_fluxes, & implicit none integer, intent(in) :: nvars - real, intent(in) :: characteristic_fluxes(nvars, -2:3) - real, intent(in) :: combined_frozen_metrics - real, intent(out) :: combined_fluxes(nvars) + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(in) :: combined_frozen_metrics + real*8, intent(out) :: combined_fluxes(nvars) - real w(nvars, 3) - real flux_differences(nvars, 3) + real*8 w(nvars, 3) + real*8 flux_differences(nvars, 3) integer v call weno_weights_neg(nvars, characteristic_fluxes, combined_frozen_metrics, w) @@ -851,21 +851,21 @@ subroutine weno_weights_neg(nvars, characteristic_fluxes, combined_frozen_metric implicit none integer, intent(in) :: nvars - real, intent(in) :: characteristic_fluxes(nvars, -2:3) - real, intent(in) :: combined_frozen_metrics - real, intent(out) :: w(nvars, 3) + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(in) :: combined_frozen_metrics + real*8, intent(out) :: w(nvars, 3) - real :: C(3) = (/0.1, 0.6, 0.3/) - real :: weights1(0:2) = (/1, -4, 3/) - real :: weights2(0:2) = (/-1, 0, 1/) - real :: weights3(0:2) = (/-3, 4, -1/) - real :: weightsc(0:2) = (/1, -2, 1/) + real*8 :: C(3) = (/0.1, 0.6, 0.3/) + real*8 :: weights1(0:2) = (/1, -4, 3/) + real*8 :: weights2(0:2) = (/-1, 0, 1/) + real*8 :: weights3(0:2) = (/-3, 4, -1/) + real*8 :: weightsc(0:2) = (/1, -2, 1/) - real IS(3), alpha(3), eps - real w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) + real*8 IS(3), alpha(3), eps + real*8 w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) integer p, i, j - real sum_alpha(1) + real*8 sum_alpha(1) eps = 1e-6*combined_frozen_metrics p = 2 @@ -896,8 +896,8 @@ subroutine flux_differences_neg(nvars, characteristic_fluxes, flux_differences) implicit none integer, intent(in) :: nvars - real, intent(in) :: characteristic_fluxes(nvars, -2:3) - real, intent(out) :: flux_differences(nvars, 3) + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(out) :: flux_differences(nvars, 3) integer i, v @@ -913,13 +913,13 @@ subroutine mult_mat_vec(m, n, alpha, a, b, c) implicit none integer, intent(in) :: m, n - real, intent(in) :: alpha - real, intent(in) :: a(m, n) - real, intent(in) :: b(n) - real, intent(out) :: c(m) + real*8, intent(in) :: alpha + real*8, intent(in) :: a(m, n) + real*8, intent(in) :: b(n) + real*8, intent(out) :: c(m) integer i, j - real accumulator + real*8 accumulator do i=1,m accumulator = 0.0 @@ -934,8 +934,8 @@ subroutine sum_array(n, a, a_sum) implicit none integer, intent(in) :: n - real, intent(in) :: a(n) - real, intent(out) :: a_sum(1) + real*8, intent(in) :: a(n) + real*8, intent(out) :: a_sum(1) integer i @@ -949,8 +949,8 @@ subroutine weighted_sum(n, w, a, a_sum) implicit none integer, intent(in) :: n - real, intent(in) :: a(n), w(n) - real, intent(out) :: a_sum(1) + real*8, intent(in) :: a(n), w(n) + real*8, intent(out) :: a_sum(1) integer i diff --git a/test.py b/test.py index ab1c138..427f3e7 100644 --- a/test.py +++ b/test.py @@ -157,7 +157,7 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture def identity_matrix(n): - return np.identity(n).astype(np.float32).copy(order="F") + return np.identity(n).astype(np.float64).copy(order="F") def check_roe_identity(states, R, R_inv): d_state = states[:, 1] - states[:, 0] diff --git a/utilities.py b/utilities.py index 129680a..c8bde8a 100644 --- a/utilities.py +++ b/utilities.py @@ -21,7 +21,7 @@ def random_array_on_device(queue, *shape): def empty_array_on_device(queue, *shape): - return cl.array.empty(queue, shape, dtype=np.float32, order="F") + return cl.array.empty(queue, shape, dtype=np.float64, order="F") def arrays_from_string(string_arrays): @@ -38,7 +38,7 @@ def array_from_string(string_array): return np.array(split_map_to_list(string_array[1:], int, " ")) else: return np.array( - split_map_to_list(string_array, float, " "), dtype=np.float32) + split_map_to_list(string_array, float, " "), dtype=np.float64) def array_from_string_2d(string_array): if string_array[0] == ",": -- GitLab From 689ed68c0c43bb6e84b742da235a5156822dcd3c Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 3 Aug 2019 00:20:40 -0500 Subject: [PATCH 44/60] make Fortran constants double precision --- WENO.F90 | 122 +++++++++++++++++++++++++++---------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index 162eba8..1f66c0b 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -48,9 +48,9 @@ subroutine compute_flux_derivatives(nvars, ndim, nx, ny, nz, & integer v, d ! grid spacing in generalized coordinates - delta_xi = 1.0 - delta_eta = 1.0 - delta_zeta = 1.0 + delta_xi = 1.0d0 + delta_eta = 1.0d0 + delta_zeta = 1.0d0 !$loopy begin tagged: to_generalized !call convert_to_generalized(nvars, ndim, nx, ny, nz, & @@ -61,7 +61,7 @@ subroutine compute_flux_derivatives(nvars, ndim, nx, ny, nz, & do j=-2,ny+3 do i=-2,nx+3 do v=1,nvars - call mult_mat_vec(ndim, ndim, 1.0/metric_jacobians(i,j,k), metrics(:,:,i,j,k), & + call mult_mat_vec(ndim, ndim, 1.0d0/metric_jacobians(i,j,k), metrics(:,:,i,j,k), & fluxes(v,:,i,j,k), generalized_fluxes(v,:,i,j,k)) end do end do @@ -258,13 +258,13 @@ subroutine pointwise_eigenvalues(nvars, d, states, lambda_pointwise) do k=-2,3 rho = states(1,k) - ke = 0.0 + ke = 0.0d0 do i=1,3 u(i) = states(i+1,k)/rho ke = ke + u(i)**2 end do - p = (1.4 - 1)*(states(nvars,k) - 0.5*rho*ke) - c = sqrt(1.4*p/rho) + p = (1.4d0 - 1)*(states(nvars,k) - 0.5d0*rho*ke) + c = sqrt(1.4d0*p/rho) do v=1,nvars-2 lambda_pointwise(v,k) = u(d) @@ -309,17 +309,17 @@ subroutine roe_eigensystem(nvars, ndim, d, states, metrics_frozen, R, R_inv, lam end do do j=1,2 - ke = 0.0 + ke = 0.0d0 do i=1,ndim ke = ke + u_orig(i,j)**2 end do - p = (1.4 - 1.0)*(states(nvars,j) - 0.5*states(1,j)*ke) + p = (1.4d0 - 1)*(states(nvars,j) - 0.5d0*states(1,j)*ke) H_orig(j) = (states(nvars,j) + p)/states(1,j) end do do i=1,ndim - metric_norm(i) = 0.0 + metric_norm(i) = 0.0d0 do j=1,ndim metric_norm(i) = metric_norm(i) + metrics_frozen(i,j)**2 end do @@ -342,33 +342,33 @@ subroutine roe_eigensystem(nvars, ndim, d, states, metrics_frozen, R, R_inv, lam rho = sqrt_rho(1)*sqrt_rho(2) H = (H_orig(1)*sqrt_rho(1) + H_orig(2)*sqrt_rho(2))/sqrt_rho_sum - q = 0.0 + q = 0.0d0 do i=1,ndim q = q + u(i)**2 end do - c = sqrt((1.4 - 1.0)*(H - 0.5*q)) + c = sqrt((1.4d0 - 1.0d0)*(H - 0.5d0*q)) - b1 = (1.4 - 1.0)/(c**2) - b2 = 1.0 + b1*q - b1*H + b1 = (1.4d0 - 1.0d0)/(c**2) + b2 = 1.0d0 + b1*q - b1*H - u_tilde(1) = 0.0 + u_tilde(1) = 0.0d0 do i=1,ndim u_tilde(1) = u_tilde(1) + k(i)*u(i) end do - u_tilde(2) = 0.0 + u_tilde(2) = 0.0d0 do i=1,ndim u_tilde(2) = u_tilde(2) + l(i)*u(i) end do - u_tilde(3) = 0.0 + u_tilde(3) = 0.0d0 do i=1,ndim u_tilde(3) = u_tilde(3) + m(i)*u(i) end do - alpha = rho/(2.0*c) - beta = 1.0/(2.0*alpha) + alpha = rho/(2.0d0*c) + beta = 1.0d0/(2.0d0*alpha) lambda_roe(1) = u_tilde(1)*metric_norm(ik) lambda_roe(2) = u_tilde(1)*metric_norm(ik) @@ -376,19 +376,19 @@ subroutine roe_eigensystem(nvars, ndim, d, states, metrics_frozen, R, R_inv, lam lambda_roe(4) = u_tilde(1)*metric_norm(ik) + c*metric_norm(ik) lambda_roe(5) = u_tilde(1)*metric_norm(ik) - c*metric_norm(ik) - R(1,1) = 1.0 + R(1,1) = 1.0d0 R(2,1) = u(1) R(3,1) = u(2) R(4,1) = u(3) - R(5,1) = H - 1.0/b1 + R(5,1) = H - 1.0d0/b1 - R(1,2) = 0.0 + R(1,2) = 0.0d0 R(2,2) = rho*l(1) R(3,2) = rho*l(2) R(4,2) = rho*l(3) R(5,2) = rho*u_tilde(2) - R(1,3) = 0.0 + R(1,3) = 0.0d0 R(2,3) = rho*m(1) R(3,3) = rho*m(2) R(4,3) = rho*m(3) @@ -406,7 +406,7 @@ subroutine roe_eigensystem(nvars, ndim, d, states, metrics_frozen, R, R_inv, lam R(4,5) = alpha*(u(3) - c*k(3)) R(5,5) = alpha*(H - c*u_tilde(1)) - R_inv(1,1) = 1.0 - b2 + R_inv(1,1) = 1.0d0 - b2 R_inv(1,2) = b1*u(1) R_inv(1,3) = b1*u(2) R_inv(1,4) = b1*u(3) @@ -416,13 +416,13 @@ subroutine roe_eigensystem(nvars, ndim, d, states, metrics_frozen, R, R_inv, lam R_inv(2,2) = l(1)/rho R_inv(2,3) = l(2)/rho R_inv(2,4) = l(3)/rho - R_inv(2,5) = 0.0 + R_inv(2,5) = 0.0d0 R_inv(3,1) = -u_tilde(3)/rho R_inv(3,2) = m(1)/rho R_inv(3,3) = m(2)/rho R_inv(3,4) = m(3)/rho - R_inv(3,5) = 0.0 + R_inv(3,5) = 0.0d0 R_inv(4,1) = beta*(b2 - u_tilde(1)/c) R_inv(4,2) = -beta*(b1*u(1) - k(1)/c) @@ -449,7 +449,7 @@ subroutine lax_wavespeeds(nvars, lambda_pointwise, lambda_roe, wavespeeds) integer v integer k - kappa = 1.1 + kappa = 1.1d0 do v=1,nvars wavespeeds(v) = abs(lambda_roe(v)) @@ -487,16 +487,16 @@ subroutine convert_to_generalized_frozen( & do j=1,ndim do i=1,ndim - metrics_frozen(i,j) = 0.0 + metrics_frozen(i,j) = 0.0d0 do c=1,2 - metrics_frozen(i,j) = metrics_frozen(i,j) + 0.5*metrics(i,j,c)/metric_jacobians(c) + metrics_frozen(i,j) = metrics_frozen(i,j) + 0.5d0*metrics(i,j,c)/metric_jacobians(c) end do end do end do - jacobian_frozen = 0.5*(metric_jacobians(1) + metric_jacobians(2)) + jacobian_frozen = 0.5d0*(metric_jacobians(1) + metric_jacobians(2)) do i=1,ndim - combined_frozen_metrics(i) = 0.0 + combined_frozen_metrics(i) = 0.0d0 do j=1,ndim combined_frozen_metrics(i) = combined_frozen_metrics(i) + metrics_frozen(i,j)**2 end do @@ -510,7 +510,7 @@ subroutine convert_to_generalized_frozen( & do k=-2,3 do v=1,nvars - call mult_mat_vec(ndim, ndim, 1.0, metrics_frozen, & + call mult_mat_vec(ndim, ndim, 1.0d0, metrics_frozen, & fluxes(v,:,k), generalized_fluxes_frozen(v,:,k)) end do end do @@ -536,7 +536,7 @@ subroutine convert_to_generalized(nvars, ndim, nx, ny, nz, & do j=-2,ny+3 do i=-2,nx+3 do v=1,nvars - call mult_mat_vec(ndim, ndim, 1.0/metric_jacobians(i,j,k), metrics(:,:,i,j,k), & + call mult_mat_vec(ndim, ndim, 1.0d0/metric_jacobians(i,j,k), metrics(:,:,i,j,k), & fluxes(v,:,i,j,k), generalized_fluxes(v,:,i,j,k)) end do end do @@ -633,14 +633,14 @@ subroutine split_characteristic_fluxes(nvars, & do k=-2,3 do m=1,nvars - characteristic_fluxes_pos(m,k) = 0.0 - characteristic_fluxes_neg(m,k) = 0.0 + characteristic_fluxes_pos(m,k) = 0.0d0 + characteristic_fluxes_neg(m,k) = 0.0d0 do l=1,nvars characteristic_fluxes_pos(m,k) = characteristic_fluxes_pos(m,k) & - + 0.5*R_inv(m,l) & + + 0.5d0*R_inv(m,l) & *(generalized_fluxes_frozen(l,k) + wavespeeds(m)*generalized_states_frozen(l,k)) characteristic_fluxes_neg(m,k) = characteristic_fluxes_neg(m,k) & - + 0.5*R_inv(m,l) & + + 0.5d0*R_inv(m,l) & *(generalized_fluxes_frozen(l,k) - wavespeeds(m)*generalized_states_frozen(l,k)) end do end do @@ -688,7 +688,7 @@ subroutine consistent_part(nvars, generalized_fluxes, consistent) consistent(v) = generalized_fluxes(v,-2) - 8*generalized_fluxes(v,-1) & + 37*generalized_fluxes(v,0) + 37*generalized_fluxes(v,1) & - 8*generalized_fluxes(v,2) + generalized_fluxes(v,3) - consistent(v) = consistent(v)/60.0 + consistent(v) = consistent(v)/60.0d0 end do end subroutine @@ -706,7 +706,7 @@ subroutine dissipation_part_pos(nvars, characteristic_fluxes, & call weno_combination_pos(nvars, characteristic_fluxes, combined_frozen_metrics, combined_fluxes) - call mult_mat_vec(nvars, nvars, -1.0/60, R, combined_fluxes, dissipation_pos) + call mult_mat_vec(nvars, nvars, -1.0d0/60, R, combined_fluxes, dissipation_pos) end subroutine subroutine weno_combination_pos(nvars, characteristic_fluxes, & @@ -740,11 +740,11 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric real*8, intent(in) :: combined_frozen_metrics real*8, intent(out) :: w(nvars, 3) - real*8 :: C(3) = (/0.1, 0.6, 0.3/) - real*8 :: weights1(0:2) = (/1, -4, 3/) - real*8 :: weights2(0:2) = (/-1, 0, 1/) - real*8 :: weights3(0:2) = (/-3, 4, -1/) - real*8 :: weightsc(0:2) = (/1, -2, 1/) + real*8 :: C(3) = (/0.1d0, 0.6d0, 0.3d0/) + real*8 :: weights1(0:2) = (/1.0d0, -4.0d0, 3.0d0/) + real*8 :: weights2(0:2) = (/-1.0d0, 0.0d0, 1.0d0/) + real*8 :: weights3(0:2) = (/-3.0d0, 4.0d0, -1.0d0/) + real*8 :: weightsc(0:2) = (/1.0d0, -2.0d0, 1.0d0/) real*8 IS(3), alpha(3), eps @@ -753,7 +753,7 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric integer p, i, j real*8 sum_alpha(1) - eps = 1e-6*combined_frozen_metrics + eps = 1.0d-6*combined_frozen_metrics p = 2 do i=1,nvars @@ -776,9 +776,9 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) !call weighted_sum(3, weightsc, characteristic_fluxes(i,0:2), c3sum) - IS(1) = (1.0/4)*w1sum(1)**2 + (13.0/12)*c1sum(1)**2 - IS(2) = (1.0/4)*w2sum(1)**2 + (13.0/12)*c2sum(1)**2 - IS(3) = (1.0/4)*w3sum(1)**2 + (13.0/12)*c3sum(1)**2 + IS(1) = (1.0d0/4)*w1sum(1)**2 + (13.0d0/12)*c1sum(1)**2 + IS(2) = (1.0d0/4)*w2sum(1)**2 + (13.0d0/12)*c2sum(1)**2 + IS(3) = (1.0d0/4)*w3sum(1)**2 + (13.0d0/12)*c3sum(1)**2 do j=1,3 alpha(j) = C(j)/(IS(j) + eps)**p @@ -821,7 +821,7 @@ subroutine dissipation_part_neg(nvars, characteristic_fluxes, & call weno_combination_neg(nvars, characteristic_fluxes, combined_frozen_metrics, combined_fluxes) - call mult_mat_vec(nvars, nvars, 1.0/60, R, combined_fluxes, dissipation_neg) + call mult_mat_vec(nvars, nvars, 1.0d0/60, R, combined_fluxes, dissipation_neg) end subroutine subroutine weno_combination_neg(nvars, characteristic_fluxes, & @@ -855,11 +855,11 @@ subroutine weno_weights_neg(nvars, characteristic_fluxes, combined_frozen_metric real*8, intent(in) :: combined_frozen_metrics real*8, intent(out) :: w(nvars, 3) - real*8 :: C(3) = (/0.1, 0.6, 0.3/) - real*8 :: weights1(0:2) = (/1, -4, 3/) - real*8 :: weights2(0:2) = (/-1, 0, 1/) - real*8 :: weights3(0:2) = (/-3, 4, -1/) - real*8 :: weightsc(0:2) = (/1, -2, 1/) + real*8 :: C(3) = (/0.1d0, 0.6d0, 0.3d0/) + real*8 :: weights1(0:2) = (/ 1.0d0, -4.0d0, 3.0d0/) + real*8 :: weights2(0:2) = (/-1.0d0, 0.0d0, 1.0d0/) + real*8 :: weights3(0:2) = (/-3.0d0, 4.0d0, -1.0d0/) + real*8 :: weightsc(0:2) = (/ 1.0d0, -2.0d0, 1.0d0/) real*8 IS(3), alpha(3), eps real*8 w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) @@ -867,7 +867,7 @@ subroutine weno_weights_neg(nvars, characteristic_fluxes, combined_frozen_metric integer p, i, j real*8 sum_alpha(1) - eps = 1e-6*combined_frozen_metrics + eps = 1.0d-6*combined_frozen_metrics p = 2 do i=1,nvars @@ -878,9 +878,9 @@ subroutine weno_weights_neg(nvars, characteristic_fluxes, combined_frozen_metric call weighted_sum(3, weights3, characteristic_fluxes(i,1:-1:-1), w3sum) call weighted_sum(3, weightsc, characteristic_fluxes(i,1:-1:-1), c3sum) - IS(1) = (1.0/4)*w1sum(1)**2 + (13.0/12)*c1sum(1)**2 - IS(2) = (1.0/4)*w2sum(1)**2 + (13.0/12)*c2sum(1)**2 - IS(3) = (1.0/4)*w3sum(1)**2 + (13.0/12)*c3sum(1)**2 + IS(1) = (1.0d0/4)*w1sum(1)**2 + (13.0d0/12)*c1sum(1)**2 + IS(2) = (1.0d0/4)*w2sum(1)**2 + (13.0d0/12)*c2sum(1)**2 + IS(3) = (1.0d0/4)*w3sum(1)**2 + (13.0d0/12)*c3sum(1)**2 do j=1,3 alpha(j) = C(j)/(IS(j) + eps)**p @@ -922,7 +922,7 @@ subroutine mult_mat_vec(m, n, alpha, a, b, c) real*8 accumulator do i=1,m - accumulator = 0.0 + accumulator = 0.0d0 do j=1,n accumulator = accumulator + alpha*a(i,j)*b(j) end do @@ -939,7 +939,7 @@ subroutine sum_array(n, a, a_sum) integer i - a_sum(1) = 0.0 + a_sum(1) = 0.0d0 do i=1,n a_sum(1) = a_sum(1) + a(i) end do @@ -954,7 +954,7 @@ subroutine weighted_sum(n, w, a, a_sum) integer i - a_sum(1) = 0.0 + a_sum(1) = 0.0d0 do i=1,n a_sum(1) = a_sum(1) + w(i)*a(i) end do -- GitLab From f0eebaf9ef4c073e417d5165628707c54968825c Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 3 Aug 2019 00:21:02 -0500 Subject: [PATCH 45/60] reduce tolerances --- utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities.py b/utilities.py index c8bde8a..e542fb0 100644 --- a/utilities.py +++ b/utilities.py @@ -11,7 +11,7 @@ from pytest import approx # {{{ arrays def compare_arrays(a, b): - assert a == approx(b, rel=1e-5, abs=2e-5) + assert a == approx(b, rel=1e-12, abs=1e-14) def random_array_on_device(queue, *shape): -- GitLab From ea5b71b7972d0b907787227b2c4a91d64f9507eb Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 3 Aug 2019 00:23:38 -0500 Subject: [PATCH 46/60] skip all tests except lax_wavespeeds --- test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test.py b/test.py index 427f3e7..a2a9fd0 100644 --- a/test.py +++ b/test.py @@ -18,6 +18,7 @@ import utilities as u from data_for_test import flux_test_data_fixture # noqa: F401 +@pytest.mark.slow def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -37,6 +38,7 @@ def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(flux_dev.get(), data.weno_flux) +@pytest.mark.slow def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -52,6 +54,7 @@ def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(consistent_dev.get(), data.consistent) +@pytest.mark.slow def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -69,6 +72,7 @@ def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) +@pytest.mark.slow def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -86,6 +90,7 @@ def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_neg) +@pytest.mark.slow def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -102,6 +107,7 @@ def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_pos) +@pytest.mark.slow def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -118,6 +124,7 @@ def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_neg) +@pytest.mark.slow def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -139,6 +146,7 @@ def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(fluxes_neg_dev.get(), data.char_fluxes_neg) +@pytest.mark.slow def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -153,6 +161,7 @@ def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): u.compare_arrays(lam_dev.get(), data.lam_pointwise) +@pytest.mark.slow def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -217,6 +226,7 @@ def test_lax_wavespeeds( u.compare_arrays(lam_dev.get(), lam_expected) +@pytest.mark.slow def test_matvec(ctx_factory): prg = u.get_weno_program_with_root_kernel("mult_mat_vec") queue = u.get_queue(ctx_factory) -- GitLab From 2fe9ef9d3559564e4444f259d64ca574efba875b Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Sat, 3 Aug 2019 00:35:52 -0500 Subject: [PATCH 47/60] add hack that passes test -- double precision constants seem to not work as expected --- WENO.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WENO.F90 b/WENO.F90 index 1f66c0b..f0009ab 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -449,7 +449,9 @@ subroutine lax_wavespeeds(nvars, lambda_pointwise, lambda_roe, wavespeeds) integer v integer k - kappa = 1.1d0 + !kappa = 1.1d0 + kappa = 11 + kappa = kappa/10 do v=1,nvars wavespeeds(v) = abs(lambda_roe(v)) -- GitLab From cd27a932662851718a9f1696ca8356c3f6d58150 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 19 Aug 2019 09:31:18 -0500 Subject: [PATCH 48/60] Revert "add hack that passes test -- double precision constants seem to not work as expected" This reverts commit 2fe9ef9d3559564e4444f259d64ca574efba875b. --- WENO.F90 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index f0009ab..1f66c0b 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -449,9 +449,7 @@ subroutine lax_wavespeeds(nvars, lambda_pointwise, lambda_roe, wavespeeds) integer v integer k - !kappa = 1.1d0 - kappa = 11 - kappa = kappa/10 + kappa = 1.1d0 do v=1,nvars wavespeeds(v) = abs(lambda_roe(v)) -- GitLab From adf2f2d8d99030c8a8e7c1e427e8690c769f9b74 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 19 Aug 2019 09:32:43 -0500 Subject: [PATCH 49/60] Revert "skip all tests except lax_wavespeeds" This reverts commit ea5b71b7972d0b907787227b2c4a91d64f9507eb. --- test.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test.py b/test.py index a2a9fd0..427f3e7 100644 --- a/test.py +++ b/test.py @@ -18,7 +18,6 @@ import utilities as u from data_for_test import flux_test_data_fixture # noqa: F401 -@pytest.mark.slow def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -38,7 +37,6 @@ def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(flux_dev.get(), data.weno_flux) -@pytest.mark.slow def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -54,7 +52,6 @@ def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(consistent_dev.get(), data.consistent) -@pytest.mark.slow def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -72,7 +69,6 @@ def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) -@pytest.mark.slow def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -90,7 +86,6 @@ def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_neg) -@pytest.mark.slow def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -107,7 +102,6 @@ def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_pos) -@pytest.mark.slow def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -124,7 +118,6 @@ def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_neg) -@pytest.mark.slow def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -146,7 +139,6 @@ def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(fluxes_neg_dev.get(), data.char_fluxes_neg) -@pytest.mark.slow def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -161,7 +153,6 @@ def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): u.compare_arrays(lam_dev.get(), data.lam_pointwise) -@pytest.mark.slow def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -226,7 +217,6 @@ def test_lax_wavespeeds( u.compare_arrays(lam_dev.get(), lam_expected) -@pytest.mark.slow def test_matvec(ctx_factory): prg = u.get_weno_program_with_root_kernel("mult_mat_vec") queue = u.get_queue(ctx_factory) -- GitLab From aa1230ee4dfeb153a0eac93132825a1e2b81018d Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 19 Aug 2019 09:34:15 -0500 Subject: [PATCH 50/60] only using one test case for now --- data_for_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data_for_test.py b/data_for_test.py index c83dd53..085d6b2 100644 --- a/data_for_test.py +++ b/data_for_test.py @@ -701,10 +701,10 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - "Case a:x", "Case a:y", "Case a:z", - "Case b:x", "Case b:y", "Case b:z", - "Case c:x", "Case c:y", "Case c:z", - "Case d:x", "Case d:y", "Case d:z"]) + "Case a:x"])#, "Case a:y", "Case a:z", + #"Case b:x", "Case b:y", "Case b:z", + #"Case c:x", "Case c:y", "Case c:z", + #"Case d:x", "Case d:y", "Case d:z"]) def flux_test_data_fixture(request): return single_data[request.param] -- GitLab From 6ce3c72679f52e77f007cefac0df24dbfcc3db40 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 19 Aug 2019 10:55:18 -0500 Subject: [PATCH 51/60] added test case with constant initial data --- data_for_test.py | 110 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/data_for_test.py b/data_for_test.py index 085d6b2..c1bf206 100644 --- a/data_for_test.py +++ b/data_for_test.py @@ -76,6 +76,113 @@ class FluxDataSingle: single_data = {} +# {{{ Input data: "flat" case + +single_data["Case flat:x"] = FluxDataSingle( + states_str="1 1 1 1 5.5,1 1 1 1 5.5", + fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", + lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.3340765523905305 0.3340765523905305," + "1 0 0 0.8340765523905306 -0.1659234476094695," + "1 1 0 0.3340765523905305 0.3340765523905305," + "1 0 1 0.3340765523905305 0.3340765523905305," + "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), + R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " + "0.1785714285714286 -0.1785714285714286," + "-1. 0 1. 0 0," + "-1. 0 0 1. 0," + "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244," + "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244"), + wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", + char_fluxes_pos_str=( + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), + char_fluxes_neg_str=( + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), + weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + consistent_str="1 2.6 1 1 7.1", + dissipation_pos_str=("0 0 0 0 0"), + dissipation_neg_str=("0 0 0 0 0"), + weno_flux_str=("1 2.6 1 1 7.1"), + direction="x") +single_data["Case flat:y"] = FluxDataSingle( + states_str="1 1 1 1 5.5,1 1 1 1 5.5", + fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", + lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.3340765523905305 0.3340765523905305," + "1 0 0 0.8340765523905306 -0.1659234476094695," + "1 1 0 0.3340765523905305 0.3340765523905305," + "1 0 1 0.3340765523905305 0.3340765523905305," + "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), + R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " + "0.1785714285714286 -0.1785714285714286," + "-1. 0 1. 0 0," + "-1. 0 0 1. 0," + "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244," + "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244"), + wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", + char_fluxes_pos_str=( + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), + char_fluxes_neg_str=( + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), + weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + consistent_str="1 2.6 1 1 7.1", + dissipation_pos_str=("0 0 0 0 0"), + dissipation_neg_str=("0 0 0 0 0"), + weno_flux_str=("1 2.6 1 1 7.1"), + direction="y") +single_data["Case flat:z"] = FluxDataSingle( + states_str="1 1 1 1 5.5,1 1 1 1 5.5", + fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", + lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.3340765523905305 0.3340765523905305," + "1 0 0 0.8340765523905306 -0.1659234476094695," + "1 1 0 0.3340765523905305 0.3340765523905305," + "1 0 1 0.3340765523905305 0.3340765523905305," + "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), + R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " + "0.1785714285714286 -0.1785714285714286," + "-1. 0 1. 0 0," + "-1. 0 0 1. 0," + "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244," + "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244"), + wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", + char_fluxes_pos_str=( + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), + char_fluxes_neg_str=( + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), + weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + consistent_str="1 2.6 1 1 7.1", + dissipation_pos_str=("0 0 0 0 0"), + dissipation_neg_str=("0 0 0 0 0"), + weno_flux_str=("1 2.6 1 1 7.1"), + direction="z") + +# }}} + # {{{ Input data: Case (a) single_data["Case a:x"] = FluxDataSingle( @@ -701,7 +808,8 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - "Case a:x"])#, "Case a:y", "Case a:z", + "Case flat:x", "Case flat:y", "Case flat:z"]) + #"Case a:x", "Case a:y", "Case a:z", #"Case b:x", "Case b:y", "Case b:z", #"Case c:x", "Case c:y", "Case c:z", #"Case d:x", "Case d:y", "Case d:z"]) -- GitLab From b2eba0d09dd8fdb5829a8a263c3eadc419ca7141 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Mon, 19 Aug 2019 14:20:55 -0500 Subject: [PATCH 52/60] for now, make some things explicit in WENO weight computation --- WENO.F90 | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index 1f66c0b..bf784bb 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -757,33 +757,35 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric p = 2 do i=1,nvars - !w1sum(1) = characteristic_fluxes(i,-2) - 4*characteristic_fluxes(i,-1) & - ! + 3*characteristic_fluxes(i,0) - w2sum(1) = -characteristic_fluxes(i,-1) - characteristic_fluxes(i,1) !!! BUG !!! - !w3sum(1) = -3*characteristic_fluxes(i,0) + 4*characteristic_fluxes(i,1) & - ! - characteristic_fluxes(i,2) - !c1sum(1) = characteristic_fluxes(i,-2) & - ! - 2*characteristic_fluxes(i,-1) + characteristic_fluxes(i,0) - !c2sum(1) = characteristic_fluxes(i,-1) & - ! - 2*characteristic_fluxes(i,0) + characteristic_fluxes(i,1) + w1sum(1) = characteristic_fluxes(i,-2) - 4*characteristic_fluxes(i,-1) & + + 3*characteristic_fluxes(i,0) + w2sum(1) = -characteristic_fluxes(i,-1) + characteristic_fluxes(i,1) + w3sum(1) = -3*characteristic_fluxes(i,0) + 4*characteristic_fluxes(i,1) & + - characteristic_fluxes(i,2) + c1sum(1) = characteristic_fluxes(i,-2) & + - 2*characteristic_fluxes(i,-1) + characteristic_fluxes(i,0) + c2sum(1) = characteristic_fluxes(i,-1) & + - 2*characteristic_fluxes(i,0) + characteristic_fluxes(i,1) c3sum(1) = characteristic_fluxes(i,0) & - 2*characteristic_fluxes(i,1) + characteristic_fluxes(i,2) - call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) - call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) + !call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) + !call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) !call weighted_sum(3, weights2, characteristic_fluxes(i,-1:1), w2sum) - call weighted_sum(3, weightsc, characteristic_fluxes(i,-1:1), c2sum) - call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) + !call weighted_sum(3, weightsc, characteristic_fluxes(i,-1:1), c2sum) + !call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) !call weighted_sum(3, weightsc, characteristic_fluxes(i,0:2), c3sum) IS(1) = (1.0d0/4)*w1sum(1)**2 + (13.0d0/12)*c1sum(1)**2 IS(2) = (1.0d0/4)*w2sum(1)**2 + (13.0d0/12)*c2sum(1)**2 IS(3) = (1.0d0/4)*w3sum(1)**2 + (13.0d0/12)*c3sum(1)**2 + sum_alpha(1) = 0.0d0 do j=1,3 alpha(j) = C(j)/(IS(j) + eps)**p + sum_alpha(1) = sum_alpha(1) + alpha(j) end do - call sum_array(3, alpha, sum_alpha) + !call sum_array(3, alpha, sum_alpha) do j=1,3 w(i,j) = alpha(j)/sum_alpha(1) end do -- GitLab From e9373fdc914b57fe8bba53a7c37cf20095f37845 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Thu, 22 Aug 2019 19:45:44 -0500 Subject: [PATCH 53/60] Add new subroutine for oscillation indicator with initial test --- WENO.F90 | 101 ++-- data_for_test.py | 1180 ++++++++++++++++++++++++---------------------- test.py | 47 ++ utilities.py | 1 - 4 files changed, 718 insertions(+), 611 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index bf784bb..6f1a237 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -741,20 +741,42 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric real*8, intent(out) :: w(nvars, 3) real*8 :: C(3) = (/0.1d0, 0.6d0, 0.3d0/) + real*8 IS(nvars, 3), alpha(3), eps + + integer p, i, j + real*8 sum_alpha(1) + + eps = 1.0d-6!*combined_frozen_metrics + p = 2 + + call oscillation_pos(nvars, characteristic_fluxes, IS) + + do i=1,nvars + sum_alpha(1) = 0.0d0 + do j=1,3 + alpha(j) = C(j)/(IS(i, j) + eps)**p + sum_alpha(1) = sum_alpha(1) + alpha(j) + end do + !call sum_array(3, alpha, sum_alpha) + do j=1,3 + w(i,j) = alpha(j)/sum_alpha(1) + end do + end do +end subroutine + +subroutine oscillation_pos(nvars, characteristic_fluxes, oscillation) + integer, intent(in) :: nvars + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(out) :: oscillation(nvars, 3) + real*8 :: weights1(0:2) = (/1.0d0, -4.0d0, 3.0d0/) real*8 :: weights2(0:2) = (/-1.0d0, 0.0d0, 1.0d0/) real*8 :: weights3(0:2) = (/-3.0d0, 4.0d0, -1.0d0/) real*8 :: weightsc(0:2) = (/1.0d0, -2.0d0, 1.0d0/) - real*8 IS(3), alpha(3), eps - real*8 w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) - integer p, i, j - real*8 sum_alpha(1) - - eps = 1.0d-6*combined_frozen_metrics - p = 2 + integer i do i=1,nvars w1sum(1) = characteristic_fluxes(i,-2) - 4*characteristic_fluxes(i,-1) & @@ -776,19 +798,9 @@ subroutine weno_weights_pos(nvars, characteristic_fluxes, combined_frozen_metric !call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) !call weighted_sum(3, weightsc, characteristic_fluxes(i,0:2), c3sum) - IS(1) = (1.0d0/4)*w1sum(1)**2 + (13.0d0/12)*c1sum(1)**2 - IS(2) = (1.0d0/4)*w2sum(1)**2 + (13.0d0/12)*c2sum(1)**2 - IS(3) = (1.0d0/4)*w3sum(1)**2 + (13.0d0/12)*c3sum(1)**2 - - sum_alpha(1) = 0.0d0 - do j=1,3 - alpha(j) = C(j)/(IS(j) + eps)**p - sum_alpha(1) = sum_alpha(1) + alpha(j) - end do - !call sum_array(3, alpha, sum_alpha) - do j=1,3 - w(i,j) = alpha(j)/sum_alpha(1) - end do + oscillation(i, 1) = (1.0d0/4)*w1sum(1)**2 + (13.0d0/12)*c1sum(1)**2 + oscillation(i, 2) = (1.0d0/4)*w2sum(1)**2 + (13.0d0/12)*c2sum(1)**2 + oscillation(i, 3) = (1.0d0/4)*w3sum(1)**2 + (13.0d0/12)*c3sum(1)**2 end do end subroutine @@ -858,19 +870,42 @@ subroutine weno_weights_neg(nvars, characteristic_fluxes, combined_frozen_metric real*8, intent(out) :: w(nvars, 3) real*8 :: C(3) = (/0.1d0, 0.6d0, 0.3d0/) + real*8 IS(nvars, 3), alpha(3), eps + + integer p, i, j + real*8 sum_alpha(1) + + eps = 1.0d-6!*combined_frozen_metrics + p = 2 + + call oscillation_neg(nvars, characteristic_fluxes, IS) + + do i=1,nvars + do j=1,3 + alpha(j) = C(j)/(IS(i, j) + eps)**p + end do + call sum_array(3, alpha, sum_alpha) + do j=1,3 + w(i,j) = alpha(j)/sum_alpha(1) + end do + end do +end subroutine + +subroutine oscillation_neg(nvars, characteristic_fluxes, oscillation) + implicit none + + integer, intent(in) :: nvars + real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) + real*8, intent(out) :: oscillation(nvars, 3) + real*8 :: weights1(0:2) = (/ 1.0d0, -4.0d0, 3.0d0/) real*8 :: weights2(0:2) = (/-1.0d0, 0.0d0, 1.0d0/) real*8 :: weights3(0:2) = (/-3.0d0, 4.0d0, -1.0d0/) real*8 :: weightsc(0:2) = (/ 1.0d0, -2.0d0, 1.0d0/) - real*8 IS(3), alpha(3), eps real*8 w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) - integer p, i, j - real*8 sum_alpha(1) - - eps = 1.0d-6*combined_frozen_metrics - p = 2 + integer i do i=1,nvars call weighted_sum(3, weights1, characteristic_fluxes(i,3:1:-1), w1sum) @@ -880,17 +915,9 @@ subroutine weno_weights_neg(nvars, characteristic_fluxes, combined_frozen_metric call weighted_sum(3, weights3, characteristic_fluxes(i,1:-1:-1), w3sum) call weighted_sum(3, weightsc, characteristic_fluxes(i,1:-1:-1), c3sum) - IS(1) = (1.0d0/4)*w1sum(1)**2 + (13.0d0/12)*c1sum(1)**2 - IS(2) = (1.0d0/4)*w2sum(1)**2 + (13.0d0/12)*c2sum(1)**2 - IS(3) = (1.0d0/4)*w3sum(1)**2 + (13.0d0/12)*c3sum(1)**2 - - do j=1,3 - alpha(j) = C(j)/(IS(j) + eps)**p - end do - call sum_array(3, alpha, sum_alpha) - do j=1,3 - w(i,j) = alpha(j)/sum_alpha(1) - end do + oscillation(i, 1) = (1.0d0/4)*w1sum(1)**2 + (13.0d0/12)*c1sum(1)**2 + oscillation(i, 2) = (1.0d0/4)*w2sum(1)**2 + (13.0d0/12)*c2sum(1)**2 + oscillation(i, 3) = (1.0d0/4)*w3sum(1)**2 + (13.0d0/12)*c3sum(1)**2 end do end subroutine diff --git a/data_for_test.py b/data_for_test.py index c1bf206..a268e4c 100644 --- a/data_for_test.py +++ b/data_for_test.py @@ -12,6 +12,7 @@ class FluxDataSingle: def __init__(self, states_str, fluxes_str, lam_str, R_str, R_inv_str, wavespeeds_str, char_fluxes_pos_str, char_fluxes_neg_str, + oscillation_pos_str, oscillation_neg_str, weno_weights_pos_str, weno_weights_neg_str, consistent_str, dissipation_pos_str, dissipation_neg_str, weno_flux_str, direction): @@ -40,6 +41,9 @@ class FluxDataSingle: self.char_fluxes_neg = u.expand_to_6( u.transposed_array_from_string(char_fluxes_neg_str)) + self.oscillation_pos = u.transposed_array_from_string(oscillation_pos_str) + self.oscillation_neg = u.transposed_array_from_string(oscillation_neg_str) + self.weno_weights_pos = u.transposed_array_from_string(weno_weights_pos_str) self.weno_weights_neg = u.transposed_array_from_string(weno_weights_neg_str) @@ -78,108 +82,108 @@ single_data = {} # {{{ Input data: "flat" case -single_data["Case flat:x"] = FluxDataSingle( - states_str="1 1 1 1 5.5,1 1 1 1 5.5", - fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", - lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," - "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str=("1 0 0 0.3340765523905305 0.3340765523905305," - "1 0 0 0.8340765523905306 -0.1659234476094695," - "1 1 0 0.3340765523905305 0.3340765523905305," - "1 0 1 0.3340765523905305 0.3340765523905305," - "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), - R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " - "0.1785714285714286 -0.1785714285714286," - "-1. 0 1. 0 0," - "-1. 0 0 1. 0," - "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " - "-0.2672612419124244 0.2672612419124244," - "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " - "-0.2672612419124244 0.2672612419124244"), - wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", - char_fluxes_pos_str=( - "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," - "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), - char_fluxes_neg_str=( - "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," - "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), - weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," - "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), - weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," - "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), - consistent_str="1 2.6 1 1 7.1", - dissipation_pos_str=("0 0 0 0 0"), - dissipation_neg_str=("0 0 0 0 0"), - weno_flux_str=("1 2.6 1 1 7.1"), - direction="x") -single_data["Case flat:y"] = FluxDataSingle( - states_str="1 1 1 1 5.5,1 1 1 1 5.5", - fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", - lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," - "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str=("1 0 0 0.3340765523905305 0.3340765523905305," - "1 0 0 0.8340765523905306 -0.1659234476094695," - "1 1 0 0.3340765523905305 0.3340765523905305," - "1 0 1 0.3340765523905305 0.3340765523905305," - "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), - R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " - "0.1785714285714286 -0.1785714285714286," - "-1. 0 1. 0 0," - "-1. 0 0 1. 0," - "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " - "-0.2672612419124244 0.2672612419124244," - "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " - "-0.2672612419124244 0.2672612419124244"), - wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", - char_fluxes_pos_str=( - "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," - "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), - char_fluxes_neg_str=( - "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," - "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), - weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," - "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), - weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," - "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), - consistent_str="1 2.6 1 1 7.1", - dissipation_pos_str=("0 0 0 0 0"), - dissipation_neg_str=("0 0 0 0 0"), - weno_flux_str=("1 2.6 1 1 7.1"), - direction="y") -single_data["Case flat:z"] = FluxDataSingle( - states_str="1 1 1 1 5.5,1 1 1 1 5.5", - fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", - lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," - "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str=("1 0 0 0.3340765523905305 0.3340765523905305," - "1 0 0 0.8340765523905306 -0.1659234476094695," - "1 1 0 0.3340765523905305 0.3340765523905305," - "1 0 1 0.3340765523905305 0.3340765523905305," - "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), - R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " - "0.1785714285714286 -0.1785714285714286," - "-1. 0 1. 0 0," - "-1. 0 0 1. 0," - "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " - "-0.2672612419124244 0.2672612419124244," - "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " - "-0.2672612419124244 0.2672612419124244"), - wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", - char_fluxes_pos_str=( - "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," - "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), - char_fluxes_neg_str=( - "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," - "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), - weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," - "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), - weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," - "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), - consistent_str="1 2.6 1 1 7.1", - dissipation_pos_str=("0 0 0 0 0"), - dissipation_neg_str=("0 0 0 0 0"), - weno_flux_str=("1 2.6 1 1 7.1"), - direction="z") +#single_data["Case flat:x"] = FluxDataSingle( +# states_str="1 1 1 1 5.5,1 1 1 1 5.5", +# fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", +# lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," +# "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), +# R_str=("1 0 0 0.3340765523905305 0.3340765523905305," +# "1 0 0 0.8340765523905306 -0.1659234476094695," +# "1 1 0 0.3340765523905305 0.3340765523905305," +# "1 0 1 0.3340765523905305 0.3340765523905305," +# "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), +# R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " +# "0.1785714285714286 -0.1785714285714286," +# "-1. 0 1. 0 0," +# "-1. 0 0 1. 0," +# "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " +# "-0.2672612419124244 0.2672612419124244," +# "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " +# "-0.2672612419124244 0.2672612419124244"), +# wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", +# char_fluxes_pos_str=( +# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," +# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), +# char_fluxes_neg_str=( +# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," +# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), +# weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," +# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), +# weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," +# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), +# consistent_str="1 2.6 1 1 7.1", +# dissipation_pos_str=("0 0 0 0 0"), +# dissipation_neg_str=("0 0 0 0 0"), +# weno_flux_str=("1 2.6 1 1 7.1"), +# direction="x") +#single_data["Case flat:y"] = FluxDataSingle( +# states_str="1 1 1 1 5.5,1 1 1 1 5.5", +# fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", +# lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," +# "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), +# R_str=("1 0 0 0.3340765523905305 0.3340765523905305," +# "1 0 0 0.8340765523905306 -0.1659234476094695," +# "1 1 0 0.3340765523905305 0.3340765523905305," +# "1 0 1 0.3340765523905305 0.3340765523905305," +# "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), +# R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " +# "0.1785714285714286 -0.1785714285714286," +# "-1. 0 1. 0 0," +# "-1. 0 0 1. 0," +# "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " +# "-0.2672612419124244 0.2672612419124244," +# "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " +# "-0.2672612419124244 0.2672612419124244"), +# wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", +# char_fluxes_pos_str=( +# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," +# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), +# char_fluxes_neg_str=( +# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," +# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), +# weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," +# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), +# weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," +# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), +# consistent_str="1 2.6 1 1 7.1", +# dissipation_pos_str=("0 0 0 0 0"), +# dissipation_neg_str=("0 0 0 0 0"), +# weno_flux_str=("1 2.6 1 1 7.1"), +# direction="y") +#single_data["Case flat:z"] = FluxDataSingle( +# states_str="1 1 1 1 5.5,1 1 1 1 5.5", +# fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", +# lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," +# "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), +# R_str=("1 0 0 0.3340765523905305 0.3340765523905305," +# "1 0 0 0.8340765523905306 -0.1659234476094695," +# "1 1 0 0.3340765523905305 0.3340765523905305," +# "1 0 1 0.3340765523905305 0.3340765523905305," +# "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), +# R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " +# "0.1785714285714286 -0.1785714285714286," +# "-1. 0 1. 0 0," +# "-1. 0 0 1. 0," +# "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " +# "-0.2672612419124244 0.2672612419124244," +# "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " +# "-0.2672612419124244 0.2672612419124244"), +# wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", +# char_fluxes_pos_str=( +# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," +# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), +# char_fluxes_neg_str=( +# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," +# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), +# weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," +# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), +# weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," +# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), +# consistent_str="1 2.6 1 1 7.1", +# dissipation_pos_str=("0 0 0 0 0"), +# dissipation_neg_str=("0 0 0 0 0"), +# weno_flux_str=("1 2.6 1 1 7.1"), +# direction="z") # }}} @@ -215,6 +219,16 @@ single_data["Case a:x"] = FluxDataSingle( "-0.05857864376269045 -0.7274934638648571 -0.30602629876675014," "-0.06722315769446469 0.24852813742385726 " "0.24852813742385726 -0.10725061063772967 -0.37456222716537935"), + oscillation_pos_str=("0. 0. 0. 0. 0.," + "0.5180684032155981 4.777392983773268 4.777392983773268 " + "48.69888276854567 0.00844206573002786," + "1.2951710080389953 11.94348245943317 11.94348245943317 " + "121.7472069213642 0.02110516432506965"), + oscillation_neg_str=("0. 0. 0. 0. 0.," + "0.01363683818419176 0.12575276673434946 0.12575276673434946 " + "0.5129349293057707 0.006262897975282706," + "0.0340920954604794 0.31438191683587363 0.31438191683587363 " + "1.2823373232644266 0.015657244938206753"), weno_weights_pos_str=("0.999999997585736 0.9999999999716082 " "0.9999999999716082 0.9999999999997268 0.9999909282503908," "2.2354258683870077e-9 2.6288602366075745e-11 " @@ -265,6 +279,16 @@ single_data["Case a:y"] = FluxDataSingle( "-0.05857864376269045 -0.7274934638648571 -0.30602629876675014," "-0.06722315769446469 0.24852813742385726 " "0.24852813742385726 -0.10725061063772967 -0.37456222716537935"), + oscillation_pos_str=("0. 0. 0. 0. 0.," + "0.5180684032155981 4.777392983773268 4.777392983773268 " + "48.69888276854567 0.00844206573002786," + "1.2951710080389953 11.94348245943317 11.94348245943317 " + "121.7472069213642 0.02110516432506965"), + oscillation_neg_str=("0. 0. 0. 0. 0.," + "0.01363683818419176 0.12575276673434946 0.12575276673434946 " + "0.5129349293057707 0.006262897975282706," + "0.0340920954604794 0.31438191683587363 0.31438191683587363 " + "1.2823373232644266 0.015657244938206753"), weno_weights_pos_str=("0.999999997585736 0.9999999999716082 " "0.9999999999716082 0.9999999999997268 0.9999909282503908," "2.2354258683870077e-9 2.6288602366075745e-11 " @@ -315,6 +339,16 @@ single_data["Case a:z"] = FluxDataSingle( "-0.05857864376269045 -0.7274934638648571 -0.30602629876675014," "-0.06722315769446469 0.24852813742385726 " "0.24852813742385726 -0.10725061063772967 -0.37456222716537935"), + oscillation_pos_str=("0. 0. 0. 0. 0.," + "0.5180684032155981 4.777392983773268 4.777392983773268 " + "48.69888276854567 0.00844206573002786," + "1.2951710080389953 11.94348245943317 11.94348245943317 " + "121.7472069213642 0.02110516432506965"), + oscillation_neg_str=("0. 0. 0. 0. 0.," + "0.01363683818419176 0.12575276673434946 0.12575276673434946 " + "0.5129349293057707 0.006262897975282706," + "0.0340920954604794 0.31438191683587363 0.31438191683587363 " + "1.2823373232644266 0.015657244938206753"), weno_weights_pos_str=("0.999999997585736 0.9999999999716082 " "0.9999999999716082 0.9999999999997268 0.9999909282503908," "2.2354258683870077e-9 2.6288602366075745e-11 " @@ -337,479 +371,479 @@ single_data["Case a:z"] = FluxDataSingle( direction="z") # }}} - -# {{{ Input data: Case (b) - -single_data["Case b:x"] = FluxDataSingle( - states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", - fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", - lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," - "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str=("1 0 0 0.45781245952886396 0.45781245952886396," - "-1.5857864376269053 0 0 -0.018886008110941373 " - "-1.4330995704840366," - "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " - "-0.7259927892974889," - "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " - "-0.7259927892974889," - "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " - "3.335959603054103 5.578600290173388"), - R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " - "-0.265894835574803 -0.16767379847989416," - "1.1213203435596428 0 0.7071067811865475 0 0," - "1.1213203435596428 0 0 0.7071067811865475 0," - "1.8120820550093746 0.9975038969055432 0.2903971157189956 " - "0.2903971157189956 0.1831249838115456," - "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " - "0.2903971157189956 0.1831249838115456"), - wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", - char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " - "0.24852813742385726 0.37456222716537935 0.10725061063772967," - "0.16835489671908455 -0.05857864376269045 " - "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), - char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " - "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," - "-1.0907156303492833 1.2301515190164993 " - "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), - weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " - "0.999999959029252 0.9999835300215946 0.9999999975371708," - "3.2217041402391125e-6 3.793560951911702e-8 " - "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," - "2.579631146567429e-7 3.0351383606886035e-9 " - "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), - weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " - "0.9999999999716082 0.9999909282503908 0.9999999999997268," - "2.2354258683870077e-9 2.6288602366075745e-11 " - "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," - "1.788382117901561e-10 2.1030934718853924e-12 " - "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), - consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", - dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " - "0.49761166908056337 0.49761166908056337 -2.495196349669178"), - dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " - "3.9976117689805504 3.9976117689805504 -22.145196359962693"), - weno_flux_str=("-4.353710219799678 12.247948547685105 " - "8.995223438061114 8.995223438061114 -51.390392709631875"), - direction="x") -single_data["Case b:y"] = FluxDataSingle( - states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", - fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", - lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," - "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str=("1 0 0 0.45781245952886396 0.45781245952886396," - "-1.5857864376269053 0 0 -0.018886008110941373 " - "-1.4330995704840366," - "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " - "-0.7259927892974889," - "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " - "-0.7259927892974889," - "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " - "3.335959603054103 5.578600290173388"), - R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " - "-0.265894835574803 -0.16767379847989416," - "1.1213203435596428 0 0.7071067811865475 0 0," - "1.1213203435596428 0 0 0.7071067811865475 0," - "1.8120820550093746 0.9975038969055432 0.2903971157189956 " - "0.2903971157189956 0.1831249838115456," - "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " - "0.2903971157189956 0.1831249838115456"), - wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", - char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " - "0.24852813742385726 0.37456222716537935 0.10725061063772967," - "0.16835489671908455 -0.05857864376269045 " - "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), - char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " - "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," - "-1.0907156303492833 1.2301515190164993 " - "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), - weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " - "0.999999959029252 0.9999835300215946 0.9999999975371708," - "3.2217041402391125e-6 3.793560951911702e-8 " - "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," - "2.579631146567429e-7 3.0351383606886035e-9 " - "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), - weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " - "0.9999999999716082 0.9999909282503908 0.9999999999997268," - "2.2354258683870077e-9 2.6288602366075745e-11 " - "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," - "1.788382117901561e-10 2.1030934718853924e-12 " - "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), - consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", - dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " - "0.49761166908056337 0.49761166908056337 -2.495196349669178"), - dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " - "3.9976117689805504 3.9976117689805504 -22.145196359962693"), - weno_flux_str=("-4.353710219799678 12.247948547685105 " - "8.995223438061114 8.995223438061114 -51.390392709631875"), - direction="y") -single_data["Case b:z"] = FluxDataSingle( - states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", - fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", - lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," - "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str=("1 0 0 0.45781245952886396 0.45781245952886396," - "-1.5857864376269053 0 0 -0.018886008110941373 " - "-1.4330995704840366," - "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " - "-0.7259927892974889," - "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " - "-0.7259927892974889," - "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " - "3.335959603054103 5.578600290173388"), - R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " - "-0.265894835574803 -0.16767379847989416," - "1.1213203435596428 0 0.7071067811865475 0 0," - "1.1213203435596428 0 0 0.7071067811865475 0," - "1.8120820550093746 0.9975038969055432 0.2903971157189956 " - "0.2903971157189956 0.1831249838115456," - "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " - "0.2903971157189956 0.1831249838115456"), - wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", - char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " - "0.24852813742385726 0.37456222716537935 0.10725061063772967," - "0.16835489671908455 -0.05857864376269045 " - "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), - char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " - "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," - "-1.0907156303492833 1.2301515190164993 " - "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), - weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " - "0.999999959029252 0.9999835300215946 0.9999999975371708," - "3.2217041402391125e-6 3.793560951911702e-8 " - "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," - "2.579631146567429e-7 3.0351383606886035e-9 " - "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), - weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " - "0.9999999999716082 0.9999909282503908 0.9999999999997268," - "2.2354258683870077e-9 2.6288602366075745e-11 " - "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," - "1.788382117901561e-10 2.1030934718853924e-12 " - "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), - consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", - dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " - "0.49761166908056337 0.49761166908056337 -2.495196349669178"), - dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " - "3.9976117689805504 3.9976117689805504 -22.145196359962693"), - weno_flux_str=("-4.353710219799678 12.247948547685105 " - "8.995223438061114 8.995223438061114 -51.390392709631875"), - direction="z") - -# }}} - -# {{{ Input data: Case (c) - -single_data["Case c:x"] = FluxDataSingle( - states_str="2 4 8 12 64,1 1 2 3 11", - fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", - lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," - "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686," - "1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326," - "3.1715728752538106 1.4142135623730951 0 1.3125424167614286 " - "1.3125424167614286," - "4.757359312880716 0 1.4142135623730951 1.968813625142143 " - "1.968813625142143," - "17.60303038033002 4.485281374238571 6.727922061357858 " - "11.42671019719969 9.184069510080404"), - R_inv_str=("-1.4118746341171051 0.21727611674823194 0.4345522334964639 " - "0.6518283502446959 -0.13701474018997217," - "-2.2426406871192857 0 0.7071067811865475 0 0," - "-3.3639610306789285 0 0 0.7071067811865475 0," - "1.7926564050747988 0.4445982978342618 -0.5250169667045714 " - "-0.7875254500568571 0.16553835820737872," - "4.035297092194084 -0.9696152645388333 -0.5250169667045714 " - "-0.7875254500568571 0.16553835820737872"), - wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", - char_fluxes_pos_str=("1.1162114029572359 2.4603030380329987 " - "3.690454557049497 7.986924884679773 0.4290108979594782," - "0.26073527447612554 -1.3254833995939053 " - "-1.9882250993908572 2.052422890589809 0.5017887559695788"), - char_fluxes_neg_str=("-0.1482823715615963 -0.1171572875253809 " - "-0.1757359312880714 -0.8893252542028551 -0.20004041758408686," - "-0.009488213714461069 0.49705627484771453 " - "0.7455844122715716 -0.4306378813126712 -0.31431832174320373"), - weno_weights_pos_str=("0.999999999319454 0.9999999999982254 " - "0.9999999999996494 0.9999999999997061 0.9999870425235151," - "6.301345524776077e-10 1.6430428067143077e-12 " - "3.245518542322869e-13 2.721049684463335e-13 0.000011996153712066484," - "5.041138413805998e-11 1.3144350707803127e-13 " - "2.5964155584975223e-14 2.1768403038595738e-14 9.613227729623656e-7"), - weno_weights_neg_str=("0.9999990185022956 0.9999999974390363 " - "0.9999999994941201 0.9999999917661908 0.9999978651320311," - "9.08762722250494e-7 2.3712585027633853e-9 " - "4.684070887233427e-10 7.62387333908512e-9 1.976628702372801e-6," - "7.27349821618269e-8 1.897052057748541e-10 " - "3.747296441221644e-11 6.099359570650648e-10 1.5823926647977797e-7"), - consistent_str="2.5 6.9 9. 13.5 73.5", - dissipation_pos_str=("1.6406634409601506 4.725635754575325 " - "7.88043892893644 11.820658393408754 68.69422377699841"), - dissipation_neg_str=("0.14066328824586258 0.4256356884430299 " - "0.8804384437989111 1.3206576666570364 7.7942206041633595"), - weno_flux_str=("4.281326729206013 12.051271443018354 " - "17.76087737273535 26.64131606006579 149.98844438116177"), - direction="x") -single_data["Case c:y"] = FluxDataSingle( - states_str="2 8 12 4 64,1 2 3 1 11", - fluxes_str="8 35.2 48 16 268.8,2 5.6 6 2 25.2", - lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," - "2. 2. 2. 3.4966629547095764 0.5033370452904236"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686," - "3.1715728752538106 0 0 2.019649197947976 0.605435635574881," - "4.757359312880716 1.4142135623730951 0 1.968813625142143 " - "1.968813625142143," - "1.5857864376269053 0 1.4142135623730951 0.6562712083807143 " - "0.6562712083807143," - "17.60303038033002 6.727922061357858 2.2426406871192857 " - "12.548030540759331 8.062749166520762"), - R_inv_str=("-1.4118746341171051 0.4345522334964639 0.6518283502446959 " - "0.21727611674823194 -0.13701474018997217," - "-3.3639610306789285 0 0.7071067811865475 0 0," - "-1.1213203435596428 0 0 0.7071067811865475 0," - "0.671336061515156 0.18208981448197611 -0.7875254500568571 " - "-0.2625084833522857 0.16553835820737872," - "5.156617435753728 -1.2321237478911191 -0.7875254500568571 " - "-0.2625084833522857 0.16553835820737872"), - wavespeeds_str="4.4 4.4 4.4 6.046329250180534 2.753670749819466", - char_fluxes_pos_str=("2.2324228059144673 7.380909114098994 " - "2.4603030380329987 15.885347333048884 0.9465242322295992," - "0.5214705489522515 -3.9764501987817145 " - "-1.3254833995939053 1.3413036144786457 3.767119678640133"), - char_fluxes_neg_str=("-0.2965647431231918 -0.3514718625761428 " - "-0.1171572875253809 -1.6097440213843948 -0.5689873221894901," - "-0.018976427428922138 1.4911688245431431 " - "0.49705627484771453 -0.05753157056903602 -1.432380835542713"), - weno_weights_pos_str=("0.9999999999574652 0.999999999999978 " - "0.9999999999982254 0.9999999999999919 0.9999999999942413," - "3.9384014966385437e-11 2.0284497966079935e-14 " - "1.6430428067143077e-12 7.542808138536806e-15 5.332240836330361e-12," - "3.1507308840273685e-12 1.622759950511315e-15 " - "1.3144350707803127e-13 6.034246767570432e-16 4.265797494767529e-13"), - weno_weights_neg_str=("0.9999999386221037 0.9999999999683822 " - "0.9999999974390363 0.9999999999372101 0.9999999993440752," - "5.68308936788955e-8 2.9275831062158654e-11 " - "2.3712585027633853e-9 5.8138848037057226e-11 6.073372407373299e-10," - "4.547002513715645e-9 2.3420726930957915e-12 " - "1.897052057748541e-10 4.6511252168302e-12 4.8587565862160355e-11"), - consistent_str="5. 20.4 27. 9. 147.", - dissipation_pos_str=("3.281326602835503 16.54629350160538 " - "23.641315459112736 7.8804384863675505 137.3884413587739"), - dissipation_neg_str=("0.2813265968286516 1.7462934823903076 " - "2.641315430506613 0.8804384760489334 15.588441251607525"), - weno_flux_str=("8.562653199664155 38.69258698399568 " - "53.28263088961935 17.760876962416482 299.9768826103814"), - direction="y") -single_data["Case c:z"] = FluxDataSingle( - states_str="2 12 4 8 64,1 3 1 2 11", - fluxes_str="12 75.2 24 48 403.2,3 10.6 3 6 37.8", - lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," - "3. 3. 3. 4.496662954709576 1.5033370452904236"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686," - "4.757359312880716 0 0 2.6759204063286903 1.2617068439555954," - "1.5857864376269053 1.4142135623730951 0 0.6562712083807143 " - "0.6562712083807143," - "3.1715728752538106 0 1.4142135623730951 1.3125424167614286 " - "1.3125424167614286," - "17.60303038033002 2.2426406871192857 4.485281374238571 " - "13.669350884318975 6.941428822961119"), - R_inv_str=("-1.4118746341171051 0.6518283502446959 " - "0.21727611674823194 0.4345522334964639 -0.13701474018997217," - "-1.1213203435596428 0 0.7071067811865475 0 0," - "-2.2426406871192857 0 0 0.7071067811865475 0," - "-0.4499842820444868 -0.08041866887030964 -0.2625084833522857 " - "-0.5250169667045714 0.16553835820737872," - "6.27793777931337 -1.4946322312434048 -0.2625084833522857 " - "-0.5250169667045714 0.16553835820737872"), - wavespeeds_str="6.6 6.6 6.6 8.246329250180533 4.953670749819467", - char_fluxes_pos_str=("3.348634208871708 3.690454557049497 " - "7.380909114098994 26.24407281945101 -0.9962654715332988," - "0.7822058234283737 -1.9882250993908581 " - "-3.9764501987817162 -0.6952990612264269 8.357934000904585"), - char_fluxes_neg_str=("-0.44484711468478866 -0.1757359312880714 " - "-0.3514718625761428 -2.447320076091316 -0.8207769392695052," - "-0.02846464114338254 0.7455844122715716 " - "1.4911688245431431 0.8126310150223119 -3.0474996241899346"), - weno_weights_pos_str=("0.999999999991598 0.9999999999996494 " - "0.999999999999978 0.9999999999999993 0.9999999999999524," - "7.779580658268568e-12 3.2455185423228674e-13 " - "2.028449796607992e-14 6.408020704124379e-16 4.408056940300416e-14," - "6.223673030753551e-13 2.596415558497523e-14 " - "1.6227599505113154e-15 5.126416626873783e-17 3.526445914956101e-15"), - weno_weights_neg_str=("0.9999999878747177 0.9999999994941201 " - "0.9999999999683822 0.9999999999967727 0.9999999999851737," - "1.1227070122726888e-8 4.684070887233427e-10 " - "2.9275831062158654e-11 2.988331869942141e-12 1.372802081812638e-11," - "8.982122341016933e-10 3.747296441221644e-11 " - "2.3420726930957915e-12 2.390667520553204e-13 1.0982436589127136e-12"), - consistent_str="7.5 42.9 13.5 27. 220.5", - dissipation_pos_str=("4.921989904281101 36.24738971766925 " - "11.82065772959958 23.641315459201046 206.08266203865145"), - dissipation_neg_str=("0.4219899024845117 3.9473897091113366 " - "1.3206577265155963 2.6413154534736667 23.382662006532225"), - weno_flux_str=("12.843979806765613 83.09477942678058 " - "26.641315456115176 53.28263091267471 449.9653240451837"), - direction="z") - -# }}} - -# {{{ Input data: Case (d) - -single_data["Case d:x"] = FluxDataSingle( - states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", - fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", - lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," - "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686," - "-1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262," - "-3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 " - "-1.3125424167614286," - "-4.757359312880716 0 1.4142135623730951 -1.968813625142143 " - "-1.968813625142143," - "17.60303038033002 -4.485281374238571 -6.727922061357858 " - "9.184069510080404 11.42671019719969"), - R_inv_str=("-1.4118746341171051 -0.21727611674823194 " - "-0.4345522334964639 -0.6518283502446959 -0.13701474018997217," - "2.2426406871192857 0 0.7071067811865475 0 0," - "3.3639610306789285 0 0 0.7071067811865475 0," - "4.035297092194084 0.9696152645388333 0.5250169667045714 " - "0.7875254500568571 0.16553835820737872," - "1.7926564050747988 -0.4445982978342618 0.5250169667045714 " - "0.7875254500568571 0.16553835820737872"), - wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", - char_fluxes_pos_str=("0.009488213714461069 0.49705627484771453 " - "0.7455844122715716 0.31431832174320373 0.4306378813126712," - "0.1482823715615963 -0.1171572875253809 " - "-0.1757359312880714 0.20004041758408686 0.8893252542028551"), - char_fluxes_neg_str=("-0.26073527447612554 -1.3254833995939053 " - "-1.9882250993908572 -0.5017887559695788 -2.052422890589809," - "-1.1162114029572359 2.4603030380329987 " - "3.690454557049497 -0.4290108979594782 -7.986924884679773"), - weno_weights_pos_str=("0.9999990185022956 0.9999999974390363 " - "0.9999999994941201 0.9999978651320311 0.9999999917661908," - "9.08762722250494e-7 2.3712585027633853e-9 " - "4.684070887233427e-10 1.976628702372801e-6 7.62387333908512e-9," - "7.27349821618269e-8 1.897052057748541e-10 " - "3.747296441221644e-11 1.5823926647977797e-7 6.099359570650648e-10"), - weno_weights_neg_str=("0.999999999319454 0.9999999999982254 " - "0.9999999999996494 0.9999870425235151 0.9999999999997061," - "6.301345524776077e-10 1.6430428067143077e-12 " - "3.245518542322869e-13 0.000011996153712066484 2.721049684463335e-13," - "5.041138413805998e-11 1.3144350707803127e-13 " - "2.5964155584975223e-14 9.613227729623656e-7 2.1768403038595738e-14"), - consistent_str="-2.5 6.9 9. 13.5 -73.5", - dissipation_pos_str=("-0.14066328824586258 0.42563568844302985 " - "0.8804384437989112 1.3206576666570364 -7.7942206041633595"), - dissipation_neg_str=("-1.6406634409601506 4.725635754575325 " - "7.88043892893644 11.820658393408754 -68.69422377699841"), - weno_flux_str=("-4.281326729206013 12.051271443018354 " - "17.76087737273535 26.641316060065794 -149.98844438116177"), - direction="x") -single_data["Case d:y"] = FluxDataSingle( - states_str="1 -2 -3 -1 11,2 -8 -12 -4 64", - fluxes_str="-2 5.6 6 2 -25.2,-8 35.2 48 16 -268.8", - lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," - "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686," - "-3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976," - "-4.757359312880716 1.4142135623730951 0 -1.968813625142143 " - "-1.968813625142143," - "-1.5857864376269053 0 1.4142135623730951 -0.6562712083807143 " - "-0.6562712083807143," - "17.60303038033002 -6.727922061357858 -2.2426406871192857 " - "8.062749166520762 12.548030540759331"), - R_inv_str=("-1.4118746341171051 -0.4345522334964639 " - "-0.6518283502446959 -0.21727611674823194 -0.13701474018997217," - "3.3639610306789285 0 0.7071067811865475 0 0," - "1.1213203435596428 0 0 0.7071067811865475 0," - "5.156617435753728 1.2321237478911191 0.7875254500568571 " - "0.2625084833522857 0.16553835820737872," - "0.671336061515156 -0.18208981448197611 0.7875254500568571 " - "0.2625084833522857 0.16553835820737872"), - wavespeeds_str="4.4 4.4 4.4 2.753670749819466 6.046329250180534", - char_fluxes_pos_str=("0.018976427428922138 1.4911688245431431 " - "0.49705627484771453 1.432380835542713 0.05753157056903602," - "0.2965647431231918 -0.3514718625761428 " - "-0.1171572875253809 0.5689873221894901 1.6097440213843948"), - char_fluxes_neg_str=("-0.5214705489522515 -3.9764501987817145 " - "-1.3254833995939053 -3.767119678640133 -1.3413036144786457," - "-2.2324228059144673 7.380909114098994 " - "2.4603030380329987 -0.9465242322295992 -15.885347333048884"), - weno_weights_pos_str=("0.9999999386221037 0.9999999999683822 " - "0.9999999974390363 0.9999999993440752 0.9999999999372101," - "5.68308936788955e-8 2.9275831062158654e-11 " - "2.3712585027633853e-9 6.073372407373299e-10 5.8138848037057226e-11," - "4.547002513715645e-9 2.3420726930957915e-12 " - "1.897052057748541e-10 4.8587565862160355e-11 4.6511252168302e-12"), - weno_weights_neg_str=("0.9999999999574652 0.999999999999978 " - "0.9999999999982254 0.9999999999942413 0.9999999999999919," - "3.9384014966385437e-11 2.0284497966079935e-14 " - "1.6430428067143077e-12 5.332240836330361e-12 7.542808138536806e-15," - "3.1507308840273685e-12 1.622759950511315e-15 " - "1.3144350707803127e-13 4.265797494767529e-13 6.034246767570432e-16"), - consistent_str="-5. 20.4 27. 9. -147.", - dissipation_pos_str=("-0.2813265968286516 1.7462934823903074 " - "2.641315430506612 0.8804384760489334 -15.588441251607525"), - dissipation_neg_str=("-3.281326602835503 16.54629350160538 " - "23.641315459112736 7.880438486367551 -137.3884413587739"), - weno_flux_str=("-8.562653199664155 38.69258698399569 " - "53.28263088961934 17.760876962416486 -299.97688261038144"), - direction="y") -single_data["Case d:z"] = FluxDataSingle( - states_str="1 -3 -1 -2 11,2 -12 -4 -8 64", - fluxes_str="-3 10.6 3 6 -37.8,-12 75.2 24 48 -403.2", - lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," - "-6. -6. -6. -4.503337045290424 -7.496662954709576"), - R_str=("1 0 0 0.41384589551844686 0.41384589551844686," - "-4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903," - "-1.5857864376269053 1.4142135623730951 0 -0.6562712083807143 " - "-0.6562712083807143," - "-3.1715728752538106 0 1.4142135623730951 -1.3125424167614286 " - "-1.3125424167614286," - "17.60303038033002 -2.2426406871192857 -4.485281374238571 " - "6.941428822961119 13.669350884318975"), - R_inv_str=("-1.4118746341171051 -0.6518283502446959 " - "-0.21727611674823194 -0.4345522334964639 -0.13701474018997217," - "1.1213203435596428 0 0.7071067811865475 0 0," - "2.2426406871192857 0 0 0.7071067811865475 0," - "6.27793777931337 1.4946322312434048 0.2625084833522857 " - "0.5250169667045714 0.16553835820737872," - "-0.4499842820444868 0.08041866887030964 0.2625084833522857 " - "0.5250169667045714 0.16553835820737872"), - wavespeeds_str="6.6 6.6 6.6 4.953670749819467 8.246329250180533", - char_fluxes_pos_str=("0.02846464114338254 0.7455844122715716 " - "1.4911688245431431 3.0474996241899346 -0.8126310150223119," - "0.44484711468478866 -0.1757359312880714 " - "-0.3514718625761428 0.8207769392695052 2.447320076091316"), - char_fluxes_neg_str=("-0.7822058234283737 -1.9882250993908581 " - "-3.9764501987817162 -8.357934000904585 0.6952990612264269," - "-3.348634208871708 3.690454557049497 " - "7.380909114098994 0.9962654715332988 -26.24407281945101"), - weno_weights_pos_str=("0.9999999878747177 0.9999999994941201 " - "0.9999999999683822 0.9999999999851737 0.9999999999967727," - "1.1227070122726888e-8 4.684070887233427e-10 " - "2.9275831062158654e-11 1.372802081812638e-11 2.988331869942141e-12," - "8.982122341016933e-10 3.747296441221644e-11 " - "2.3420726930957915e-12 1.0982436589127136e-12 2.390667520553204e-13"), - weno_weights_neg_str=("0.999999999991598 0.9999999999996494 " - "0.999999999999978 0.9999999999999524 0.9999999999999993," - "7.779580658268568e-12 3.2455185423228674e-13 " - "2.028449796607992e-14 4.408056940300416e-14 6.408020704124379e-16," - "6.223673030753551e-13 2.596415558497523e-14 " - "1.6227599505113154e-15 3.526445914956101e-15 5.126416626873783e-17"), - consistent_str="-7.5 42.9 13.5 27. -220.5", - dissipation_pos_str=("-0.42198990248451174 3.947389709111337 " - "1.3206577265155963 2.6413154534736667 -23.382662006532225"), - dissipation_neg_str=("-4.9219899042811 36.247389717669265 " - "11.820657729599578 23.641315459201046 -206.08266203865145"), - weno_flux_str=("-12.843979806765612 83.09477942678059 " - "26.641315456115173 53.28263091267471 -449.9653240451837"), - direction="z") - -# }}} - +# +## {{{ Input data: Case (b) +# +#single_data["Case b:x"] = FluxDataSingle( +# states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", +# fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", +# lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," +# "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), +# R_str=("1 0 0 0.45781245952886396 0.45781245952886396," +# "-1.5857864376269053 0 0 -0.018886008110941373 " +# "-1.4330995704840366," +# "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " +# "-0.7259927892974889," +# "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " +# "-0.7259927892974889," +# "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " +# "3.335959603054103 5.578600290173388"), +# R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " +# "-0.265894835574803 -0.16767379847989416," +# "1.1213203435596428 0 0.7071067811865475 0 0," +# "1.1213203435596428 0 0 0.7071067811865475 0," +# "1.8120820550093746 0.9975038969055432 0.2903971157189956 " +# "0.2903971157189956 0.1831249838115456," +# "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " +# "0.2903971157189956 0.1831249838115456"), +# wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", +# char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " +# "0.24852813742385726 0.37456222716537935 0.10725061063772967," +# "0.16835489671908455 -0.05857864376269045 " +# "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), +# char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " +# "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," +# "-1.0907156303492833 1.2301515190164993 " +# "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), +# weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " +# "0.999999959029252 0.9999835300215946 0.9999999975371708," +# "3.2217041402391125e-6 3.793560951911702e-8 " +# "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," +# "2.579631146567429e-7 3.0351383606886035e-9 " +# "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), +# weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " +# "0.9999999999716082 0.9999909282503908 0.9999999999997268," +# "2.2354258683870077e-9 2.6288602366075745e-11 " +# "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," +# "1.788382117901561e-10 2.1030934718853924e-12 " +# "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), +# consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", +# dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " +# "0.49761166908056337 0.49761166908056337 -2.495196349669178"), +# dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " +# "3.9976117689805504 3.9976117689805504 -22.145196359962693"), +# weno_flux_str=("-4.353710219799678 12.247948547685105 " +# "8.995223438061114 8.995223438061114 -51.390392709631875"), +# direction="x") +#single_data["Case b:y"] = FluxDataSingle( +# states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", +# fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", +# lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," +# "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), +# R_str=("1 0 0 0.45781245952886396 0.45781245952886396," +# "-1.5857864376269053 0 0 -0.018886008110941373 " +# "-1.4330995704840366," +# "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " +# "-0.7259927892974889," +# "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " +# "-0.7259927892974889," +# "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " +# "3.335959603054103 5.578600290173388"), +# R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " +# "-0.265894835574803 -0.16767379847989416," +# "1.1213203435596428 0 0.7071067811865475 0 0," +# "1.1213203435596428 0 0 0.7071067811865475 0," +# "1.8120820550093746 0.9975038969055432 0.2903971157189956 " +# "0.2903971157189956 0.1831249838115456," +# "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " +# "0.2903971157189956 0.1831249838115456"), +# wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", +# char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " +# "0.24852813742385726 0.37456222716537935 0.10725061063772967," +# "0.16835489671908455 -0.05857864376269045 " +# "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), +# char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " +# "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," +# "-1.0907156303492833 1.2301515190164993 " +# "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), +# weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " +# "0.999999959029252 0.9999835300215946 0.9999999975371708," +# "3.2217041402391125e-6 3.793560951911702e-8 " +# "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," +# "2.579631146567429e-7 3.0351383606886035e-9 " +# "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), +# weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " +# "0.9999999999716082 0.9999909282503908 0.9999999999997268," +# "2.2354258683870077e-9 2.6288602366075745e-11 " +# "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," +# "1.788382117901561e-10 2.1030934718853924e-12 " +# "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), +# consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", +# dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " +# "0.49761166908056337 0.49761166908056337 -2.495196349669178"), +# dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " +# "3.9976117689805504 3.9976117689805504 -22.145196359962693"), +# weno_flux_str=("-4.353710219799678 12.247948547685105 " +# "8.995223438061114 8.995223438061114 -51.390392709631875"), +# direction="y") +#single_data["Case b:z"] = FluxDataSingle( +# states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", +# fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", +# lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," +# "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), +# R_str=("1 0 0 0.45781245952886396 0.45781245952886396," +# "-1.5857864376269053 0 0 -0.018886008110941373 " +# "-1.4330995704840366," +# "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " +# "-0.7259927892974889," +# "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " +# "-0.7259927892974889," +# "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " +# "3.335959603054103 5.578600290173388"), +# R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " +# "-0.265894835574803 -0.16767379847989416," +# "1.1213203435596428 0 0.7071067811865475 0 0," +# "1.1213203435596428 0 0 0.7071067811865475 0," +# "1.8120820550093746 0.9975038969055432 0.2903971157189956 " +# "0.2903971157189956 0.1831249838115456," +# "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " +# "0.2903971157189956 0.1831249838115456"), +# wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", +# char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " +# "0.24852813742385726 0.37456222716537935 0.10725061063772967," +# "0.16835489671908455 -0.05857864376269045 " +# "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), +# char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " +# "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," +# "-1.0907156303492833 1.2301515190164993 " +# "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), +# weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " +# "0.999999959029252 0.9999835300215946 0.9999999975371708," +# "3.2217041402391125e-6 3.793560951911702e-8 " +# "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," +# "2.579631146567429e-7 3.0351383606886035e-9 " +# "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), +# weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " +# "0.9999999999716082 0.9999909282503908 0.9999999999997268," +# "2.2354258683870077e-9 2.6288602366075745e-11 " +# "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," +# "1.788382117901561e-10 2.1030934718853924e-12 " +# "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), +# consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", +# dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " +# "0.49761166908056337 0.49761166908056337 -2.495196349669178"), +# dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " +# "3.9976117689805504 3.9976117689805504 -22.145196359962693"), +# weno_flux_str=("-4.353710219799678 12.247948547685105 " +# "8.995223438061114 8.995223438061114 -51.390392709631875"), +# direction="z") +# +## }}} +# +## {{{ Input data: Case (c) +# +#single_data["Case c:x"] = FluxDataSingle( +# states_str="2 4 8 12 64,1 1 2 3 11", +# fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", +# lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," +# "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), +# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," +# "1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326," +# "3.1715728752538106 1.4142135623730951 0 1.3125424167614286 " +# "1.3125424167614286," +# "4.757359312880716 0 1.4142135623730951 1.968813625142143 " +# "1.968813625142143," +# "17.60303038033002 4.485281374238571 6.727922061357858 " +# "11.42671019719969 9.184069510080404"), +# R_inv_str=("-1.4118746341171051 0.21727611674823194 0.4345522334964639 " +# "0.6518283502446959 -0.13701474018997217," +# "-2.2426406871192857 0 0.7071067811865475 0 0," +# "-3.3639610306789285 0 0 0.7071067811865475 0," +# "1.7926564050747988 0.4445982978342618 -0.5250169667045714 " +# "-0.7875254500568571 0.16553835820737872," +# "4.035297092194084 -0.9696152645388333 -0.5250169667045714 " +# "-0.7875254500568571 0.16553835820737872"), +# wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", +# char_fluxes_pos_str=("1.1162114029572359 2.4603030380329987 " +# "3.690454557049497 7.986924884679773 0.4290108979594782," +# "0.26073527447612554 -1.3254833995939053 " +# "-1.9882250993908572 2.052422890589809 0.5017887559695788"), +# char_fluxes_neg_str=("-0.1482823715615963 -0.1171572875253809 " +# "-0.1757359312880714 -0.8893252542028551 -0.20004041758408686," +# "-0.009488213714461069 0.49705627484771453 " +# "0.7455844122715716 -0.4306378813126712 -0.31431832174320373"), +# weno_weights_pos_str=("0.999999999319454 0.9999999999982254 " +# "0.9999999999996494 0.9999999999997061 0.9999870425235151," +# "6.301345524776077e-10 1.6430428067143077e-12 " +# "3.245518542322869e-13 2.721049684463335e-13 0.000011996153712066484," +# "5.041138413805998e-11 1.3144350707803127e-13 " +# "2.5964155584975223e-14 2.1768403038595738e-14 9.613227729623656e-7"), +# weno_weights_neg_str=("0.9999990185022956 0.9999999974390363 " +# "0.9999999994941201 0.9999999917661908 0.9999978651320311," +# "9.08762722250494e-7 2.3712585027633853e-9 " +# "4.684070887233427e-10 7.62387333908512e-9 1.976628702372801e-6," +# "7.27349821618269e-8 1.897052057748541e-10 " +# "3.747296441221644e-11 6.099359570650648e-10 1.5823926647977797e-7"), +# consistent_str="2.5 6.9 9. 13.5 73.5", +# dissipation_pos_str=("1.6406634409601506 4.725635754575325 " +# "7.88043892893644 11.820658393408754 68.69422377699841"), +# dissipation_neg_str=("0.14066328824586258 0.4256356884430299 " +# "0.8804384437989111 1.3206576666570364 7.7942206041633595"), +# weno_flux_str=("4.281326729206013 12.051271443018354 " +# "17.76087737273535 26.64131606006579 149.98844438116177"), +# direction="x") +#single_data["Case c:y"] = FluxDataSingle( +# states_str="2 8 12 4 64,1 2 3 1 11", +# fluxes_str="8 35.2 48 16 268.8,2 5.6 6 2 25.2", +# lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," +# "2. 2. 2. 3.4966629547095764 0.5033370452904236"), +# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," +# "3.1715728752538106 0 0 2.019649197947976 0.605435635574881," +# "4.757359312880716 1.4142135623730951 0 1.968813625142143 " +# "1.968813625142143," +# "1.5857864376269053 0 1.4142135623730951 0.6562712083807143 " +# "0.6562712083807143," +# "17.60303038033002 6.727922061357858 2.2426406871192857 " +# "12.548030540759331 8.062749166520762"), +# R_inv_str=("-1.4118746341171051 0.4345522334964639 0.6518283502446959 " +# "0.21727611674823194 -0.13701474018997217," +# "-3.3639610306789285 0 0.7071067811865475 0 0," +# "-1.1213203435596428 0 0 0.7071067811865475 0," +# "0.671336061515156 0.18208981448197611 -0.7875254500568571 " +# "-0.2625084833522857 0.16553835820737872," +# "5.156617435753728 -1.2321237478911191 -0.7875254500568571 " +# "-0.2625084833522857 0.16553835820737872"), +# wavespeeds_str="4.4 4.4 4.4 6.046329250180534 2.753670749819466", +# char_fluxes_pos_str=("2.2324228059144673 7.380909114098994 " +# "2.4603030380329987 15.885347333048884 0.9465242322295992," +# "0.5214705489522515 -3.9764501987817145 " +# "-1.3254833995939053 1.3413036144786457 3.767119678640133"), +# char_fluxes_neg_str=("-0.2965647431231918 -0.3514718625761428 " +# "-0.1171572875253809 -1.6097440213843948 -0.5689873221894901," +# "-0.018976427428922138 1.4911688245431431 " +# "0.49705627484771453 -0.05753157056903602 -1.432380835542713"), +# weno_weights_pos_str=("0.9999999999574652 0.999999999999978 " +# "0.9999999999982254 0.9999999999999919 0.9999999999942413," +# "3.9384014966385437e-11 2.0284497966079935e-14 " +# "1.6430428067143077e-12 7.542808138536806e-15 5.332240836330361e-12," +# "3.1507308840273685e-12 1.622759950511315e-15 " +# "1.3144350707803127e-13 6.034246767570432e-16 4.265797494767529e-13"), +# weno_weights_neg_str=("0.9999999386221037 0.9999999999683822 " +# "0.9999999974390363 0.9999999999372101 0.9999999993440752," +# "5.68308936788955e-8 2.9275831062158654e-11 " +# "2.3712585027633853e-9 5.8138848037057226e-11 6.073372407373299e-10," +# "4.547002513715645e-9 2.3420726930957915e-12 " +# "1.897052057748541e-10 4.6511252168302e-12 4.8587565862160355e-11"), +# consistent_str="5. 20.4 27. 9. 147.", +# dissipation_pos_str=("3.281326602835503 16.54629350160538 " +# "23.641315459112736 7.8804384863675505 137.3884413587739"), +# dissipation_neg_str=("0.2813265968286516 1.7462934823903076 " +# "2.641315430506613 0.8804384760489334 15.588441251607525"), +# weno_flux_str=("8.562653199664155 38.69258698399568 " +# "53.28263088961935 17.760876962416482 299.9768826103814"), +# direction="y") +#single_data["Case c:z"] = FluxDataSingle( +# states_str="2 12 4 8 64,1 3 1 2 11", +# fluxes_str="12 75.2 24 48 403.2,3 10.6 3 6 37.8", +# lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," +# "3. 3. 3. 4.496662954709576 1.5033370452904236"), +# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," +# "4.757359312880716 0 0 2.6759204063286903 1.2617068439555954," +# "1.5857864376269053 1.4142135623730951 0 0.6562712083807143 " +# "0.6562712083807143," +# "3.1715728752538106 0 1.4142135623730951 1.3125424167614286 " +# "1.3125424167614286," +# "17.60303038033002 2.2426406871192857 4.485281374238571 " +# "13.669350884318975 6.941428822961119"), +# R_inv_str=("-1.4118746341171051 0.6518283502446959 " +# "0.21727611674823194 0.4345522334964639 -0.13701474018997217," +# "-1.1213203435596428 0 0.7071067811865475 0 0," +# "-2.2426406871192857 0 0 0.7071067811865475 0," +# "-0.4499842820444868 -0.08041866887030964 -0.2625084833522857 " +# "-0.5250169667045714 0.16553835820737872," +# "6.27793777931337 -1.4946322312434048 -0.2625084833522857 " +# "-0.5250169667045714 0.16553835820737872"), +# wavespeeds_str="6.6 6.6 6.6 8.246329250180533 4.953670749819467", +# char_fluxes_pos_str=("3.348634208871708 3.690454557049497 " +# "7.380909114098994 26.24407281945101 -0.9962654715332988," +# "0.7822058234283737 -1.9882250993908581 " +# "-3.9764501987817162 -0.6952990612264269 8.357934000904585"), +# char_fluxes_neg_str=("-0.44484711468478866 -0.1757359312880714 " +# "-0.3514718625761428 -2.447320076091316 -0.8207769392695052," +# "-0.02846464114338254 0.7455844122715716 " +# "1.4911688245431431 0.8126310150223119 -3.0474996241899346"), +# weno_weights_pos_str=("0.999999999991598 0.9999999999996494 " +# "0.999999999999978 0.9999999999999993 0.9999999999999524," +# "7.779580658268568e-12 3.2455185423228674e-13 " +# "2.028449796607992e-14 6.408020704124379e-16 4.408056940300416e-14," +# "6.223673030753551e-13 2.596415558497523e-14 " +# "1.6227599505113154e-15 5.126416626873783e-17 3.526445914956101e-15"), +# weno_weights_neg_str=("0.9999999878747177 0.9999999994941201 " +# "0.9999999999683822 0.9999999999967727 0.9999999999851737," +# "1.1227070122726888e-8 4.684070887233427e-10 " +# "2.9275831062158654e-11 2.988331869942141e-12 1.372802081812638e-11," +# "8.982122341016933e-10 3.747296441221644e-11 " +# "2.3420726930957915e-12 2.390667520553204e-13 1.0982436589127136e-12"), +# consistent_str="7.5 42.9 13.5 27. 220.5", +# dissipation_pos_str=("4.921989904281101 36.24738971766925 " +# "11.82065772959958 23.641315459201046 206.08266203865145"), +# dissipation_neg_str=("0.4219899024845117 3.9473897091113366 " +# "1.3206577265155963 2.6413154534736667 23.382662006532225"), +# weno_flux_str=("12.843979806765613 83.09477942678058 " +# "26.641315456115176 53.28263091267471 449.9653240451837"), +# direction="z") +# +## }}} +# +## {{{ Input data: Case (d) +# +#single_data["Case d:x"] = FluxDataSingle( +# states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", +# fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", +# lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," +# "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), +# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," +# "-1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262," +# "-3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 " +# "-1.3125424167614286," +# "-4.757359312880716 0 1.4142135623730951 -1.968813625142143 " +# "-1.968813625142143," +# "17.60303038033002 -4.485281374238571 -6.727922061357858 " +# "9.184069510080404 11.42671019719969"), +# R_inv_str=("-1.4118746341171051 -0.21727611674823194 " +# "-0.4345522334964639 -0.6518283502446959 -0.13701474018997217," +# "2.2426406871192857 0 0.7071067811865475 0 0," +# "3.3639610306789285 0 0 0.7071067811865475 0," +# "4.035297092194084 0.9696152645388333 0.5250169667045714 " +# "0.7875254500568571 0.16553835820737872," +# "1.7926564050747988 -0.4445982978342618 0.5250169667045714 " +# "0.7875254500568571 0.16553835820737872"), +# wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", +# char_fluxes_pos_str=("0.009488213714461069 0.49705627484771453 " +# "0.7455844122715716 0.31431832174320373 0.4306378813126712," +# "0.1482823715615963 -0.1171572875253809 " +# "-0.1757359312880714 0.20004041758408686 0.8893252542028551"), +# char_fluxes_neg_str=("-0.26073527447612554 -1.3254833995939053 " +# "-1.9882250993908572 -0.5017887559695788 -2.052422890589809," +# "-1.1162114029572359 2.4603030380329987 " +# "3.690454557049497 -0.4290108979594782 -7.986924884679773"), +# weno_weights_pos_str=("0.9999990185022956 0.9999999974390363 " +# "0.9999999994941201 0.9999978651320311 0.9999999917661908," +# "9.08762722250494e-7 2.3712585027633853e-9 " +# "4.684070887233427e-10 1.976628702372801e-6 7.62387333908512e-9," +# "7.27349821618269e-8 1.897052057748541e-10 " +# "3.747296441221644e-11 1.5823926647977797e-7 6.099359570650648e-10"), +# weno_weights_neg_str=("0.999999999319454 0.9999999999982254 " +# "0.9999999999996494 0.9999870425235151 0.9999999999997061," +# "6.301345524776077e-10 1.6430428067143077e-12 " +# "3.245518542322869e-13 0.000011996153712066484 2.721049684463335e-13," +# "5.041138413805998e-11 1.3144350707803127e-13 " +# "2.5964155584975223e-14 9.613227729623656e-7 2.1768403038595738e-14"), +# consistent_str="-2.5 6.9 9. 13.5 -73.5", +# dissipation_pos_str=("-0.14066328824586258 0.42563568844302985 " +# "0.8804384437989112 1.3206576666570364 -7.7942206041633595"), +# dissipation_neg_str=("-1.6406634409601506 4.725635754575325 " +# "7.88043892893644 11.820658393408754 -68.69422377699841"), +# weno_flux_str=("-4.281326729206013 12.051271443018354 " +# "17.76087737273535 26.641316060065794 -149.98844438116177"), +# direction="x") +#single_data["Case d:y"] = FluxDataSingle( +# states_str="1 -2 -3 -1 11,2 -8 -12 -4 64", +# fluxes_str="-2 5.6 6 2 -25.2,-8 35.2 48 16 -268.8", +# lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," +# "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), +# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," +# "-3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976," +# "-4.757359312880716 1.4142135623730951 0 -1.968813625142143 " +# "-1.968813625142143," +# "-1.5857864376269053 0 1.4142135623730951 -0.6562712083807143 " +# "-0.6562712083807143," +# "17.60303038033002 -6.727922061357858 -2.2426406871192857 " +# "8.062749166520762 12.548030540759331"), +# R_inv_str=("-1.4118746341171051 -0.4345522334964639 " +# "-0.6518283502446959 -0.21727611674823194 -0.13701474018997217," +# "3.3639610306789285 0 0.7071067811865475 0 0," +# "1.1213203435596428 0 0 0.7071067811865475 0," +# "5.156617435753728 1.2321237478911191 0.7875254500568571 " +# "0.2625084833522857 0.16553835820737872," +# "0.671336061515156 -0.18208981448197611 0.7875254500568571 " +# "0.2625084833522857 0.16553835820737872"), +# wavespeeds_str="4.4 4.4 4.4 2.753670749819466 6.046329250180534", +# char_fluxes_pos_str=("0.018976427428922138 1.4911688245431431 " +# "0.49705627484771453 1.432380835542713 0.05753157056903602," +# "0.2965647431231918 -0.3514718625761428 " +# "-0.1171572875253809 0.5689873221894901 1.6097440213843948"), +# char_fluxes_neg_str=("-0.5214705489522515 -3.9764501987817145 " +# "-1.3254833995939053 -3.767119678640133 -1.3413036144786457," +# "-2.2324228059144673 7.380909114098994 " +# "2.4603030380329987 -0.9465242322295992 -15.885347333048884"), +# weno_weights_pos_str=("0.9999999386221037 0.9999999999683822 " +# "0.9999999974390363 0.9999999993440752 0.9999999999372101," +# "5.68308936788955e-8 2.9275831062158654e-11 " +# "2.3712585027633853e-9 6.073372407373299e-10 5.8138848037057226e-11," +# "4.547002513715645e-9 2.3420726930957915e-12 " +# "1.897052057748541e-10 4.8587565862160355e-11 4.6511252168302e-12"), +# weno_weights_neg_str=("0.9999999999574652 0.999999999999978 " +# "0.9999999999982254 0.9999999999942413 0.9999999999999919," +# "3.9384014966385437e-11 2.0284497966079935e-14 " +# "1.6430428067143077e-12 5.332240836330361e-12 7.542808138536806e-15," +# "3.1507308840273685e-12 1.622759950511315e-15 " +# "1.3144350707803127e-13 4.265797494767529e-13 6.034246767570432e-16"), +# consistent_str="-5. 20.4 27. 9. -147.", +# dissipation_pos_str=("-0.2813265968286516 1.7462934823903074 " +# "2.641315430506612 0.8804384760489334 -15.588441251607525"), +# dissipation_neg_str=("-3.281326602835503 16.54629350160538 " +# "23.641315459112736 7.880438486367551 -137.3884413587739"), +# weno_flux_str=("-8.562653199664155 38.69258698399569 " +# "53.28263088961934 17.760876962416486 -299.97688261038144"), +# direction="y") +#single_data["Case d:z"] = FluxDataSingle( +# states_str="1 -3 -1 -2 11,2 -12 -4 -8 64", +# fluxes_str="-3 10.6 3 6 -37.8,-12 75.2 24 48 -403.2", +# lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," +# "-6. -6. -6. -4.503337045290424 -7.496662954709576"), +# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," +# "-4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903," +# "-1.5857864376269053 1.4142135623730951 0 -0.6562712083807143 " +# "-0.6562712083807143," +# "-3.1715728752538106 0 1.4142135623730951 -1.3125424167614286 " +# "-1.3125424167614286," +# "17.60303038033002 -2.2426406871192857 -4.485281374238571 " +# "6.941428822961119 13.669350884318975"), +# R_inv_str=("-1.4118746341171051 -0.6518283502446959 " +# "-0.21727611674823194 -0.4345522334964639 -0.13701474018997217," +# "1.1213203435596428 0 0.7071067811865475 0 0," +# "2.2426406871192857 0 0 0.7071067811865475 0," +# "6.27793777931337 1.4946322312434048 0.2625084833522857 " +# "0.5250169667045714 0.16553835820737872," +# "-0.4499842820444868 0.08041866887030964 0.2625084833522857 " +# "0.5250169667045714 0.16553835820737872"), +# wavespeeds_str="6.6 6.6 6.6 4.953670749819467 8.246329250180533", +# char_fluxes_pos_str=("0.02846464114338254 0.7455844122715716 " +# "1.4911688245431431 3.0474996241899346 -0.8126310150223119," +# "0.44484711468478866 -0.1757359312880714 " +# "-0.3514718625761428 0.8207769392695052 2.447320076091316"), +# char_fluxes_neg_str=("-0.7822058234283737 -1.9882250993908581 " +# "-3.9764501987817162 -8.357934000904585 0.6952990612264269," +# "-3.348634208871708 3.690454557049497 " +# "7.380909114098994 0.9962654715332988 -26.24407281945101"), +# weno_weights_pos_str=("0.9999999878747177 0.9999999994941201 " +# "0.9999999999683822 0.9999999999851737 0.9999999999967727," +# "1.1227070122726888e-8 4.684070887233427e-10 " +# "2.9275831062158654e-11 1.372802081812638e-11 2.988331869942141e-12," +# "8.982122341016933e-10 3.747296441221644e-11 " +# "2.3420726930957915e-12 1.0982436589127136e-12 2.390667520553204e-13"), +# weno_weights_neg_str=("0.999999999991598 0.9999999999996494 " +# "0.999999999999978 0.9999999999999524 0.9999999999999993," +# "7.779580658268568e-12 3.2455185423228674e-13 " +# "2.028449796607992e-14 4.408056940300416e-14 6.408020704124379e-16," +# "6.223673030753551e-13 2.596415558497523e-14 " +# "1.6227599505113154e-15 3.526445914956101e-15 5.126416626873783e-17"), +# consistent_str="-7.5 42.9 13.5 27. -220.5", +# dissipation_pos_str=("-0.42198990248451174 3.947389709111337 " +# "1.3206577265155963 2.6413154534736667 -23.382662006532225"), +# dissipation_neg_str=("-4.9219899042811 36.247389717669265 " +# "11.820657729599578 23.641315459201046 -206.08266203865145"), +# weno_flux_str=("-12.843979806765612 83.09477942678059 " +# "26.641315456115173 53.28263091267471 -449.9653240451837"), +# direction="z") +# +## }}} +# @pytest.fixture(scope="session", params=[ - "Case flat:x", "Case flat:y", "Case flat:z"]) - #"Case a:x", "Case a:y", "Case a:z", + #"Case flat:x", "Case flat:y", "Case flat:z", + "Case a:x"])#, "Case a:y", "Case a:z", #"Case b:x", "Case b:y", "Case b:z", #"Case c:x", "Case c:y", "Case c:z", #"Case d:x", "Case d:y", "Case d:z"]) diff --git a/test.py b/test.py index 427f3e7..3fdbf1b 100644 --- a/test.py +++ b/test.py @@ -18,6 +18,7 @@ import utilities as u from data_for_test import flux_test_data_fixture # noqa: F401 +@pytest.mark.slow def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -37,6 +38,7 @@ def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(flux_dev.get(), data.weno_flux) +@pytest.mark.slow def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -52,6 +54,7 @@ def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(consistent_dev.get(), data.consistent) +@pytest.mark.slow def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -69,6 +72,7 @@ def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) +@pytest.mark.slow def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -86,6 +90,7 @@ def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_neg) +@pytest.mark.slow def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -99,9 +104,13 @@ def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): combined_frozen_metrics=1.0, w=weights_dev) + sum_weights = np.sum(weights_dev.get(), axis=1) + u.compare_arrays(sum_weights, np.ones(data.nvars)) + u.compare_arrays(weights_dev.get(), data.weno_weights_pos) +@pytest.mark.slow def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -115,9 +124,43 @@ def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): combined_frozen_metrics=1.0, w=weights_dev) + sum_weights = np.sum(weights_dev.get(), axis=1) + u.compare_arrays(sum_weights, np.ones(data.nvars)) + u.compare_arrays(weights_dev.get(), data.weno_weights_neg) +def test_oscillation_pos_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture + + prg = u.get_weno_program_with_root_kernel("oscillation_pos") + queue = u.get_queue(ctx_factory) + + oscillation_dev = u.empty_array_on_device(queue, data.nvars, 3) + + prg(queue, nvars=data.nvars, + characteristic_fluxes=data.char_fluxes_pos, + oscillation=oscillation_dev) + + u.compare_arrays(oscillation_dev.get(), data.oscillation_pos) + + +def test_oscillation_neg_uniform_grid(ctx_factory, flux_test_data_fixture): + data = flux_test_data_fixture + + prg = u.get_weno_program_with_root_kernel("oscillation_neg") + queue = u.get_queue(ctx_factory) + + oscillation_dev = u.empty_array_on_device(queue, data.nvars, 3) + + prg(queue, nvars=data.nvars, + characteristic_fluxes=data.char_fluxes_neg, + oscillation=oscillation_dev) + + u.compare_arrays(oscillation_dev.get(), data.oscillation_neg) + + +@pytest.mark.slow def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -139,6 +182,7 @@ def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(fluxes_neg_dev.get(), data.char_fluxes_neg) +@pytest.mark.slow def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -153,6 +197,7 @@ def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): u.compare_arrays(lam_dev.get(), data.lam_pointwise) +@pytest.mark.slow def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -192,6 +237,7 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): check_roe_property(data.state_pair, data.flux_pair, R, R_inv, lam) +@pytest.mark.slow @pytest.mark.parametrize("lam_pointwise_str,lam_roe_str,lam_expected_str", [ ("1 2 3 4 5,2 4 6 8 10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), ("1 2 3 4 5,-2 -4 -6 -8 -10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), @@ -217,6 +263,7 @@ def test_lax_wavespeeds( u.compare_arrays(lam_dev.get(), lam_expected) +@pytest.mark.slow def test_matvec(ctx_factory): prg = u.get_weno_program_with_root_kernel("mult_mat_vec") queue = u.get_queue(ctx_factory) diff --git a/utilities.py b/utilities.py index e542fb0..d47c2f1 100644 --- a/utilities.py +++ b/utilities.py @@ -73,7 +73,6 @@ def expand_to_6(pair): # }}} - # {{{ device def get_queue(ctx_factory): -- GitLab From bb05b094f78d42e944d1a7b437215287b2d2a5bd Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Thu, 22 Aug 2019 20:22:24 -0500 Subject: [PATCH 54/60] add full set of tests for oscillation indicator subroutines --- data_for_test.py | 1236 +++++++++++++++++++++++++--------------------- 1 file changed, 660 insertions(+), 576 deletions(-) diff --git a/data_for_test.py b/data_for_test.py index a268e4c..bde2cd9 100644 --- a/data_for_test.py +++ b/data_for_test.py @@ -82,108 +82,114 @@ single_data = {} # {{{ Input data: "flat" case -#single_data["Case flat:x"] = FluxDataSingle( -# states_str="1 1 1 1 5.5,1 1 1 1 5.5", -# fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", -# lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," -# "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), -# R_str=("1 0 0 0.3340765523905305 0.3340765523905305," -# "1 0 0 0.8340765523905306 -0.1659234476094695," -# "1 1 0 0.3340765523905305 0.3340765523905305," -# "1 0 1 0.3340765523905305 0.3340765523905305," -# "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), -# R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " -# "0.1785714285714286 -0.1785714285714286," -# "-1. 0 1. 0 0," -# "-1. 0 0 1. 0," -# "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " -# "-0.2672612419124244 0.2672612419124244," -# "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " -# "-0.2672612419124244 0.2672612419124244"), -# wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", -# char_fluxes_pos_str=( -# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," -# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), -# char_fluxes_neg_str=( -# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," -# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), -# weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," -# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), -# weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," -# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), -# consistent_str="1 2.6 1 1 7.1", -# dissipation_pos_str=("0 0 0 0 0"), -# dissipation_neg_str=("0 0 0 0 0"), -# weno_flux_str=("1 2.6 1 1 7.1"), -# direction="x") -#single_data["Case flat:y"] = FluxDataSingle( -# states_str="1 1 1 1 5.5,1 1 1 1 5.5", -# fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", -# lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," -# "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), -# R_str=("1 0 0 0.3340765523905305 0.3340765523905305," -# "1 0 0 0.8340765523905306 -0.1659234476094695," -# "1 1 0 0.3340765523905305 0.3340765523905305," -# "1 0 1 0.3340765523905305 0.3340765523905305," -# "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), -# R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " -# "0.1785714285714286 -0.1785714285714286," -# "-1. 0 1. 0 0," -# "-1. 0 0 1. 0," -# "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " -# "-0.2672612419124244 0.2672612419124244," -# "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " -# "-0.2672612419124244 0.2672612419124244"), -# wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", -# char_fluxes_pos_str=( -# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," -# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), -# char_fluxes_neg_str=( -# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," -# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), -# weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," -# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), -# weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," -# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), -# consistent_str="1 2.6 1 1 7.1", -# dissipation_pos_str=("0 0 0 0 0"), -# dissipation_neg_str=("0 0 0 0 0"), -# weno_flux_str=("1 2.6 1 1 7.1"), -# direction="y") -#single_data["Case flat:z"] = FluxDataSingle( -# states_str="1 1 1 1 5.5,1 1 1 1 5.5", -# fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", -# lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," -# "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), -# R_str=("1 0 0 0.3340765523905305 0.3340765523905305," -# "1 0 0 0.8340765523905306 -0.1659234476094695," -# "1 1 0 0.3340765523905305 0.3340765523905305," -# "1 0 1 0.3340765523905305 0.3340765523905305," -# "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), -# R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " -# "0.1785714285714286 -0.1785714285714286," -# "-1. 0 1. 0 0," -# "-1. 0 0 1. 0," -# "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " -# "-0.2672612419124244 0.2672612419124244," -# "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " -# "-0.2672612419124244 0.2672612419124244"), -# wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", -# char_fluxes_pos_str=( -# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," -# "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), -# char_fluxes_neg_str=( -# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," -# "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), -# weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," -# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), -# weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," -# "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), -# consistent_str="1 2.6 1 1 7.1", -# dissipation_pos_str=("0 0 0 0 0"), -# dissipation_neg_str=("0 0 0 0 0"), -# weno_flux_str=("1 2.6 1 1 7.1"), -# direction="z") +single_data["Case flat:x"] = FluxDataSingle( + states_str="1 1 1 1 5.5,1 1 1 1 5.5", + fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", + lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.3340765523905305 0.3340765523905305," + "1 0 0 0.8340765523905306 -0.1659234476094695," + "1 1 0 0.3340765523905305 0.3340765523905305," + "1 0 1 0.3340765523905305 0.3340765523905305," + "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), + R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " + "0.1785714285714286 -0.1785714285714286," + "-1. 0 1. 0 0," + "-1. 0 0 1. 0," + "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244," + "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244"), + wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", + char_fluxes_pos_str=( + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), + char_fluxes_neg_str=( + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), + oscillation_pos_str=("0 0 0 0 0,0 0 0 0 0,0 0 0 0 0"), + oscillation_neg_str=("0 0 0 0 0,0 0 0 0 0,0 0 0 0 0"), + weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + consistent_str="1 2.6 1 1 7.1", + dissipation_pos_str=("0 0 0 0 0"), + dissipation_neg_str=("0 0 0 0 0"), + weno_flux_str=("1 2.6 1 1 7.1"), + direction="x") +single_data["Case flat:y"] = FluxDataSingle( + states_str="1 1 1 1 5.5,1 1 1 1 5.5", + fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", + lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.3340765523905305 0.3340765523905305," + "1 0 0 0.8340765523905306 -0.1659234476094695," + "1 1 0 0.3340765523905305 0.3340765523905305," + "1 0 1 0.3340765523905305 0.3340765523905305," + "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), + R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " + "0.1785714285714286 -0.1785714285714286," + "-1. 0 1. 0 0," + "-1. 0 0 1. 0," + "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244," + "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244"), + wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", + char_fluxes_pos_str=( + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), + char_fluxes_neg_str=( + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), + oscillation_pos_str=("0 0 0 0 0,0 0 0 0 0,0 0 0 0 0"), + oscillation_neg_str=("0 0 0 0 0,0 0 0 0 0,0 0 0 0 0"), + weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + consistent_str="1 2.6 1 1 7.1", + dissipation_pos_str=("0 0 0 0 0"), + dissipation_neg_str=("0 0 0 0 0"), + weno_flux_str=("1 2.6 1 1 7.1"), + direction="y") +single_data["Case flat:z"] = FluxDataSingle( + states_str="1 1 1 1 5.5,1 1 1 1 5.5", + fluxes_str="1 2.6 1 1 7.1,1 2.6 1 1 7.1", + lam_str=("1. 1. 1. 2.4966629547095764 -0.49666295470957644," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.3340765523905305 0.3340765523905305," + "1 0 0 0.8340765523905306 -0.1659234476094695," + "1 1 0 0.3340765523905305 0.3340765523905305," + "1 0 1 0.3340765523905305 0.3340765523905305," + "1.5000000000000009 1 1 2.8719435219727663 1.8719435219727667"), + R_inv_str=("0.7321428571428572 0.1785714285714286 0.1785714285714286 " + "0.1785714285714286 -0.1785714285714286," + "-1. 0 1. 0 0," + "-1. 0 0 1. 0," + "-0.5991081371313636 0.7327387580875756 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244," + "1.4008918628686364 -1.2672612419124245 -0.2672612419124244 " + "-0.2672612419124244 0.2672612419124244"), + wavespeeds_str="1.1 1.1 1.1 2.7463292501805343 0.5463292501805341", + char_fluxes_pos_str=( + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326," + "0.30000000000000004 0. 0. 2.8024972160321826 0.026547751617514326"), + char_fluxes_neg_str=( + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178," + "-0.014285714285714235 0. 0. -0.13345224838248493 -0.5575027839678178"), + oscillation_pos_str=("0 0 0 0 0,0 0 0 0 0,0 0 0 0 0"), + oscillation_neg_str=("0 0 0 0 0,0 0 0 0 0,0 0 0 0 0"), + weno_weights_pos_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + weno_weights_neg_str=("0.1 0.1 0.1 0.1 0.1," + "0.6 0.6 0.6 0.6 0.6,0.3 0.3 0.3 0.3 0.3"), + consistent_str="1 2.6 1 1 7.1", + dissipation_pos_str=("0 0 0 0 0"), + dissipation_neg_str=("0 0 0 0 0"), + weno_flux_str=("1 2.6 1 1 7.1"), + direction="z") # }}} @@ -371,482 +377,560 @@ single_data["Case a:z"] = FluxDataSingle( direction="z") # }}} -# -## {{{ Input data: Case (b) -# -#single_data["Case b:x"] = FluxDataSingle( -# states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", -# fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", -# lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," -# "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), -# R_str=("1 0 0 0.45781245952886396 0.45781245952886396," -# "-1.5857864376269053 0 0 -0.018886008110941373 " -# "-1.4330995704840366," -# "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " -# "-0.7259927892974889," -# "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " -# "-0.7259927892974889," -# "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " -# "3.335959603054103 5.578600290173388"), -# R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " -# "-0.265894835574803 -0.16767379847989416," -# "1.1213203435596428 0 0.7071067811865475 0 0," -# "1.1213203435596428 0 0 0.7071067811865475 0," -# "1.8120820550093746 0.9975038969055432 0.2903971157189956 " -# "0.2903971157189956 0.1831249838115456," -# "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " -# "0.2903971157189956 0.1831249838115456"), -# wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", -# char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " -# "0.24852813742385726 0.37456222716537935 0.10725061063772967," -# "0.16835489671908455 -0.05857864376269045 " -# "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), -# char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " -# "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," -# "-1.0907156303492833 1.2301515190164993 " -# "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), -# weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " -# "0.999999959029252 0.9999835300215946 0.9999999975371708," -# "3.2217041402391125e-6 3.793560951911702e-8 " -# "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," -# "2.579631146567429e-7 3.0351383606886035e-9 " -# "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), -# weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " -# "0.9999999999716082 0.9999909282503908 0.9999999999997268," -# "2.2354258683870077e-9 2.6288602366075745e-11 " -# "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," -# "1.788382117901561e-10 2.1030934718853924e-12 " -# "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), -# consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", -# dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " -# "0.49761166908056337 0.49761166908056337 -2.495196349669178"), -# dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " -# "3.9976117689805504 3.9976117689805504 -22.145196359962693"), -# weno_flux_str=("-4.353710219799678 12.247948547685105 " -# "8.995223438061114 8.995223438061114 -51.390392709631875"), -# direction="x") -#single_data["Case b:y"] = FluxDataSingle( -# states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", -# fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", -# lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," -# "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), -# R_str=("1 0 0 0.45781245952886396 0.45781245952886396," -# "-1.5857864376269053 0 0 -0.018886008110941373 " -# "-1.4330995704840366," -# "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " -# "-0.7259927892974889," -# "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " -# "-0.7259927892974889," -# "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " -# "3.335959603054103 5.578600290173388"), -# R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " -# "-0.265894835574803 -0.16767379847989416," -# "1.1213203435596428 0 0.7071067811865475 0 0," -# "1.1213203435596428 0 0 0.7071067811865475 0," -# "1.8120820550093746 0.9975038969055432 0.2903971157189956 " -# "0.2903971157189956 0.1831249838115456," -# "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " -# "0.2903971157189956 0.1831249838115456"), -# wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", -# char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " -# "0.24852813742385726 0.37456222716537935 0.10725061063772967," -# "0.16835489671908455 -0.05857864376269045 " -# "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), -# char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " -# "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," -# "-1.0907156303492833 1.2301515190164993 " -# "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), -# weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " -# "0.999999959029252 0.9999835300215946 0.9999999975371708," -# "3.2217041402391125e-6 3.793560951911702e-8 " -# "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," -# "2.579631146567429e-7 3.0351383606886035e-9 " -# "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), -# weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " -# "0.9999999999716082 0.9999909282503908 0.9999999999997268," -# "2.2354258683870077e-9 2.6288602366075745e-11 " -# "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," -# "1.788382117901561e-10 2.1030934718853924e-12 " -# "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), -# consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", -# dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " -# "0.49761166908056337 0.49761166908056337 -2.495196349669178"), -# dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " -# "3.9976117689805504 3.9976117689805504 -22.145196359962693"), -# weno_flux_str=("-4.353710219799678 12.247948547685105 " -# "8.995223438061114 8.995223438061114 -51.390392709631875"), -# direction="y") -#single_data["Case b:z"] = FluxDataSingle( -# states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", -# fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", -# lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," -# "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), -# R_str=("1 0 0 0.45781245952886396 0.45781245952886396," -# "-1.5857864376269053 0 0 -0.018886008110941373 " -# "-1.4330995704840366," -# "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " -# "-0.7259927892974889," -# "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " -# "-0.7259927892974889," -# "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " -# "3.335959603054103 5.578600290173388"), -# R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " -# "-0.265894835574803 -0.16767379847989416," -# "1.1213203435596428 0 0.7071067811865475 0 0," -# "1.1213203435596428 0 0 0.7071067811865475 0," -# "1.8120820550093746 0.9975038969055432 0.2903971157189956 " -# "0.2903971157189956 0.1831249838115456," -# "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " -# "0.2903971157189956 0.1831249838115456"), -# wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", -# char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " -# "0.24852813742385726 0.37456222716537935 0.10725061063772967," -# "0.16835489671908455 -0.05857864376269045 " -# "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), -# char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " -# "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," -# "-1.0907156303492833 1.2301515190164993 " -# "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), -# weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " -# "0.999999959029252 0.9999835300215946 0.9999999975371708," -# "3.2217041402391125e-6 3.793560951911702e-8 " -# "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," -# "2.579631146567429e-7 3.0351383606886035e-9 " -# "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), -# weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " -# "0.9999999999716082 0.9999909282503908 0.9999999999997268," -# "2.2354258683870077e-9 2.6288602366075745e-11 " -# "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," -# "1.788382117901561e-10 2.1030934718853924e-12 " -# "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), -# consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", -# dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " -# "0.49761166908056337 0.49761166908056337 -2.495196349669178"), -# dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " -# "3.9976117689805504 3.9976117689805504 -22.145196359962693"), -# weno_flux_str=("-4.353710219799678 12.247948547685105 " -# "8.995223438061114 8.995223438061114 -51.390392709631875"), -# direction="z") -# -## }}} -# -## {{{ Input data: Case (c) -# -#single_data["Case c:x"] = FluxDataSingle( -# states_str="2 4 8 12 64,1 1 2 3 11", -# fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", -# lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," -# "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), -# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," -# "1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326," -# "3.1715728752538106 1.4142135623730951 0 1.3125424167614286 " -# "1.3125424167614286," -# "4.757359312880716 0 1.4142135623730951 1.968813625142143 " -# "1.968813625142143," -# "17.60303038033002 4.485281374238571 6.727922061357858 " -# "11.42671019719969 9.184069510080404"), -# R_inv_str=("-1.4118746341171051 0.21727611674823194 0.4345522334964639 " -# "0.6518283502446959 -0.13701474018997217," -# "-2.2426406871192857 0 0.7071067811865475 0 0," -# "-3.3639610306789285 0 0 0.7071067811865475 0," -# "1.7926564050747988 0.4445982978342618 -0.5250169667045714 " -# "-0.7875254500568571 0.16553835820737872," -# "4.035297092194084 -0.9696152645388333 -0.5250169667045714 " -# "-0.7875254500568571 0.16553835820737872"), -# wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", -# char_fluxes_pos_str=("1.1162114029572359 2.4603030380329987 " -# "3.690454557049497 7.986924884679773 0.4290108979594782," -# "0.26073527447612554 -1.3254833995939053 " -# "-1.9882250993908572 2.052422890589809 0.5017887559695788"), -# char_fluxes_neg_str=("-0.1482823715615963 -0.1171572875253809 " -# "-0.1757359312880714 -0.8893252542028551 -0.20004041758408686," -# "-0.009488213714461069 0.49705627484771453 " -# "0.7455844122715716 -0.4306378813126712 -0.31431832174320373"), -# weno_weights_pos_str=("0.999999999319454 0.9999999999982254 " -# "0.9999999999996494 0.9999999999997061 0.9999870425235151," -# "6.301345524776077e-10 1.6430428067143077e-12 " -# "3.245518542322869e-13 2.721049684463335e-13 0.000011996153712066484," -# "5.041138413805998e-11 1.3144350707803127e-13 " -# "2.5964155584975223e-14 2.1768403038595738e-14 9.613227729623656e-7"), -# weno_weights_neg_str=("0.9999990185022956 0.9999999974390363 " -# "0.9999999994941201 0.9999999917661908 0.9999978651320311," -# "9.08762722250494e-7 2.3712585027633853e-9 " -# "4.684070887233427e-10 7.62387333908512e-9 1.976628702372801e-6," -# "7.27349821618269e-8 1.897052057748541e-10 " -# "3.747296441221644e-11 6.099359570650648e-10 1.5823926647977797e-7"), -# consistent_str="2.5 6.9 9. 13.5 73.5", -# dissipation_pos_str=("1.6406634409601506 4.725635754575325 " -# "7.88043892893644 11.820658393408754 68.69422377699841"), -# dissipation_neg_str=("0.14066328824586258 0.4256356884430299 " -# "0.8804384437989111 1.3206576666570364 7.7942206041633595"), -# weno_flux_str=("4.281326729206013 12.051271443018354 " -# "17.76087737273535 26.64131606006579 149.98844438116177"), -# direction="x") -#single_data["Case c:y"] = FluxDataSingle( -# states_str="2 8 12 4 64,1 2 3 1 11", -# fluxes_str="8 35.2 48 16 268.8,2 5.6 6 2 25.2", -# lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," -# "2. 2. 2. 3.4966629547095764 0.5033370452904236"), -# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," -# "3.1715728752538106 0 0 2.019649197947976 0.605435635574881," -# "4.757359312880716 1.4142135623730951 0 1.968813625142143 " -# "1.968813625142143," -# "1.5857864376269053 0 1.4142135623730951 0.6562712083807143 " -# "0.6562712083807143," -# "17.60303038033002 6.727922061357858 2.2426406871192857 " -# "12.548030540759331 8.062749166520762"), -# R_inv_str=("-1.4118746341171051 0.4345522334964639 0.6518283502446959 " -# "0.21727611674823194 -0.13701474018997217," -# "-3.3639610306789285 0 0.7071067811865475 0 0," -# "-1.1213203435596428 0 0 0.7071067811865475 0," -# "0.671336061515156 0.18208981448197611 -0.7875254500568571 " -# "-0.2625084833522857 0.16553835820737872," -# "5.156617435753728 -1.2321237478911191 -0.7875254500568571 " -# "-0.2625084833522857 0.16553835820737872"), -# wavespeeds_str="4.4 4.4 4.4 6.046329250180534 2.753670749819466", -# char_fluxes_pos_str=("2.2324228059144673 7.380909114098994 " -# "2.4603030380329987 15.885347333048884 0.9465242322295992," -# "0.5214705489522515 -3.9764501987817145 " -# "-1.3254833995939053 1.3413036144786457 3.767119678640133"), -# char_fluxes_neg_str=("-0.2965647431231918 -0.3514718625761428 " -# "-0.1171572875253809 -1.6097440213843948 -0.5689873221894901," -# "-0.018976427428922138 1.4911688245431431 " -# "0.49705627484771453 -0.05753157056903602 -1.432380835542713"), -# weno_weights_pos_str=("0.9999999999574652 0.999999999999978 " -# "0.9999999999982254 0.9999999999999919 0.9999999999942413," -# "3.9384014966385437e-11 2.0284497966079935e-14 " -# "1.6430428067143077e-12 7.542808138536806e-15 5.332240836330361e-12," -# "3.1507308840273685e-12 1.622759950511315e-15 " -# "1.3144350707803127e-13 6.034246767570432e-16 4.265797494767529e-13"), -# weno_weights_neg_str=("0.9999999386221037 0.9999999999683822 " -# "0.9999999974390363 0.9999999999372101 0.9999999993440752," -# "5.68308936788955e-8 2.9275831062158654e-11 " -# "2.3712585027633853e-9 5.8138848037057226e-11 6.073372407373299e-10," -# "4.547002513715645e-9 2.3420726930957915e-12 " -# "1.897052057748541e-10 4.6511252168302e-12 4.8587565862160355e-11"), -# consistent_str="5. 20.4 27. 9. 147.", -# dissipation_pos_str=("3.281326602835503 16.54629350160538 " -# "23.641315459112736 7.8804384863675505 137.3884413587739"), -# dissipation_neg_str=("0.2813265968286516 1.7462934823903076 " -# "2.641315430506613 0.8804384760489334 15.588441251607525"), -# weno_flux_str=("8.562653199664155 38.69258698399568 " -# "53.28263088961935 17.760876962416482 299.9768826103814"), -# direction="y") -#single_data["Case c:z"] = FluxDataSingle( -# states_str="2 12 4 8 64,1 3 1 2 11", -# fluxes_str="12 75.2 24 48 403.2,3 10.6 3 6 37.8", -# lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," -# "3. 3. 3. 4.496662954709576 1.5033370452904236"), -# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," -# "4.757359312880716 0 0 2.6759204063286903 1.2617068439555954," -# "1.5857864376269053 1.4142135623730951 0 0.6562712083807143 " -# "0.6562712083807143," -# "3.1715728752538106 0 1.4142135623730951 1.3125424167614286 " -# "1.3125424167614286," -# "17.60303038033002 2.2426406871192857 4.485281374238571 " -# "13.669350884318975 6.941428822961119"), -# R_inv_str=("-1.4118746341171051 0.6518283502446959 " -# "0.21727611674823194 0.4345522334964639 -0.13701474018997217," -# "-1.1213203435596428 0 0.7071067811865475 0 0," -# "-2.2426406871192857 0 0 0.7071067811865475 0," -# "-0.4499842820444868 -0.08041866887030964 -0.2625084833522857 " -# "-0.5250169667045714 0.16553835820737872," -# "6.27793777931337 -1.4946322312434048 -0.2625084833522857 " -# "-0.5250169667045714 0.16553835820737872"), -# wavespeeds_str="6.6 6.6 6.6 8.246329250180533 4.953670749819467", -# char_fluxes_pos_str=("3.348634208871708 3.690454557049497 " -# "7.380909114098994 26.24407281945101 -0.9962654715332988," -# "0.7822058234283737 -1.9882250993908581 " -# "-3.9764501987817162 -0.6952990612264269 8.357934000904585"), -# char_fluxes_neg_str=("-0.44484711468478866 -0.1757359312880714 " -# "-0.3514718625761428 -2.447320076091316 -0.8207769392695052," -# "-0.02846464114338254 0.7455844122715716 " -# "1.4911688245431431 0.8126310150223119 -3.0474996241899346"), -# weno_weights_pos_str=("0.999999999991598 0.9999999999996494 " -# "0.999999999999978 0.9999999999999993 0.9999999999999524," -# "7.779580658268568e-12 3.2455185423228674e-13 " -# "2.028449796607992e-14 6.408020704124379e-16 4.408056940300416e-14," -# "6.223673030753551e-13 2.596415558497523e-14 " -# "1.6227599505113154e-15 5.126416626873783e-17 3.526445914956101e-15"), -# weno_weights_neg_str=("0.9999999878747177 0.9999999994941201 " -# "0.9999999999683822 0.9999999999967727 0.9999999999851737," -# "1.1227070122726888e-8 4.684070887233427e-10 " -# "2.9275831062158654e-11 2.988331869942141e-12 1.372802081812638e-11," -# "8.982122341016933e-10 3.747296441221644e-11 " -# "2.3420726930957915e-12 2.390667520553204e-13 1.0982436589127136e-12"), -# consistent_str="7.5 42.9 13.5 27. 220.5", -# dissipation_pos_str=("4.921989904281101 36.24738971766925 " -# "11.82065772959958 23.641315459201046 206.08266203865145"), -# dissipation_neg_str=("0.4219899024845117 3.9473897091113366 " -# "1.3206577265155963 2.6413154534736667 23.382662006532225"), -# weno_flux_str=("12.843979806765613 83.09477942678058 " -# "26.641315456115176 53.28263091267471 449.9653240451837"), -# direction="z") -# -## }}} -# -## {{{ Input data: Case (d) -# -#single_data["Case d:x"] = FluxDataSingle( -# states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", -# fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", -# lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," -# "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), -# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," -# "-1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262," -# "-3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 " -# "-1.3125424167614286," -# "-4.757359312880716 0 1.4142135623730951 -1.968813625142143 " -# "-1.968813625142143," -# "17.60303038033002 -4.485281374238571 -6.727922061357858 " -# "9.184069510080404 11.42671019719969"), -# R_inv_str=("-1.4118746341171051 -0.21727611674823194 " -# "-0.4345522334964639 -0.6518283502446959 -0.13701474018997217," -# "2.2426406871192857 0 0.7071067811865475 0 0," -# "3.3639610306789285 0 0 0.7071067811865475 0," -# "4.035297092194084 0.9696152645388333 0.5250169667045714 " -# "0.7875254500568571 0.16553835820737872," -# "1.7926564050747988 -0.4445982978342618 0.5250169667045714 " -# "0.7875254500568571 0.16553835820737872"), -# wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", -# char_fluxes_pos_str=("0.009488213714461069 0.49705627484771453 " -# "0.7455844122715716 0.31431832174320373 0.4306378813126712," -# "0.1482823715615963 -0.1171572875253809 " -# "-0.1757359312880714 0.20004041758408686 0.8893252542028551"), -# char_fluxes_neg_str=("-0.26073527447612554 -1.3254833995939053 " -# "-1.9882250993908572 -0.5017887559695788 -2.052422890589809," -# "-1.1162114029572359 2.4603030380329987 " -# "3.690454557049497 -0.4290108979594782 -7.986924884679773"), -# weno_weights_pos_str=("0.9999990185022956 0.9999999974390363 " -# "0.9999999994941201 0.9999978651320311 0.9999999917661908," -# "9.08762722250494e-7 2.3712585027633853e-9 " -# "4.684070887233427e-10 1.976628702372801e-6 7.62387333908512e-9," -# "7.27349821618269e-8 1.897052057748541e-10 " -# "3.747296441221644e-11 1.5823926647977797e-7 6.099359570650648e-10"), -# weno_weights_neg_str=("0.999999999319454 0.9999999999982254 " -# "0.9999999999996494 0.9999870425235151 0.9999999999997061," -# "6.301345524776077e-10 1.6430428067143077e-12 " -# "3.245518542322869e-13 0.000011996153712066484 2.721049684463335e-13," -# "5.041138413805998e-11 1.3144350707803127e-13 " -# "2.5964155584975223e-14 9.613227729623656e-7 2.1768403038595738e-14"), -# consistent_str="-2.5 6.9 9. 13.5 -73.5", -# dissipation_pos_str=("-0.14066328824586258 0.42563568844302985 " -# "0.8804384437989112 1.3206576666570364 -7.7942206041633595"), -# dissipation_neg_str=("-1.6406634409601506 4.725635754575325 " -# "7.88043892893644 11.820658393408754 -68.69422377699841"), -# weno_flux_str=("-4.281326729206013 12.051271443018354 " -# "17.76087737273535 26.641316060065794 -149.98844438116177"), -# direction="x") -#single_data["Case d:y"] = FluxDataSingle( -# states_str="1 -2 -3 -1 11,2 -8 -12 -4 64", -# fluxes_str="-2 5.6 6 2 -25.2,-8 35.2 48 16 -268.8", -# lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," -# "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), -# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," -# "-3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976," -# "-4.757359312880716 1.4142135623730951 0 -1.968813625142143 " -# "-1.968813625142143," -# "-1.5857864376269053 0 1.4142135623730951 -0.6562712083807143 " -# "-0.6562712083807143," -# "17.60303038033002 -6.727922061357858 -2.2426406871192857 " -# "8.062749166520762 12.548030540759331"), -# R_inv_str=("-1.4118746341171051 -0.4345522334964639 " -# "-0.6518283502446959 -0.21727611674823194 -0.13701474018997217," -# "3.3639610306789285 0 0.7071067811865475 0 0," -# "1.1213203435596428 0 0 0.7071067811865475 0," -# "5.156617435753728 1.2321237478911191 0.7875254500568571 " -# "0.2625084833522857 0.16553835820737872," -# "0.671336061515156 -0.18208981448197611 0.7875254500568571 " -# "0.2625084833522857 0.16553835820737872"), -# wavespeeds_str="4.4 4.4 4.4 2.753670749819466 6.046329250180534", -# char_fluxes_pos_str=("0.018976427428922138 1.4911688245431431 " -# "0.49705627484771453 1.432380835542713 0.05753157056903602," -# "0.2965647431231918 -0.3514718625761428 " -# "-0.1171572875253809 0.5689873221894901 1.6097440213843948"), -# char_fluxes_neg_str=("-0.5214705489522515 -3.9764501987817145 " -# "-1.3254833995939053 -3.767119678640133 -1.3413036144786457," -# "-2.2324228059144673 7.380909114098994 " -# "2.4603030380329987 -0.9465242322295992 -15.885347333048884"), -# weno_weights_pos_str=("0.9999999386221037 0.9999999999683822 " -# "0.9999999974390363 0.9999999993440752 0.9999999999372101," -# "5.68308936788955e-8 2.9275831062158654e-11 " -# "2.3712585027633853e-9 6.073372407373299e-10 5.8138848037057226e-11," -# "4.547002513715645e-9 2.3420726930957915e-12 " -# "1.897052057748541e-10 4.8587565862160355e-11 4.6511252168302e-12"), -# weno_weights_neg_str=("0.9999999999574652 0.999999999999978 " -# "0.9999999999982254 0.9999999999942413 0.9999999999999919," -# "3.9384014966385437e-11 2.0284497966079935e-14 " -# "1.6430428067143077e-12 5.332240836330361e-12 7.542808138536806e-15," -# "3.1507308840273685e-12 1.622759950511315e-15 " -# "1.3144350707803127e-13 4.265797494767529e-13 6.034246767570432e-16"), -# consistent_str="-5. 20.4 27. 9. -147.", -# dissipation_pos_str=("-0.2813265968286516 1.7462934823903074 " -# "2.641315430506612 0.8804384760489334 -15.588441251607525"), -# dissipation_neg_str=("-3.281326602835503 16.54629350160538 " -# "23.641315459112736 7.880438486367551 -137.3884413587739"), -# weno_flux_str=("-8.562653199664155 38.69258698399569 " -# "53.28263088961934 17.760876962416486 -299.97688261038144"), -# direction="y") -#single_data["Case d:z"] = FluxDataSingle( -# states_str="1 -3 -1 -2 11,2 -12 -4 -8 64", -# fluxes_str="-3 10.6 3 6 -37.8,-12 75.2 24 48 -403.2", -# lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," -# "-6. -6. -6. -4.503337045290424 -7.496662954709576"), -# R_str=("1 0 0 0.41384589551844686 0.41384589551844686," -# "-4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903," -# "-1.5857864376269053 1.4142135623730951 0 -0.6562712083807143 " -# "-0.6562712083807143," -# "-3.1715728752538106 0 1.4142135623730951 -1.3125424167614286 " -# "-1.3125424167614286," -# "17.60303038033002 -2.2426406871192857 -4.485281374238571 " -# "6.941428822961119 13.669350884318975"), -# R_inv_str=("-1.4118746341171051 -0.6518283502446959 " -# "-0.21727611674823194 -0.4345522334964639 -0.13701474018997217," -# "1.1213203435596428 0 0.7071067811865475 0 0," -# "2.2426406871192857 0 0 0.7071067811865475 0," -# "6.27793777931337 1.4946322312434048 0.2625084833522857 " -# "0.5250169667045714 0.16553835820737872," -# "-0.4499842820444868 0.08041866887030964 0.2625084833522857 " -# "0.5250169667045714 0.16553835820737872"), -# wavespeeds_str="6.6 6.6 6.6 4.953670749819467 8.246329250180533", -# char_fluxes_pos_str=("0.02846464114338254 0.7455844122715716 " -# "1.4911688245431431 3.0474996241899346 -0.8126310150223119," -# "0.44484711468478866 -0.1757359312880714 " -# "-0.3514718625761428 0.8207769392695052 2.447320076091316"), -# char_fluxes_neg_str=("-0.7822058234283737 -1.9882250993908581 " -# "-3.9764501987817162 -8.357934000904585 0.6952990612264269," -# "-3.348634208871708 3.690454557049497 " -# "7.380909114098994 0.9962654715332988 -26.24407281945101"), -# weno_weights_pos_str=("0.9999999878747177 0.9999999994941201 " -# "0.9999999999683822 0.9999999999851737 0.9999999999967727," -# "1.1227070122726888e-8 4.684070887233427e-10 " -# "2.9275831062158654e-11 1.372802081812638e-11 2.988331869942141e-12," -# "8.982122341016933e-10 3.747296441221644e-11 " -# "2.3420726930957915e-12 1.0982436589127136e-12 2.390667520553204e-13"), -# weno_weights_neg_str=("0.999999999991598 0.9999999999996494 " -# "0.999999999999978 0.9999999999999524 0.9999999999999993," -# "7.779580658268568e-12 3.2455185423228674e-13 " -# "2.028449796607992e-14 4.408056940300416e-14 6.408020704124379e-16," -# "6.223673030753551e-13 2.596415558497523e-14 " -# "1.6227599505113154e-15 3.526445914956101e-15 5.126416626873783e-17"), -# consistent_str="-7.5 42.9 13.5 27. -220.5", -# dissipation_pos_str=("-0.42198990248451174 3.947389709111337 " -# "1.3206577265155963 2.6413154534736667 -23.382662006532225"), -# dissipation_neg_str=("-4.9219899042811 36.247389717669265 " -# "11.820657729599578 23.641315459201046 -206.08266203865145"), -# weno_flux_str=("-12.843979806765612 83.09477942678059 " -# "26.641315456115173 53.28263091267471 -449.9653240451837"), -# direction="z") -# -## }}} -# + +# {{{ Input data: Case (b) + +single_data["Case b:x"] = FluxDataSingle( + states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", + fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "-1.5857864376269053 0 0 -0.018886008110941373 " + "-1.4330995704840366," + "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " + "-0.7259927892974889," + "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " + "-0.7259927892974889," + "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " + "3.335959603054103 5.578600290173388"), + R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " + "-0.265894835574803 -0.16767379847989416," + "1.1213203435596428 0 0.7071067811865475 0 0," + "1.1213203435596428 0 0 0.7071067811865475 0," + "1.8120820550093746 0.9975038969055432 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456," + "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", + char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " + "0.24852813742385726 0.37456222716537935 0.10725061063772967," + "0.16835489671908455 -0.05857864376269045 " + "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), + char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " + "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," + "-1.0907156303492833 1.2301515190164993 " + "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), + oscillation_pos_str=("0. 0. 0. 0. 0.," + "0.01363683818419176 0.12575276673434946 0.12575276673434946 " + "0.006262897975282706 0.5129349293057707," + "0.0340920954604794 0.31438191683587363 0.31438191683587363 " + "0.015657244938206753 1.2823373232644266"), + oscillation_neg_str=("0. 0. 0. 0. 0.," + "0.5180684032155981 4.777392983773268 4.777392983773268 " + "0.00844206573002786 48.69888276854567," + "1.2951710080389953 11.94348245943317 11.94348245943317 " + "0.02110516432506965 121.7472069213642"), + weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999835300215946 0.9999999975371708," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," + "2.579631146567429e-7 3.0351383606886035e-9 " + "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), + weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999909282503908 0.9999999999997268," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," + "1.788382117901561e-10 2.1030934718853924e-12 " + "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), + consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", + dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " + "0.49761166908056337 0.49761166908056337 -2.495196349669178"), + dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " + "3.9976117689805504 3.9976117689805504 -22.145196359962693"), + weno_flux_str=("-4.353710219799678 12.247948547685105 " + "8.995223438061114 8.995223438061114 -51.390392709631875"), + direction="x") +single_data["Case b:y"] = FluxDataSingle( + states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", + fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "-1.5857864376269053 0 0 -0.018886008110941373 " + "-1.4330995704840366," + "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " + "-0.7259927892974889," + "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " + "-0.7259927892974889," + "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " + "3.335959603054103 5.578600290173388"), + R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " + "-0.265894835574803 -0.16767379847989416," + "1.1213203435596428 0 0.7071067811865475 0 0," + "1.1213203435596428 0 0 0.7071067811865475 0," + "1.8120820550093746 0.9975038969055432 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456," + "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", + char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " + "0.24852813742385726 0.37456222716537935 0.10725061063772967," + "0.16835489671908455 -0.05857864376269045 " + "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), + char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " + "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," + "-1.0907156303492833 1.2301515190164993 " + "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), + oscillation_pos_str=("0. 0. 0. 0. 0.," + "0.01363683818419176 0.12575276673434946 0.12575276673434946 " + "0.006262897975282706 0.5129349293057707," + "0.0340920954604794 0.31438191683587363 0.31438191683587363 " + "0.015657244938206753 1.2823373232644266"), + oscillation_neg_str=("0. 0. 0. 0. 0.," + "0.5180684032155981 4.777392983773268 4.777392983773268 " + "0.00844206573002786 48.69888276854567," + "1.2951710080389953 11.94348245943317 11.94348245943317 " + "0.02110516432506965 121.7472069213642"), + weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999835300215946 0.9999999975371708," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," + "2.579631146567429e-7 3.0351383606886035e-9 " + "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), + weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999909282503908 0.9999999999997268," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," + "1.788382117901561e-10 2.1030934718853924e-12 " + "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), + consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", + dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " + "0.49761166908056337 0.49761166908056337 -2.495196349669178"), + dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " + "3.9976117689805504 3.9976117689805504 -22.145196359962693"), + weno_flux_str=("-4.353710219799678 12.247948547685105 " + "8.995223438061114 8.995223438061114 -51.390392709631875"), + direction="y") +single_data["Case b:z"] = FluxDataSingle( + states_str="1 -1 -1 -1 5.5,2 -4 -4 -4 20", + fluxes_str="-1 2.6 1 1 -7.1,-4 11.2 8 8 -46.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str=("1 0 0 0.45781245952886396 0.45781245952886396," + "-1.5857864376269053 0 0 -0.018886008110941373 " + "-1.4330995704840366," + "-1.5857864376269053 1.4142135623730951 0 -0.7259927892974889 " + "-0.7259927892974889," + "-1.5857864376269053 0 1.4142135623730951 -0.7259927892974889 " + "-0.7259927892974889," + "3.7720779386421466 -2.2426406871192857 -2.2426406871192857 " + "3.335959603054103 5.578600290173388"), + R_inv_str=("0.36752136386566203 -0.265894835574803 -0.265894835574803 " + "-0.265894835574803 -0.16767379847989416," + "1.1213203435596428 0 0.7071067811865475 0 0," + "1.1213203435596428 0 0 0.7071067811865475 0," + "1.8120820550093746 0.9975038969055432 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456," + "-0.43055863210991147 -0.41670966546755195 0.2903971157189956 " + "0.2903971157189956 0.1831249838115456"), + wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", + char_fluxes_pos_str=("0.06722315769446469 0.24852813742385726 " + "0.24852813742385726 0.37456222716537935 0.10725061063772967," + "0.16835489671908455 -0.05857864376269045 " + "-0.05857864376269045 0.30602629876675014 0.7274934638648571"), + char_fluxes_neg_str=("-0.4673767959969717 -0.6627416997969526 " + "-0.6627416997969526 -0.3125273038443238 -1.4795302623674356," + "-1.0907156303492833 1.2301515190164993 " + "1.2301515190164993 -0.23295627081394965 -7.523052586013577"), + oscillation_pos_str=("0. 0. 0. 0. 0.," + "0.01363683818419176 0.12575276673434946 0.12575276673434946 " + "0.006262897975282706 0.5129349293057707," + "0.0340920954604794 0.31438191683587363 0.31438191683587363 " + "0.015657244938206753 1.2823373232644266"), + oscillation_neg_str=("0. 0. 0. 0. 0.," + "0.5180684032155981 4.777392983773268 4.777392983773268 " + "0.00844206573002786 48.69888276854567," + "1.2951710080389953 11.94348245943317 11.94348245943317 " + "0.02110516432506965 121.7472069213642"), + weno_weights_pos_str=("0.9999965203327451 0.999999959029252 " + "0.999999959029252 0.9999835300215946 0.9999999975371708," + "3.2217041402391125e-6 3.793560951911702e-8 " + "3.793560951911702e-8 0.000015247816238787948 2.2803933579018906e-9," + "2.579631146567429e-7 3.0351383606886035e-9 " + "3.0351383606886035e-9 1.2221621667041045e-6 1.824357365679662e-10"), + weno_weights_neg_str=("0.999999997585736 0.9999999999716082 " + "0.9999999999716082 0.9999909282503908 0.9999999999997268," + "2.2354258683870077e-9 2.6288602366075745e-11 " + "2.6288602366075745e-11 8.39888391917283e-6 2.5299566294114733e-13," + "1.788382117901561e-10 2.1030934718853924e-12 " + "2.1030934718853924e-12 6.728656898188601e-7 2.0239658022589593e-14"), + consistent_str="-2.5 6.899999999999999 4.5 4.5 -26.75", + dissipation_pos_str=("-0.17685508040141606 0.523974175351619 " + "0.49761166908056337 0.49761166908056337 -2.495196349669178"), + dissipation_neg_str=("-1.6768551393982627 4.823974372333487 " + "3.9976117689805504 3.9976117689805504 -22.145196359962693"), + weno_flux_str=("-4.353710219799678 12.247948547685105 " + "8.995223438061114 8.995223438061114 -51.390392709631875"), + direction="z") + +# }}} + +# {{{ Input data: Case (c) + +single_data["Case c:x"] = FluxDataSingle( + states_str="2 4 8 12 64,1 1 2 3 11", + fluxes_str="4 11.2 16 24 134.4,1 2.6 2 3 12.6", + lam_str=("2. 2. 2. 3.4966629547095764 0.5033370452904236," + "1. 1. 1. 2.4966629547095764 -0.49666295470957644"), + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "1.5857864376269053 0 0 1.363377989567262 -0.05083557280583326," + "3.1715728752538106 1.4142135623730951 0 1.3125424167614286 " + "1.3125424167614286," + "4.757359312880716 0 1.4142135623730951 1.968813625142143 " + "1.968813625142143," + "17.60303038033002 4.485281374238571 6.727922061357858 " + "11.42671019719969 9.184069510080404"), + R_inv_str=("-1.4118746341171051 0.21727611674823194 0.4345522334964639 " + "0.6518283502446959 -0.13701474018997217," + "-2.2426406871192857 0 0.7071067811865475 0 0," + "-3.3639610306789285 0 0 0.7071067811865475 0," + "1.7926564050747988 0.4445982978342618 -0.5250169667045714 " + "-0.7875254500568571 0.16553835820737872," + "4.035297092194084 -0.9696152645388333 -0.5250169667045714 " + "-0.7875254500568571 0.16553835820737872"), + wavespeeds_str="2.2 2.2 2.2 3.8463292501805344 0.553670749819466", + char_fluxes_pos_str=("1.1162114029572359 2.4603030380329987 " + "3.690454557049497 7.986924884679773 0.4290108979594782," + "0.26073527447612554 -1.3254833995939053 " + "-1.9882250993908572 2.052422890589809 0.5017887559695788"), + char_fluxes_neg_str=("-0.1482823715615963 -0.1171572875253809 " + "-0.1757359312880714 -0.8893252542028551 -0.20004041758408686," + "-0.009488213714461069 0.49705627484771453 " + "0.7455844122715716 -0.4306378813126712 -0.31431832174320373"), + oscillation_pos_str=("0. 0. 0. 0. 0.,0.9757858752013722 " + "19.109571935093072 42.996536853959384 46.95775189047701 " + "0.007062155488717821,2.4394646880034303 47.77392983773268 " + "107.49134213489849 117.39437972619254 0.017655388721794552"), + oscillation_neg_str=("0. 0. 0. 0. 0.,0.025685091003327314 " + "0.5030110669373978 1.1317749006091449 0.28052547473186484 " + "0.017412585838667068,0.06421272750831829 1.2575276673434945 " + "2.8294372515228616 0.7013136868296621 0.04353146459666767"), + weno_weights_pos_str=("0.999999999319454 0.9999999999982254 " + "0.9999999999996494 0.9999999999997061 0.9999870425235151," + "6.301345524776077e-10 1.6430428067143077e-12 " + "3.245518542322869e-13 2.721049684463335e-13 0.000011996153712066484," + "5.041138413805998e-11 1.3144350707803127e-13 " + "2.5964155584975223e-14 2.1768403038595738e-14 9.613227729623656e-7"), + weno_weights_neg_str=("0.9999990185022956 0.9999999974390363 " + "0.9999999994941201 0.9999999917661908 0.9999978651320311," + "9.08762722250494e-7 2.3712585027633853e-9 " + "4.684070887233427e-10 7.62387333908512e-9 1.976628702372801e-6," + "7.27349821618269e-8 1.897052057748541e-10 " + "3.747296441221644e-11 6.099359570650648e-10 1.5823926647977797e-7"), + consistent_str="2.5 6.9 9. 13.5 73.5", + dissipation_pos_str=("1.6406634409601506 4.725635754575325 " + "7.88043892893644 11.820658393408754 68.69422377699841"), + dissipation_neg_str=("0.14066328824586258 0.4256356884430299 " + "0.8804384437989111 1.3206576666570364 7.7942206041633595"), + weno_flux_str=("4.281326729206013 12.051271443018354 " + "17.76087737273535 26.64131606006579 149.98844438116177"), + direction="x") +single_data["Case c:y"] = FluxDataSingle( + states_str="2 8 12 4 64,1 2 3 1 11", + fluxes_str="8 35.2 48 16 268.8,2 5.6 6 2 25.2", + lam_str=("4. 4. 4. 5.496662954709576 2.5033370452904236," + "2. 2. 2. 3.4966629547095764 0.5033370452904236"), + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "3.1715728752538106 0 0 2.019649197947976 0.605435635574881," + "4.757359312880716 1.4142135623730951 0 1.968813625142143 " + "1.968813625142143," + "1.5857864376269053 0 1.4142135623730951 0.6562712083807143 " + "0.6562712083807143," + "17.60303038033002 6.727922061357858 2.2426406871192857 " + "12.548030540759331 8.062749166520762"), + R_inv_str=("-1.4118746341171051 0.4345522334964639 0.6518283502446959 " + "0.21727611674823194 -0.13701474018997217," + "-3.3639610306789285 0 0.7071067811865475 0 0," + "-1.1213203435596428 0 0 0.7071067811865475 0," + "0.671336061515156 0.18208981448197611 -0.7875254500568571 " + "-0.2625084833522857 0.16553835820737872," + "5.156617435753728 -1.2321237478911191 -0.7875254500568571 " + "-0.2625084833522857 0.16553835820737872"), + wavespeeds_str="4.4 4.4 4.4 6.046329250180534 2.753670749819466", + char_fluxes_pos_str=("2.2324228059144673 7.380909114098994 " + "2.4603030380329987 15.885347333048884 0.9465242322295992," + "0.5214705489522515 -3.9764501987817145 " + "-1.3254833995939053 1.3413036144786457 3.767119678640133"), + char_fluxes_neg_str=("-0.2965647431231918 -0.3514718625761428 " + "-0.1171572875253809 -1.6097440213843948 -0.5689873221894901," + "-0.018976427428922138 1.4911688245431431 " + "0.49705627484771453 -0.05753157056903602 -1.432380835542713"), + oscillation_pos_str=("0. 0. 0. 0. 0.,3.9031435008054665 " + "171.98614741583754 19.109571935093072 282.0389435835765 " + "10.607678229749117,9.757858752013666 429.96536853959395 " + "47.77392983773268 705.0973589589414 26.519195574372795"), + oscillation_neg_str=("0. 0. 0. 0. 0.,0.10274036401330869 " + "4.5270996024365795 0.5030110669373978 3.21248465662163 " + "0.9939311452005626,0.25685091003327176 11.317749006091447 " + "1.2575276673434945 8.031211641554076 2.484827863001407"), + weno_weights_pos_str=("0.9999999999574652 0.999999999999978 " + "0.9999999999982254 0.9999999999999919 0.9999999999942413," + "3.9384014966385437e-11 2.0284497966079935e-14 " + "1.6430428067143077e-12 7.542808138536806e-15 5.332240836330361e-12," + "3.1507308840273685e-12 1.622759950511315e-15 " + "1.3144350707803127e-13 6.034246767570432e-16 4.265797494767529e-13"), + weno_weights_neg_str=("0.9999999386221037 0.9999999999683822 " + "0.9999999974390363 0.9999999999372101 0.9999999993440752," + "5.68308936788955e-8 2.9275831062158654e-11 " + "2.3712585027633853e-9 5.8138848037057226e-11 6.073372407373299e-10," + "4.547002513715645e-9 2.3420726930957915e-12 " + "1.897052057748541e-10 4.6511252168302e-12 4.8587565862160355e-11"), + consistent_str="5. 20.4 27. 9. 147.", + dissipation_pos_str=("3.281326602835503 16.54629350160538 " + "23.641315459112736 7.8804384863675505 137.3884413587739"), + dissipation_neg_str=("0.2813265968286516 1.7462934823903076 " + "2.641315430506613 0.8804384760489334 15.588441251607525"), + weno_flux_str=("8.562653199664155 38.69258698399568 " + "53.28263088961935 17.760876962416482 299.9768826103814"), + direction="y") +single_data["Case c:z"] = FluxDataSingle( + states_str="2 12 4 8 64,1 3 1 2 11", + fluxes_str="12 75.2 24 48 403.2,3 10.6 3 6 37.8", + lam_str=("6. 6. 6. 7.496662954709576 4.503337045290424," + "3. 3. 3. 4.496662954709576 1.5033370452904236"), + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "4.757359312880716 0 0 2.6759204063286903 1.2617068439555954," + "1.5857864376269053 1.4142135623730951 0 0.6562712083807143 " + "0.6562712083807143," + "3.1715728752538106 0 1.4142135623730951 1.3125424167614286 " + "1.3125424167614286," + "17.60303038033002 2.2426406871192857 4.485281374238571 " + "13.669350884318975 6.941428822961119"), + R_inv_str=("-1.4118746341171051 0.6518283502446959 " + "0.21727611674823194 0.4345522334964639 -0.13701474018997217," + "-1.1213203435596428 0 0.7071067811865475 0 0," + "-2.2426406871192857 0 0 0.7071067811865475 0," + "-0.4499842820444868 -0.08041866887030964 -0.2625084833522857 " + "-0.5250169667045714 0.16553835820737872," + "6.27793777931337 -1.4946322312434048 -0.2625084833522857 " + "-0.5250169667045714 0.16553835820737872"), + wavespeeds_str="6.6 6.6 6.6 8.246329250180533 4.953670749819467", + char_fluxes_pos_str=("3.348634208871708 3.690454557049497 " + "7.380909114098994 26.24407281945101 -0.9962654715332988," + "0.7822058234283737 -1.9882250993908581 " + "-3.9764501987817162 -0.6952990612264269 8.357934000904585"), + char_fluxes_neg_str=("-0.44484711468478866 -0.1757359312880714 " + "-0.3514718625761428 -2.447320076091316 -0.8207769392695052," + "-0.02846464114338254 0.7455844122715716 " + "1.4911688245431431 0.8126310150223119 -3.0474996241899346"), + oscillation_pos_str=("0. 0. 0. 0. 0.,8.782072876812371 " + "42.9965368539594 171.9861474158376 967.6396764339121 " + "116.6680636935429,21.955182192030932 107.49134213489847 " + "429.9653685395939 2419.099191084781 291.67015923385725"), + oscillation_neg_str=("0. 0. 0. 0. 0.,0.23116581902994632 " + "1.1317749006091449 4.5270996024365795 14.169708155270577 " + "6.6110585540523275,0.5779145475748658 2.8294372515228616 " + "11.317749006091447 35.42427038817644 16.527646385130815"), + weno_weights_pos_str=("0.999999999991598 0.9999999999996494 " + "0.999999999999978 0.9999999999999993 0.9999999999999524," + "7.779580658268568e-12 3.2455185423228674e-13 " + "2.028449796607992e-14 6.408020704124379e-16 4.408056940300416e-14," + "6.223673030753551e-13 2.596415558497523e-14 " + "1.6227599505113154e-15 5.126416626873783e-17 3.526445914956101e-15"), + weno_weights_neg_str=("0.9999999878747177 0.9999999994941201 " + "0.9999999999683822 0.9999999999967727 0.9999999999851737," + "1.1227070122726888e-8 4.684070887233427e-10 " + "2.9275831062158654e-11 2.988331869942141e-12 1.372802081812638e-11," + "8.982122341016933e-10 3.747296441221644e-11 " + "2.3420726930957915e-12 2.390667520553204e-13 1.0982436589127136e-12"), + consistent_str="7.5 42.9 13.5 27. 220.5", + dissipation_pos_str=("4.921989904281101 36.24738971766925 " + "11.82065772959958 23.641315459201046 206.08266203865145"), + dissipation_neg_str=("0.4219899024845117 3.9473897091113366 " + "1.3206577265155963 2.6413154534736667 23.382662006532225"), + weno_flux_str=("12.843979806765613 83.09477942678058 " + "26.641315456115176 53.28263091267471 449.9653240451837"), + direction="z") + +# }}} + +# {{{ Input data: Case (d) + +single_data["Case d:x"] = FluxDataSingle( + states_str="1 -1 -2 -3 11,2 -4 -8 -12 64", + fluxes_str="-1 2.6 2 3 -12.6,-4 11.2 16 24 -134.4", + lam_str=("-1. -1. -1. 0.49666295470957644 -2.4966629547095764," + "-2. -2. -2. -0.5033370452904236 -3.4966629547095764"), + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "-1.5857864376269053 0 0 0.05083557280583326 -1.363377989567262," + "-3.1715728752538106 1.4142135623730951 0 -1.3125424167614286 " + "-1.3125424167614286," + "-4.757359312880716 0 1.4142135623730951 -1.968813625142143 " + "-1.968813625142143," + "17.60303038033002 -4.485281374238571 -6.727922061357858 " + "9.184069510080404 11.42671019719969"), + R_inv_str=("-1.4118746341171051 -0.21727611674823194 " + "-0.4345522334964639 -0.6518283502446959 -0.13701474018997217," + "2.2426406871192857 0 0.7071067811865475 0 0," + "3.3639610306789285 0 0 0.7071067811865475 0," + "4.035297092194084 0.9696152645388333 0.5250169667045714 " + "0.7875254500568571 0.16553835820737872," + "1.7926564050747988 -0.4445982978342618 0.5250169667045714 " + "0.7875254500568571 0.16553835820737872"), + wavespeeds_str="2.2 2.2 2.2 0.553670749819466 3.8463292501805344", + char_fluxes_pos_str=("0.009488213714461069 0.49705627484771453 " + "0.7455844122715716 0.31431832174320373 0.4306378813126712," + "0.1482823715615963 -0.1171572875253809 " + "-0.1757359312880714 0.20004041758408686 0.8893252542028551"), + char_fluxes_neg_str=("-0.26073527447612554 -1.3254833995939053 " + "-1.9882250993908572 -0.5017887559695788 -2.052422890589809," + "-1.1162114029572359 2.4603030380329987 " + "3.690454557049497 -0.4290108979594782 -7.986924884679773"), + oscillation_pos_str=("0. 0. 0. 0. 0.,0.025685091003327314 " + "0.5030110669373978 1.1317749006091449 0.017412585838667068 " + "0.28052547473186484,0.06421272750831829 1.2575276673434945 " + "2.8294372515228616 0.04353146459666767 0.7013136868296621"), + oscillation_neg_str=("0. 0. 0. 0. 0.,0.9757858752013722 " + "19.109571935093072 42.996536853959384 0.007062155488717821 " + "46.95775189047701,2.4394646880034303 47.77392983773268 " + "107.49134213489849 0.017655388721794552 117.39437972619254"), + weno_weights_pos_str=("0.9999990185022956 0.9999999974390363 " + "0.9999999994941201 0.9999978651320311 0.9999999917661908," + "9.08762722250494e-7 2.3712585027633853e-9 " + "4.684070887233427e-10 1.976628702372801e-6 7.62387333908512e-9," + "7.27349821618269e-8 1.897052057748541e-10 " + "3.747296441221644e-11 1.5823926647977797e-7 6.099359570650648e-10"), + weno_weights_neg_str=("0.999999999319454 0.9999999999982254 " + "0.9999999999996494 0.9999870425235151 0.9999999999997061," + "6.301345524776077e-10 1.6430428067143077e-12 " + "3.245518542322869e-13 0.000011996153712066484 2.721049684463335e-13," + "5.041138413805998e-11 1.3144350707803127e-13 " + "2.5964155584975223e-14 9.613227729623656e-7 2.1768403038595738e-14"), + consistent_str="-2.5 6.9 9. 13.5 -73.5", + dissipation_pos_str=("-0.14066328824586258 0.42563568844302985 " + "0.8804384437989112 1.3206576666570364 -7.7942206041633595"), + dissipation_neg_str=("-1.6406634409601506 4.725635754575325 " + "7.88043892893644 11.820658393408754 -68.69422377699841"), + weno_flux_str=("-4.281326729206013 12.051271443018354 " + "17.76087737273535 26.641316060065794 -149.98844438116177"), + direction="x") +single_data["Case d:y"] = FluxDataSingle( + states_str="1 -2 -3 -1 11,2 -8 -12 -4 64", + fluxes_str="-2 5.6 6 2 -25.2,-8 35.2 48 16 -268.8", + lam_str=("-2. -2. -2. -0.5033370452904236 -3.4966629547095764," + "-4. -4. -4. -2.5033370452904236 -5.496662954709576"), + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "-3.1715728752538106 0 0 -0.605435635574881 -2.019649197947976," + "-4.757359312880716 1.4142135623730951 0 -1.968813625142143 " + "-1.968813625142143," + "-1.5857864376269053 0 1.4142135623730951 -0.6562712083807143 " + "-0.6562712083807143," + "17.60303038033002 -6.727922061357858 -2.2426406871192857 " + "8.062749166520762 12.548030540759331"), + R_inv_str=("-1.4118746341171051 -0.4345522334964639 " + "-0.6518283502446959 -0.21727611674823194 -0.13701474018997217," + "3.3639610306789285 0 0.7071067811865475 0 0," + "1.1213203435596428 0 0 0.7071067811865475 0," + "5.156617435753728 1.2321237478911191 0.7875254500568571 " + "0.2625084833522857 0.16553835820737872," + "0.671336061515156 -0.18208981448197611 0.7875254500568571 " + "0.2625084833522857 0.16553835820737872"), + wavespeeds_str="4.4 4.4 4.4 2.753670749819466 6.046329250180534", + char_fluxes_pos_str=("0.018976427428922138 1.4911688245431431 " + "0.49705627484771453 1.432380835542713 0.05753157056903602," + "0.2965647431231918 -0.3514718625761428 " + "-0.1171572875253809 0.5689873221894901 1.6097440213843948"), + char_fluxes_neg_str=("-0.5214705489522515 -3.9764501987817145 " + "-1.3254833995939053 -3.767119678640133 -1.3413036144786457," + "-2.2324228059144673 7.380909114098994 " + "2.4603030380329987 -0.9465242322295992 -15.885347333048884"), + oscillation_pos_str=("0. 0. 0. 0. 0.,0.10274036401330869 " + "4.5270996024365795 0.5030110669373978 0.9939311452005626 " + "3.21248465662163,0.25685091003327176 11.317749006091447 " + "1.2575276673434945 2.484827863001407 8.031211641554076"), + oscillation_neg_str=("0. 0. 0. 0. 0.,3.9031435008054665 " + "171.98614741583754 19.109571935093072 10.607678229749117 " + "282.0389435835765,9.757858752013666 429.96536853959395 " + "47.77392983773268 26.519195574372795 705.0973589589414"), + weno_weights_pos_str=("0.9999999386221037 0.9999999999683822 " + "0.9999999974390363 0.9999999993440752 0.9999999999372101," + "5.68308936788955e-8 2.9275831062158654e-11 " + "2.3712585027633853e-9 6.073372407373299e-10 5.8138848037057226e-11," + "4.547002513715645e-9 2.3420726930957915e-12 " + "1.897052057748541e-10 4.8587565862160355e-11 4.6511252168302e-12"), + weno_weights_neg_str=("0.9999999999574652 0.999999999999978 " + "0.9999999999982254 0.9999999999942413 0.9999999999999919," + "3.9384014966385437e-11 2.0284497966079935e-14 " + "1.6430428067143077e-12 5.332240836330361e-12 7.542808138536806e-15," + "3.1507308840273685e-12 1.622759950511315e-15 " + "1.3144350707803127e-13 4.265797494767529e-13 6.034246767570432e-16"), + consistent_str="-5. 20.4 27. 9. -147.", + dissipation_pos_str=("-0.2813265968286516 1.7462934823903074 " + "2.641315430506612 0.8804384760489334 -15.588441251607525"), + dissipation_neg_str=("-3.281326602835503 16.54629350160538 " + "23.641315459112736 7.880438486367551 -137.3884413587739"), + weno_flux_str=("-8.562653199664155 38.69258698399569 " + "53.28263088961934 17.760876962416486 -299.97688261038144"), + direction="y") +single_data["Case d:z"] = FluxDataSingle( + states_str="1 -3 -1 -2 11,2 -12 -4 -8 64", + fluxes_str="-3 10.6 3 6 -37.8,-12 75.2 24 48 -403.2", + lam_str=("-3. -3. -3. -1.5033370452904236 -4.496662954709576," + "-6. -6. -6. -4.503337045290424 -7.496662954709576"), + R_str=("1 0 0 0.41384589551844686 0.41384589551844686," + "-4.757359312880716 0 0 -1.2617068439555954 -2.6759204063286903," + "-1.5857864376269053 1.4142135623730951 0 -0.6562712083807143 " + "-0.6562712083807143," + "-3.1715728752538106 0 1.4142135623730951 -1.3125424167614286 " + "-1.3125424167614286," + "17.60303038033002 -2.2426406871192857 -4.485281374238571 " + "6.941428822961119 13.669350884318975"), + R_inv_str=("-1.4118746341171051 -0.6518283502446959 " + "-0.21727611674823194 -0.4345522334964639 -0.13701474018997217," + "1.1213203435596428 0 0.7071067811865475 0 0," + "2.2426406871192857 0 0 0.7071067811865475 0," + "6.27793777931337 1.4946322312434048 0.2625084833522857 " + "0.5250169667045714 0.16553835820737872," + "-0.4499842820444868 0.08041866887030964 0.2625084833522857 " + "0.5250169667045714 0.16553835820737872"), + wavespeeds_str="6.6 6.6 6.6 4.953670749819467 8.246329250180533", + char_fluxes_pos_str=("0.02846464114338254 0.7455844122715716 " + "1.4911688245431431 3.0474996241899346 -0.8126310150223119," + "0.44484711468478866 -0.1757359312880714 " + "-0.3514718625761428 0.8207769392695052 2.447320076091316"), + char_fluxes_neg_str=("-0.7822058234283737 -1.9882250993908581 " + "-3.9764501987817162 -8.357934000904585 0.6952990612264269," + "-3.348634208871708 3.690454557049497 " + "7.380909114098994 0.9962654715332988 -26.24407281945101"), + oscillation_pos_str=("0. 0. 0. 0. 0.,0.23116581902994632 " + "1.1317749006091449 4.5270996024365795 6.6110585540523275 " + "14.169708155270577,0.5779145475748658 2.8294372515228616 " + "11.317749006091447 16.527646385130815 35.42427038817644"), + oscillation_neg_str=("0. 0. 0. 0. 0.,8.782072876812371 " + "42.9965368539594 171.9861474158376 116.6680636935429 " + "967.6396764339121,21.955182192030932 107.49134213489847 " + "429.9653685395939 291.67015923385725 2419.099191084781"), + weno_weights_pos_str=("0.9999999878747177 0.9999999994941201 " + "0.9999999999683822 0.9999999999851737 0.9999999999967727," + "1.1227070122726888e-8 4.684070887233427e-10 " + "2.9275831062158654e-11 1.372802081812638e-11 2.988331869942141e-12," + "8.982122341016933e-10 3.747296441221644e-11 " + "2.3420726930957915e-12 1.0982436589127136e-12 2.390667520553204e-13"), + weno_weights_neg_str=("0.999999999991598 0.9999999999996494 " + "0.999999999999978 0.9999999999999524 0.9999999999999993," + "7.779580658268568e-12 3.2455185423228674e-13 " + "2.028449796607992e-14 4.408056940300416e-14 6.408020704124379e-16," + "6.223673030753551e-13 2.596415558497523e-14 " + "1.6227599505113154e-15 3.526445914956101e-15 5.126416626873783e-17"), + consistent_str="-7.5 42.9 13.5 27. -220.5", + dissipation_pos_str=("-0.42198990248451174 3.947389709111337 " + "1.3206577265155963 2.6413154534736667 -23.382662006532225"), + dissipation_neg_str=("-4.9219899042811 36.247389717669265 " + "11.820657729599578 23.641315459201046 -206.08266203865145"), + weno_flux_str=("-12.843979806765612 83.09477942678059 " + "26.641315456115173 53.28263091267471 -449.9653240451837"), + direction="z") + +# }}} + @pytest.fixture(scope="session", params=[ - #"Case flat:x", "Case flat:y", "Case flat:z", - "Case a:x"])#, "Case a:y", "Case a:z", - #"Case b:x", "Case b:y", "Case b:z", - #"Case c:x", "Case c:y", "Case c:z", - #"Case d:x", "Case d:y", "Case d:z"]) + "Case flat:x", "Case flat:y", "Case flat:z", + "Case a:x", "Case a:y", "Case a:z", + "Case b:x", "Case b:y", "Case b:z", + "Case c:x", "Case c:y", "Case c:z", + "Case d:x", "Case d:y", "Case d:z"]) def flux_test_data_fixture(request): return single_data[request.param] -- GitLab From 03b666999bc44dfcbe7118b9dcd3d5199c6cd347 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Thu, 22 Aug 2019 21:04:10 -0500 Subject: [PATCH 55/60] testing alternate approach to computing oscillation indicators --- WENO.F90 | 62 ++++++++++++++++++++++++++++++++++++------------ data_for_test.py | 10 ++++---- 2 files changed, 52 insertions(+), 20 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index 6f1a237..c07cf33 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -769,27 +769,44 @@ subroutine oscillation_pos(nvars, characteristic_fluxes, oscillation) real*8, intent(in) :: characteristic_fluxes(nvars, -2:3) real*8, intent(out) :: oscillation(nvars, 3) - real*8 :: weights1(0:2) = (/1.0d0, -4.0d0, 3.0d0/) - real*8 :: weights2(0:2) = (/-1.0d0, 0.0d0, 1.0d0/) - real*8 :: weights3(0:2) = (/-3.0d0, 4.0d0, -1.0d0/) - real*8 :: weightsc(0:2) = (/1.0d0, -2.0d0, 1.0d0/) + real*8 :: weights1(0:2) = (/ 1.0d0, -4.0d0, 3.0d0/) + real*8 :: weights2(0:2) = (/-1.0d0, 0.0d0, 1.0d0/) + real*8 :: weights3(0:2) = (/-3.0d0, 4.0d0, -1.0d0/) + real*8 :: weightsc(0:2) = (/ 1.0d0, -2.0d0, 1.0d0/) real*8 w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) integer i + integer j do i=1,nvars - w1sum(1) = characteristic_fluxes(i,-2) - 4*characteristic_fluxes(i,-1) & - + 3*characteristic_fluxes(i,0) - w2sum(1) = -characteristic_fluxes(i,-1) + characteristic_fluxes(i,1) - w3sum(1) = -3*characteristic_fluxes(i,0) + 4*characteristic_fluxes(i,1) & - - characteristic_fluxes(i,2) - c1sum(1) = characteristic_fluxes(i,-2) & - - 2*characteristic_fluxes(i,-1) + characteristic_fluxes(i,0) - c2sum(1) = characteristic_fluxes(i,-1) & - - 2*characteristic_fluxes(i,0) + characteristic_fluxes(i,1) - c3sum(1) = characteristic_fluxes(i,0) & - - 2*characteristic_fluxes(i,1) + characteristic_fluxes(i,2) + w1sum(1) = 0.0d0 + do j=0,2 + w1sum(1) = w1sum(1) + weights1(j)*characteristic_fluxes(i,j-2) + end do + w2sum(1) = 0.0d0 + do j=0,2 + w2sum(1) = w2sum(1) + weights2(j)*characteristic_fluxes(i,j-1) + end do + !w3sum(1) = 0.0d0 + !do j=0,2 + ! w3sum(1) = w3sum(1) + weights3(j)*characteristic_fluxes(i,j) + !end do + !call weighted_sum_pos(3, weights3, characteristic_fluxes(i,0:2), w3sum) + call weighted_sum_pos(3, weights3, characteristic_fluxes(i,:), w3sum) + + c1sum(1) = 0.0d0 + do j=0,2 + c1sum(1) = c1sum(1) + weightsc(j)*characteristic_fluxes(i,j-2) + end do + c2sum(1) = 0.0d0 + do j=0,2 + c2sum(1) = c2sum(1) + weightsc(j)*characteristic_fluxes(i,j-1) + end do + c3sum(1) = 0.0d0 + do j=0,2 + c3sum(1) = c3sum(1) + weightsc(j)*characteristic_fluxes(i,j) + end do !call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) !call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) @@ -804,6 +821,21 @@ subroutine oscillation_pos(nvars, characteristic_fluxes, oscillation) end do end subroutine +subroutine weighted_sum_pos(n, w, a, a_sum) + integer, intent(in) :: n + real*8, intent(in) :: w(0:2) + !real*8, intent(in) :: a(0:2) + real*8, intent(in) :: a(-2:3) + real*8, intent(out) :: a_sum(1) + + integer j + + a_sum(1) = 0.0d0 + do j=0,2 + a_sum(1) = a_sum(1) + w(j)*a(j) + end do +end subroutine + subroutine flux_differences_pos(nvars, characteristic_fluxes, flux_differences) implicit none diff --git a/data_for_test.py b/data_for_test.py index bde2cd9..13232d3 100644 --- a/data_for_test.py +++ b/data_for_test.py @@ -926,11 +926,11 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - "Case flat:x", "Case flat:y", "Case flat:z", - "Case a:x", "Case a:y", "Case a:z", - "Case b:x", "Case b:y", "Case b:z", - "Case c:x", "Case c:y", "Case c:z", - "Case d:x", "Case d:y", "Case d:z"]) + #"Case flat:x", "Case flat:y", "Case flat:z", + "Case a:x"])#, "Case a:y", "Case a:z", + #"Case b:x", "Case b:y", "Case b:z", + #"Case c:x", "Case c:y", "Case c:z", + #"Case d:x", "Case d:y", "Case d:z"]) def flux_test_data_fixture(request): return single_data[request.param] -- GitLab From 814d78dee60f9abb52341e8e33fd1a212cccf734 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Fri, 23 Aug 2019 11:01:14 -0500 Subject: [PATCH 56/60] reset tests back to single precision tolerances --- data_for_test.py | 10 +++++----- test.py | 11 ----------- utilities.py | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/data_for_test.py b/data_for_test.py index 13232d3..bde2cd9 100644 --- a/data_for_test.py +++ b/data_for_test.py @@ -926,11 +926,11 @@ single_data["Case d:z"] = FluxDataSingle( @pytest.fixture(scope="session", params=[ - #"Case flat:x", "Case flat:y", "Case flat:z", - "Case a:x"])#, "Case a:y", "Case a:z", - #"Case b:x", "Case b:y", "Case b:z", - #"Case c:x", "Case c:y", "Case c:z", - #"Case d:x", "Case d:y", "Case d:z"]) + "Case flat:x", "Case flat:y", "Case flat:z", + "Case a:x", "Case a:y", "Case a:z", + "Case b:x", "Case b:y", "Case b:z", + "Case c:x", "Case c:y", "Case c:z", + "Case d:x", "Case d:y", "Case d:z"]) def flux_test_data_fixture(request): return single_data[request.param] diff --git a/test.py b/test.py index 3fdbf1b..ed0a436 100644 --- a/test.py +++ b/test.py @@ -18,7 +18,6 @@ import utilities as u from data_for_test import flux_test_data_fixture # noqa: F401 -@pytest.mark.slow def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -38,7 +37,6 @@ def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(flux_dev.get(), data.weno_flux) -@pytest.mark.slow def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -54,7 +52,6 @@ def test_consistent_part_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(consistent_dev.get(), data.consistent) -@pytest.mark.slow def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -72,7 +69,6 @@ def test_dissipation_part_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_pos) -@pytest.mark.slow def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -90,7 +86,6 @@ def test_dissipation_part_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(dissipation_dev.get(), data.dissipation_neg) -@pytest.mark.slow def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -110,7 +105,6 @@ def test_weno_weights_pos_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(weights_dev.get(), data.weno_weights_pos) -@pytest.mark.slow def test_weno_weights_neg_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -160,7 +154,6 @@ def test_oscillation_neg_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(oscillation_dev.get(), data.oscillation_neg) -@pytest.mark.slow def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -182,7 +175,6 @@ def test_flux_splitting_uniform_grid(ctx_factory, flux_test_data_fixture): u.compare_arrays(fluxes_neg_dev.get(), data.char_fluxes_neg) -@pytest.mark.slow def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -197,7 +189,6 @@ def test_pointwise_eigenvalues_ideal_gas(ctx_factory, flux_test_data_fixture): u.compare_arrays(lam_dev.get(), data.lam_pointwise) -@pytest.mark.slow def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): data = flux_test_data_fixture @@ -237,7 +228,6 @@ def test_roe_uniform_grid_ideal_gas(ctx_factory, flux_test_data_fixture): check_roe_property(data.state_pair, data.flux_pair, R, R_inv, lam) -@pytest.mark.slow @pytest.mark.parametrize("lam_pointwise_str,lam_roe_str,lam_expected_str", [ ("1 2 3 4 5,2 4 6 8 10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), ("1 2 3 4 5,-2 -4 -6 -8 -10", "1.5 3 4.5 6 7.5", "2.2 4.4 6.6 8.8 11"), @@ -263,7 +253,6 @@ def test_lax_wavespeeds( u.compare_arrays(lam_dev.get(), lam_expected) -@pytest.mark.slow def test_matvec(ctx_factory): prg = u.get_weno_program_with_root_kernel("mult_mat_vec") queue = u.get_queue(ctx_factory) diff --git a/utilities.py b/utilities.py index d47c2f1..ed73212 100644 --- a/utilities.py +++ b/utilities.py @@ -11,7 +11,7 @@ from pytest import approx # {{{ arrays def compare_arrays(a, b): - assert a == approx(b, rel=1e-12, abs=1e-14) + assert a == approx(b, rel=1e-5, abs=2e-5) def random_array_on_device(queue, *shape): -- GitLab From 6aefa4e318e68558480bad52368745ca07790ed4 Mon Sep 17 00:00:00 2001 From: "Timothy A. Smith" Date: Fri, 23 Aug 2019 11:08:44 -0500 Subject: [PATCH 57/60] add a blank line to make flake8 happy --- utilities.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities.py b/utilities.py index ed73212..c8bde8a 100644 --- a/utilities.py +++ b/utilities.py @@ -73,6 +73,7 @@ def expand_to_6(pair): # }}} + # {{{ device def get_queue(ctx_factory): -- GitLab From 35c3ac78dc19e255eeff3ce035a5f6187c61da6e Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 23 Aug 2019 14:14:21 -0500 Subject: [PATCH 58/60] Expose test data in main test script for command line access --- test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index ed0a436..671b7fe 100644 --- a/test.py +++ b/test.py @@ -15,7 +15,10 @@ from pyopencl.tools import ( # noqa as pytest_generate_tests) import utilities as u -from data_for_test import flux_test_data_fixture # noqa: F401 +from data_for_test import ( # noqa: F401 + flux_test_data_fixture, + single_data as std # "single_test_data", sorry + ) def test_weno_flux_uniform_grid(ctx_factory, flux_test_data_fixture): -- GitLab From fa8816664cf21c07d18375d5a1c270813b083502 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 23 Aug 2019 14:15:12 -0500 Subject: [PATCH 59/60] Get rid of weighted_sum_pos and by-hand summation in oscillation_pos --- WENO.F90 | 56 ++++++-------------------------------------------------- 1 file changed, 6 insertions(+), 50 deletions(-) diff --git a/WENO.F90 b/WENO.F90 index c07cf33..712b8b7 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -777,43 +777,14 @@ subroutine oscillation_pos(nvars, characteristic_fluxes, oscillation) real*8 w1sum(1), w2sum(1), w3sum(1), c1sum(1), c2sum(1), c3sum(1) integer i - integer j do i=1,nvars - w1sum(1) = 0.0d0 - do j=0,2 - w1sum(1) = w1sum(1) + weights1(j)*characteristic_fluxes(i,j-2) - end do - w2sum(1) = 0.0d0 - do j=0,2 - w2sum(1) = w2sum(1) + weights2(j)*characteristic_fluxes(i,j-1) - end do - !w3sum(1) = 0.0d0 - !do j=0,2 - ! w3sum(1) = w3sum(1) + weights3(j)*characteristic_fluxes(i,j) - !end do - !call weighted_sum_pos(3, weights3, characteristic_fluxes(i,0:2), w3sum) - call weighted_sum_pos(3, weights3, characteristic_fluxes(i,:), w3sum) - - c1sum(1) = 0.0d0 - do j=0,2 - c1sum(1) = c1sum(1) + weightsc(j)*characteristic_fluxes(i,j-2) - end do - c2sum(1) = 0.0d0 - do j=0,2 - c2sum(1) = c2sum(1) + weightsc(j)*characteristic_fluxes(i,j-1) - end do - c3sum(1) = 0.0d0 - do j=0,2 - c3sum(1) = c3sum(1) + weightsc(j)*characteristic_fluxes(i,j) - end do - - !call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) - !call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) - !call weighted_sum(3, weights2, characteristic_fluxes(i,-1:1), w2sum) - !call weighted_sum(3, weightsc, characteristic_fluxes(i,-1:1), c2sum) - !call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) - !call weighted_sum(3, weightsc, characteristic_fluxes(i,0:2), c3sum) + call weighted_sum(3, weights1, characteristic_fluxes(i,-2:0), w1sum) + call weighted_sum(3, weightsc, characteristic_fluxes(i,-2:0), c1sum) + call weighted_sum(3, weights2, characteristic_fluxes(i,-1:1), w2sum) + call weighted_sum(3, weightsc, characteristic_fluxes(i,-1:1), c2sum) + call weighted_sum(3, weights3, characteristic_fluxes(i,0:2), w3sum) + call weighted_sum(3, weightsc, characteristic_fluxes(i,0:2), c3sum) oscillation(i, 1) = (1.0d0/4)*w1sum(1)**2 + (13.0d0/12)*c1sum(1)**2 oscillation(i, 2) = (1.0d0/4)*w2sum(1)**2 + (13.0d0/12)*c2sum(1)**2 @@ -821,21 +792,6 @@ subroutine oscillation_pos(nvars, characteristic_fluxes, oscillation) end do end subroutine -subroutine weighted_sum_pos(n, w, a, a_sum) - integer, intent(in) :: n - real*8, intent(in) :: w(0:2) - !real*8, intent(in) :: a(0:2) - real*8, intent(in) :: a(-2:3) - real*8, intent(out) :: a_sum(1) - - integer j - - a_sum(1) = 0.0d0 - do j=0,2 - a_sum(1) = a_sum(1) + w(j)*a(j) - end do -end subroutine - subroutine flux_differences_pos(nvars, characteristic_fluxes, flux_differences) implicit none -- GitLab From eb924d33a16b1d5b74f4e417f13d5d71e0567db3 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 23 Aug 2019 14:16:42 -0500 Subject: [PATCH 60/60] Point CI at loopy!343 temporarily --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 36d95d7..b6462ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ git+https://github.com/inducer/pyopencl.git git+https://github.com/inducer/pymbolic.git git+https://github.com/inducer/genpy.git git+https://github.com/inducer/codepy.git -git+https://gitlab.tiker.net/inducer/loopy.git@kernel_callables_v3 +git+https://gitlab.tiker.net/inducer/loopy.git@fix-slice-processing-at-base git+https://github.com/inducer/f2py -- GitLab