Skip to content

Commit

Permalink
bench: cleanup 3d
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Jul 19, 2023
1 parent 416f1ec commit 51dbc2d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions fast/diffusion_3D_wBCs.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,22 @@ def plot_3dfunc(u):

print(eq_stencil)

# Create an operator that updates the forward stencil point
# plus adding boundary conditions
# op = Operator([eq_stencil] + bc, subdomain=grid.interior)

# No BCs
op = XDSLOperator([eq_stencil])
# op = Operator([eq_stencil])
# print(op.ccode)

# Create Operator
op = Operator([eq_stencil])
# Apply the operator for a number of timesteps
op.apply(time=nt, dt=dt, a=nu)
print("Devito Field norm is:", norm(u))

# Reset field
u.data[:, :, :, :] = 0
u.data[:, :, :, int(nz/2)] = 1
xdslop = XDSLOperator([eq_stencil])
# Apply the xdsl operator for a number of timesteps
xdslop.apply(time=nt, dt=dt, a=nu)

if args.plot:
plot_3dfunc(u)

print("Field norm is:", norm(u))
print("XDSL Field norm is:", norm(u))

# import pdb;pdb.set_trace()

0 comments on commit 51dbc2d

Please sign in to comment.