diff --git a/comparison_fixtures.py b/comparison_fixtures.py index 402f9beccc3480ec5725cf8358b2d97797ef268d..04c743236fc597b1ec48ed24d5974360e6da6c7e 100644 --- a/comparison_fixtures.py +++ b/comparison_fixtures.py @@ -1,3 +1,4 @@ +import numpy as np from pytest import approx @@ -8,3 +9,12 @@ def arrays(a, b): def roe_identity(states, R, Rinv): dState = states[:,1] - states[:,0] arrays(R@(Rinv@dState), dState) + + +def roe_property(states, fluxes, R, Rinv, lam): + dState = states[:,1] - states[:,0] + dFlux = fluxes[:,1] - fluxes[:,0] + + temp = Rinv@dState + temp = np.multiply(lam, temp) + arrays(R@temp, dFlux) diff --git a/test.py b/test.py index ab3af8c16ac425faedddc0b5374b0f8426e0be05..d71231ea0fb44824be226ca53f2a6c82b93733b3 100644 --- a/test.py +++ b/test.py @@ -26,8 +26,8 @@ def test_roe(ctx_factory): compare.roe_identity(states, R, Rinv) - #fluxes = setup.array_from_string("4 11.2 8 8 46.4,1 2.6 1 1 7.1") - #compare.roe_property(states, fluxes, R, Rinv, lam) + fluxes = setup.array_from_string("4 1,11.2 2.6,8 1,8 1,46.4 7.1") + compare.roe_property(states, fluxes, R, Rinv, lam) def test_matvec(ctx_factory):