Skip to content

Commit

Permalink
Merge 3df2ffc into f396ebc
Browse files Browse the repository at this point in the history
  • Loading branch information
ketch committed Nov 19, 2018
2 parents f396ebc + 3df2ffc commit b533a49
Show file tree
Hide file tree
Showing 6 changed files with 759 additions and 6 deletions.
15 changes: 12 additions & 3 deletions examples/shallow_1d/dam_break.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,24 @@
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',
riemann_solver='roe', 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
if riemann_solver.lower() == 'roe':
raise Exception('Python Roe solver not implemented.')
elif riemann_solver.lower() == 'hlle':
rs = riemann.shallow_1D_py.shallow_hll_1D
elif kernel_language == 'Fortran':
rs = riemann.shallow_roe_with_efix_1D
if riemann_solver.lower() == 'roe':
rs = riemann.shallow_roe_with_efix_1D
elif riemann_solver.lower() == 'hlle':
rs = riemann.shallow_hlle_1D

if solver_type == 'classic':
solver = pyclaw.ClawSolver1D(rs)
Expand Down Expand Up @@ -81,6 +88,8 @@ def setup(use_petsc=False,kernel_language='Fortran',outdir='./_output',solver_ty

claw = pyclaw.Controller()
claw.keep_copy = True
if disable_output:
claw.output_format = None
claw.tfinal = 2.0
claw.solution = pyclaw.Solution(state,domain)
claw.solver = solver
Expand Down
Loading

0 comments on commit b533a49

Please sign in to comment.