Skip to content

Commit

Permalink
Merge cd10adb into 47a3c79
Browse files Browse the repository at this point in the history
  • Loading branch information
ketch committed Jul 27, 2014
2 parents 47a3c79 + cd10adb commit de44245
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/euler_2d/euler_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"""
from clawpack import pyclaw
from clawpack import riemann
from clawpack.riemann.euler_4wave_2D_constants import *

def load_frame(frame_number):
from clawpack.pyclaw import Solution
Expand All @@ -31,7 +32,7 @@ def plot_frame(frame):
import matplotlib.pyplot as plt
q = frame.q
x, y = frame.state.grid.c_centers
plt.pcolormesh(x, y, q[0,...])
plt.pcolormesh(x, y, q[density,...])

def plot_results():
from clawpack.visclaw import iplot
Expand All @@ -42,17 +43,17 @@ def plot_results():
solver.all_bcs = pyclaw.BC.extrap

domain = pyclaw.Domain([0.,0.],[1.,1.],[200,200])
solution = pyclaw.Solution(solver.num_eqn,domain)
solution = pyclaw.Solution(num_eqn,domain)
gamma = 1.4
solution.problem_data['gamma'] = gamma

# Set initial data
xx,yy = domain.grid.p_centers
l = xx<0.5; r = xx>=0.5; b = yy<0.5; t = yy>=0.5
solution.q[0,...] = 2.*l*t + 1.*l*b + 1.*r*t + 3.*r*b
solution.q[1,...] = 0.75*t - 0.75*b
solution.q[2,...] = 0.5*l - 0.5*r
solution.q[3,...] = 0.5*solution.q[0,...]*(solution.q[1,...]**2+solution.q[2,...]**2) + 1./(gamma-1.)
solution.q[density,...] = 2.*l*t + 1.*l*b + 1.*r*t + 3.*r*b
solution.q[x_momentum,...] = 0.75*t - 0.75*b
solution.q[y_momentum,...] = 0.5*l - 0.5*r
solution.q[energy,...] = 0.5*solution.q[density,...]*(solution.q[x_momentum,...]**2+solution.q[y_momentum,...]**2) + 1./(gamma-1.)

claw = pyclaw.Controller()
claw.tfinal = 0.3
Expand Down

0 comments on commit de44245

Please sign in to comment.