Skip to content

Commit

Permalink
Automatically set solver.fwave based on values in Riemann repository.
Browse files Browse the repository at this point in the history
Also check if it's set when checking solver validity.
  • Loading branch information
ketch committed Dec 2, 2024
1 parent 37658ee commit 117522c
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 117522c

Please sign in to comment.