import mpld3
import numpy as np
from clawpack.riemann import riemann_interactive
# Define left and right state (h,hu)
ql = np.array([3.0, 5.0])
qr = np.array([3.0, -5.0])
# Defineoptional parameters (otherwise chooses default values)
plotopts = {'g':1.0, 'time':2.0, 'tmax':5, 'hmax':10, 'humin':-15, 'humax':15}
# Call interactive function (can be called without any argument)
pt = riemann_interactive.shallow_water(ql,qr,**plotopts)
mpld3.display()
# Define left and right state
ql = np.array([-2.0, 2.0])
qr = np.array([0.0, -3.0])
# Define two eigenvectors and eigenvalues (acoustics)
zz = 2.0
rho0 = 1.0
r1 = np.array([zz,1.0])
r2 = np.array([-zz,1.0])
lam1 = zz/rho0
lam2 = -zz/rho0
plotopts={'q1min':-5, 'q1max':5, 'q2min':-5, 'q2max':5, 'domain':5, 'time':1,
'title1':"Pressure", 'title2':"Velocity"}
riemann_interactive.linear_phase_plane(ql,qr,r1,r2,lam1,lam2,**plotopts)
mpld3.display()