Skip to content

Commit 2f83993

Browse files
committed
Add test for dam_break problem that uses Python Roe solver.
This tests clawpack/riemann#109.
1 parent 73a5b56 commit 2f83993

File tree

3 files changed

+545
-2
lines changed

3 files changed

+545
-2
lines changed

examples/shallow_1d/dam_break.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
from clawpack import riemann
2020
from clawpack.riemann.shallow_roe_with_efix_1D_constants import depth, momentum, num_eqn
2121

22-
def setup(use_petsc=False,kernel_language='Fortran',outdir='./_output',solver_type='classic'):
22+
def setup(use_petsc=False,kernel_language='Fortran',outdir='./_output',
23+
solver_type='classic',disable_output=False):
2324

2425
if use_petsc:
2526
import clawpack.petclaw as pyclaw
2627
else:
2728
from clawpack import pyclaw
2829

2930
if kernel_language =='Python':
30-
rs = riemann.shallow_1D_py.shallow_1D
31+
rs = riemann.shallow_1D_py.shallow_roe_1D
3132
elif kernel_language =='Fortran':
3233
rs = riemann.shallow_roe_with_efix_1D
3334

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

5253
# Gravitational constant
5354
state.problem_data['grav'] = 1.0
55+
if kernel_language =='Python':
56+
state.problem_data['efix'] = True # Turn on entropy fix
5457

5558
xc = state.grid.x.centers
5659

@@ -83,6 +86,8 @@ def setup(use_petsc=False,kernel_language='Fortran',outdir='./_output',solver_ty
8386
claw.solver = solver
8487
claw.outdir = outdir
8588
claw.setplot = setplot
89+
if disable_output:
90+
claw.output_format = None
8691

8792
return claw
8893

0 commit comments

Comments
 (0)