Skip to content

Commit

Permalink
Add test for dam_break problem that uses Python Roe solver.
Browse files Browse the repository at this point in the history
  • Loading branch information
ketch committed Jan 28, 2016
1 parent 73a5b56 commit 2f83993
Show file tree
Hide file tree
Showing 3 changed files with 545 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/shallow_1d/dam_break.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
from clawpack import riemann
from clawpack.riemann.shallow_roe_with_efix_1D_constants import depth, momentum, num_eqn

def setup(use_petsc=False,kernel_language='Fortran',outdir='./_output',solver_type='classic'):
def setup(use_petsc=False,kernel_language='Fortran',outdir='./_output',
solver_type='classic',disable_output=False):

if use_petsc:
import clawpack.petclaw as pyclaw
else:
from clawpack import pyclaw

if kernel_language =='Python':
rs = riemann.shallow_1D_py.shallow_1D
rs = riemann.shallow_1D_py.shallow_roe_1D
elif kernel_language =='Fortran':
rs = riemann.shallow_roe_with_efix_1D

Expand All @@ -51,6 +52,8 @@ def setup(use_petsc=False,kernel_language='Fortran',outdir='./_output',solver_ty

# Gravitational constant
state.problem_data['grav'] = 1.0
if kernel_language =='Python':
state.problem_data['efix'] = True # Turn on entropy fix

xc = state.grid.x.centers

Expand Down Expand Up @@ -83,6 +86,8 @@ def setup(use_petsc=False,kernel_language='Fortran',outdir='./_output',solver_ty
claw.solver = solver
claw.outdir = outdir
claw.setplot = setplot
if disable_output:
claw.output_format = None

return claw

Expand Down
Loading

0 comments on commit 2f83993

Please sign in to comment.