Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add solver support for point-wise Riemann solvers #473

Merged
merged 4 commits into from
Nov 7, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/acoustics_1d_homogeneous/acoustics_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@
from clawpack import riemann

def setup(use_petsc=False,kernel_language='Fortran',solver_type='classic',
outdir='./_output',weno_order=5,time_integrator='SSP104', disable_output=False):
outdir='./_output',ptwise=False,weno_order=5,time_integrator='SSP104',
disable_output=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent the line continuation?


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

if kernel_language == 'Fortran':
riemann_solver = riemann.acoustics_1D
if ptwise:
riemann_solver = riemann.acoustics_1D_ptwise
else:
riemann_solver = riemann.acoustics_1D

elif kernel_language=='Python':
riemann_solver = riemann.acoustics_1D_py.acoustics_1D

Expand Down
5 changes: 5 additions & 0 deletions examples/acoustics_1d_homogeneous/test_acoustics.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def acoustics_verify(claw):
classic_tests = gen_variants(acoustics_1d.setup, verify_expected(0.00104856594174),
kernel_languages=('Python','Fortran'), solver_type='classic', disable_output=True)

classic_tests = gen_variants(acoustics_1d.setup, verify_expected(0.00104856594174),
kernel_languages=('Fortran',), ptwise=True,
solver_type='classic', disable_output=True)


sharp_tests_rk = gen_variants(acoustics_1d.setup, verify_expected(0.000298879563857),
kernel_languages=('Python','Fortran'), solver_type='sharpclaw',
time_integrator='SSP104', disable_output=True)
Expand Down
2 changes: 2 additions & 0 deletions src/pyclaw/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ def get_clawpack_dot_xxx(modname): return modname.rpartition('.')[0].rpartition(
self.rp = riemann_solver
rp_name = riemann_solver.__name__.split('.')[-1]
from clawpack import riemann
if "ptwise" in rp_name:
rp_name = rp_name.replace("_ptwise", "")
self.num_eqn = riemann.static.num_eqn.get(rp_name,None)
self.num_waves = riemann.static.num_waves.get(rp_name,None)

Expand Down