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

Automatically set solver.fwave based on values in Riemann repository. #738

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions examples/advection_reaction_2d/advection_reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def setup(outdir='./_output'):
domain = pyclaw.Domain( (0.,0.), (1.,1.), (100,100) )
solver.num_eqn = 2
solver.num_waves = 1
solver.fwave = False
num_aux = 2
state = pyclaw.State(domain, solver.num_eqn, num_aux)

Expand Down
5 changes: 5 additions & 0 deletions src/pyclaw/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def get_clawpack_dot_xxx(modname): return modname.rpartition('.')[0].rpartition(

self.num_eqn = None
self.num_waves = None
self.fwave = None

self.compute_gauge_values = default_compute_gauge_values
r"""(function) - Function that computes quantities to be recorded at gauges"""
Expand All @@ -234,6 +235,7 @@ def get_clawpack_dot_xxx(modname): return modname.rpartition('.')[0].rpartition(
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)
self.fwave = riemann.static.fwave.get(rp_name,None)

self._isinitialized = True

Expand Down Expand Up @@ -273,6 +275,9 @@ def is_valid(self):
if self.num_eqn is None:
valid = False
reason = 'solver.num_eqn has not been set.'
if self.fwave is None:
valid = False
reason = 'solver.fwave has not been set.'
if (None in self.bc_lower) or (None in self.bc_upper):
valid = False
reason = 'One of the boundary conditions has not been set.'
Expand Down
Loading