From 2dc9c589b2ab43ca1a3b4e210a66974b39feee05 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni <15399010+kaushikcfd@users.noreply.github.com> Date: Sun, 21 Nov 2021 16:24:27 -0600 Subject: [PATCH] make models.wave compatible with all array contexts (#187) --- grudge/models/wave.py | 4 ++-- grudge/shortcuts.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grudge/models/wave.py b/grudge/models/wave.py index a8b54700..36a90424 100644 --- a/grudge/models/wave.py +++ b/grudge/models/wave.py @@ -220,7 +220,7 @@ class VariableCoefficientWeakWaveOperator(HyperbolicOperator): self.source_f = source_f ones = dcoll.zeros(actx) + 1 - self.sign = freeze(actx.np.where(c > 0, ones, -ones)) + self.sign = freeze(actx.np.where(actx.np.greater(c, 0), ones, -ones)) self.dirichlet_tag = dirichlet_tag self.neumann_tag = neumann_tag @@ -338,7 +338,7 @@ class VariableCoefficientWeakWaveOperator(HyperbolicOperator): self.radiation_tag]) def max_characteristic_velocity(self, actx, **kwargs): - return actx.np.fabs(thaw(self.c, actx)) + return actx.np.abs(thaw(self.c, actx)) # }}} diff --git a/grudge/shortcuts.py b/grudge/shortcuts.py index a3561bcb..d9e5fe1f 100644 --- a/grudge/shortcuts.py +++ b/grudge/shortcuts.py @@ -23,7 +23,7 @@ THE SOFTWARE. """ -def set_up_rk4(field_var_name, dt, fields, rhs, t_start=0): +def set_up_rk4(field_var_name, dt, fields, rhs, t_start=0.0): from leap.rk import LSRK4MethodBuilder from dagrt.codegen import PythonCodeGenerator -- GitLab