From ca4270b870f4c647b7125a223216ea7ddb224bc6 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sun, 4 Aug 2024 10:39:27 +0300 Subject: [PATCH] example: ensure dt is a float --- examples/advection/surface.py | 2 +- examples/advection/var-velocity.py | 2 +- examples/advection/weak.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/advection/surface.py b/examples/advection/surface.py index 026bf994..c7b96c69 100644 --- a/examples/advection/surface.py +++ b/examples/advection/surface.py @@ -214,7 +214,7 @@ def rhs(t, u): logger.info("nsteps: %d", nsteps) from grudge.shortcuts import set_up_rk4 - dt_stepper = set_up_rk4("u", dt, u0, rhs) + dt_stepper = set_up_rk4("u", float(dt), u0, rhs) plot = Plotter(actx, dcoll, order, visualize=visualize) norm_u = actx.to_numpy(op.norm(dcoll, u0, 2)) diff --git a/examples/advection/var-velocity.py b/examples/advection/var-velocity.py index dd266280..7b6cebd8 100644 --- a/examples/advection/var-velocity.py +++ b/examples/advection/var-velocity.py @@ -200,7 +200,7 @@ def rhs(t, u): # {{{ time stepping from grudge.shortcuts import set_up_rk4 - dt_stepper = set_up_rk4("u", dt, u, rhs) + dt_stepper = set_up_rk4("u", float(dt), u, rhs) plot = Plotter(actx, dcoll, order, visualize=visualize, ylim=[-0.1, 1.1]) diff --git a/examples/advection/weak.py b/examples/advection/weak.py index eee9999d..35ef9bf8 100644 --- a/examples/advection/weak.py +++ b/examples/advection/weak.py @@ -172,7 +172,7 @@ def rhs(t, u): # {{{ time stepping from grudge.shortcuts import set_up_rk4 - dt_stepper = set_up_rk4("u", dt, u, rhs) + dt_stepper = set_up_rk4("u", float(dt), u, rhs) plot = Plotter(actx, dcoll, order, visualize=visualize, ylim=[-1.1, 1.1])