@@ -16,7 +16,7 @@ def riemann():
1616 # interior and ghost cell initialization
1717 a = gr .scratch_array ()
1818
19- a [gr .ilo :gr .ihi + 1 ] = np .array ([0.8 , 0.7 , 0.4 , 0.5 ])
19+ a [gr .ilo :gr .ihi + 1 ] = np .array ([0.8 , 0.4 , 0.3 , 0.5 ])
2020 a [0 :gr .ilo ] = a [gr .ihi - 1 :gr .ihi + 1 ]
2121 a [gr .ihi :2 * gr .ng + gr .nx ] = a [gr .ihi ]
2222
@@ -47,16 +47,18 @@ def riemann():
4747
4848
4949 # compute the states to the left and right of lo-1/2
50- C = 0.7 # CFL
51- al = a [gr .ilo - 1 ] + 0.5 * gr .dx * (1.0 - C )* pl .slope [gr .ilo - 1 ]
52- ar = a [gr .ilo ] - 0.5 * gr .dx * (1.0 + C )* pl .slope [gr .ilo ]
50+ C = 0.5 # CFL
51+ print (a )
52+ print (pl .slope )
53+ al = a [gr .ilo - 1 ] + 0.5 * (1.0 - C )* pl .slope [gr .ilo - 1 ]
54+ ar = a [gr .ilo ] - 0.5 * (1.0 + C )* pl .slope [gr .ilo ]
5355
5456 # L
55- gr .mark_cell_right_state (ng - 1 , r"$a_{\mathrm{lo}+ \myhalf,L}^{n+\myhalf}$" ,
56- value = al , vertical = "top " , color = "b" )
57+ gr .mark_cell_right_state (ng - 1 , r"$a_{\mathrm{lo}- \myhalf,L}^{n+\myhalf}$" ,
58+ value = al , vertical = "center " , color = "b" )
5759
5860 # R
59- gr .mark_cell_left_state (ng , r"$a_{\mathrm{lo}+ \myhalf,R}^{n+\myhalf}$" ,
61+ gr .mark_cell_left_state (ng , r"$a_{\mathrm{lo}- \myhalf,R}^{n+\myhalf}$" ,
6062 value = ar , vertical = "top" , color = "b" )
6163
6264
0 commit comments