From caad2101df05587c492015d52f6709c7394804dd Mon Sep 17 00:00:00 2001 From: Emilien Bauer Date: Fri, 11 Aug 2023 18:35:47 +0100 Subject: [PATCH] Avoid Devito's norm. --- fast/diffusion_3D_wBCs.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fast/diffusion_3D_wBCs.py b/fast/diffusion_3D_wBCs.py index 918b30af00..56bd90833b 100644 --- a/fast/diffusion_3D_wBCs.py +++ b/fast/diffusion_3D_wBCs.py @@ -61,7 +61,7 @@ op = Operator([eq_stencil], name='DevitoOperator', opt=('advanced', {'par-tile': (32,4,8)})) # Apply the operator for a number of timesteps op.apply(time=nt, dt=dt, a=nu) - print("Devito Field norm is:", norm(u)) + print("Devito Field norm is:", np.linalg.norm(u.data)) if args.plot: plot_3dfunc(u) @@ -69,10 +69,10 @@ # Reset field u.data[:, :, :, :] = 0 u.data[:, :, :, int(nz/2)] = 1 - xdslop = WGPUOperator([eq_stencil], name='xDSLOperator') - # Apply the xdsl operator for a number of timesteps - xdslop.apply(time=nt, dt=dt, a=nu) - print("XDSL Field norm is:", norm(u)) + wgpuop = WGPUOperator([eq_stencil], name='WGPUOperator') + # Apply the wgpu operator for a number of timesteps + wgpuop.apply(time=nt, dt=dt, a=nu) + print("WGPU Field norm is:", np.linalg.norm(u.data)) if args.plot: plot_3dfunc(u) @@ -80,9 +80,9 @@ # Reset field u.data[:, :, :, :] = 0 u.data[:, :, :, int(nz/2)] = 1 - xdslop = XDSLOperator([eq_stencil], name='xDSLOperator') + wgpuop = XDSLOperator([eq_stencil], name='xDSLOperator') # Apply the xdsl operator for a number of timesteps - xdslop.apply(time=nt, dt=dt, a=nu) - print("XDSL Field norm is:", norm(u)) + wgpuop.apply(time=nt, dt=dt, a=nu) + print("XDSL Field norm is:", np.linalg.norm(u.data)) if args.plot: plot_3dfunc(u)