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

add Roe property check

parent eb96634b
No related branches found
No related tags found
2 merge requests!10Roe tests,!8Test refactoring
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)
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment