From 9151bb64a8fe7114d69808453b14a74a38741601 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl <alexfikl@gmail.com> Date: Fri, 24 Apr 2020 15:49:08 -0500 Subject: [PATCH] remove some useless changes --- examples/advection/var-velocity.py | 5 ++--- examples/wave/var-propagation-speed.py | 7 +++---- grudge/models/advection.py | 10 ++++------ grudge/models/wave.py | 6 +++--- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/examples/advection/var-velocity.py b/examples/advection/var-velocity.py index adf2f2fe..bc720731 100644 --- a/examples/advection/var-velocity.py +++ b/examples/advection/var-velocity.py @@ -75,9 +75,8 @@ def main(write_output=True, order=4): / source_width**2) def f_step(x): - from pymbolic.primitives import If, Comparison - return If( - Comparison( + return sym.If( + sym.Comparison( np.dot(sym_source_center_dist, sym_source_center_dist), "<", (4*source_width)**2), diff --git a/examples/wave/var-propagation-speed.py b/examples/wave/var-propagation-speed.py index 937b87a0..a7a634f7 100644 --- a/examples/wave/var-propagation-speed.py +++ b/examples/wave/var-propagation-speed.py @@ -51,10 +51,9 @@ def main(write_output=True, order=4): sym_x = sym.nodes(mesh.dim) sym_source_center_dist = sym_x - source_center sym_t = sym.ScalarVariable("t") - - from pymbolic.primitives import If, Comparison - c = If(Comparison(np.dot(sym_x, sym_x), "<", 0.15), - np.float32(-0.1), np.float32(-0.2)) + c = sym.If(sym.Comparison( + np.dot(sym_x, sym_x), "<", 0.15), + np.float32(-0.1), np.float32(-0.2)) from grudge.models.wave import VariableCoefficientWeakWaveOperator from meshmode.mesh import BTAG_ALL, BTAG_NONE diff --git a/grudge/models/advection.py b/grudge/models/advection.py index 5ef1e5ce..091b9870 100644 --- a/grudge/models/advection.py +++ b/grudge/models/advection.py @@ -59,10 +59,9 @@ class AdvectionOperatorBase(HyperbolicOperator): elif self.flux_type == "lf": return u.avg*v_dot_normal + 0.5*norm_v*(u.int - u.ext) elif self.flux_type == "upwind": - from pymbolic.primitives import If, Comparison return ( - v_dot_normal * If( - Comparison(v_dot_normal, ">", 0), + v_dot_normal * sym.If( + sym.Comparison(v_dot_normal, ">", 0), u.int, # outflow u.ext, # inflow )) @@ -156,10 +155,9 @@ class VariableCoefficientAdvectionOperator(HyperbolicOperator): elif self.flux_type == "lf": return u.avg*v_dot_normal + 0.5*norm_v*(u.int - u.ext) elif self.flux_type == "upwind": - from pymbolic.primitives import If, Comparison return ( - v_dot_normal * If( - Comparison(v_dot_normal, ">", 0), + v_dot_normal * sym.If( + sym.Comparison(v_dot_normal, ">", 0), u.int, # outflow u.ext, # inflow )) diff --git a/grudge/models/wave.py b/grudge/models/wave.py index 9b16c602..0ac60a33 100644 --- a/grudge/models/wave.py +++ b/grudge/models/wave.py @@ -350,9 +350,9 @@ class VariableCoefficientWeakWaveOperator(HyperbolicOperator): self.ambient_dim = ambient_dim self.source_f = source_f - from pymbolic.primitives import If, Comparison - self.sign = If(Comparison(self.c, ">", 0), - np.int32(1), np.int32(-1)) + self.sign = sym.If(sym.Comparison( + self.c, ">", 0), + np.int32(1), np.int32(-1)) self.dirichlet_tag = dirichlet_tag self.neumann_tag = neumann_tag -- GitLab