Skip to content

Commit

Permalink
Update mixalot - removed deprecated.
Browse files Browse the repository at this point in the history
  • Loading branch information
MTCam committed Feb 8, 2022
1 parent 51e6ecf commit 78ca790
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions mixalot.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,
dim = 3
# nel_1d = 8
order = 1
x_scale = 8
y_scale = 4
z_scale = 4
x_scale = 2
y_scale = 1
z_scale = 1
chlen = .01
domain_xlen = .1
domain_ylen = .02
Expand Down Expand Up @@ -233,12 +233,12 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,
npts_axis = (npts_x, npts_y)
box_ll = (xleft, ybottom)
box_ur = (xright, ytop)
periodic = (True, True)
periodic = (False, False)
else:
npts_axis = (npts_x, npts_y, npts_z)
box_ll = (xleft, ybottom, zback)
box_ur = (xright, ytop, zfront)
periodic = (False, False, False)
periodic = (True, True, True)

generate_mesh = partial(_get_box_mesh, dim, a=box_ll, b=box_ur, n=npts_axis,
periodic=periodic)
Expand Down Expand Up @@ -512,14 +512,14 @@ def my_write_status(dt, cfl, dv=None):
press = dv.pressure

from grudge.op import nodal_min_loc, nodal_max_loc
tmin = allsync(actx.to_numpy(nodal_min_loc(discr, "vol", temp)),
comm=comm, op=MPI.MIN)
tmax = allsync(actx.to_numpy(nodal_max_loc(discr, "vol", temp)),
comm=comm, op=MPI.MAX)
pmin = allsync(actx.to_numpy(nodal_min_loc(discr, "vol", press)),
comm=comm, op=MPI.MIN)
pmax = allsync(actx.to_numpy(nodal_max_loc(discr, "vol", press)),
comm=comm, op=MPI.MAX)
tmin = global_reduce(actx.to_numpy(nodal_min_loc(discr, "vol", temp)),
op="min")
tmax = global_reduce(actx.to_numpy(nodal_max_loc(discr, "vol", temp)),
op="max")
pmin = global_reduce(actx.to_numpy(nodal_min_loc(discr, "vol", press)),
op="min")
pmax = global_reduce(actx.to_numpy(nodal_max_loc(discr, "vol", press)),
op="max")
dv_status_msg = f"\nP({pmin}, {pmax}), T({tmin}, {tmax})"
status_msg = status_msg + dv_status_msg

Expand Down Expand Up @@ -622,14 +622,14 @@ def my_get_timestep(t, dt, state):
if constant_cfl:
ts_field = current_cfl * compute_dt(state)
from grudge.op import nodal_min_loc
dt = allsync(actx.to_numpy(nodal_min_loc(discr, "vol", ts_field)),
comm=comm, op=MPI.MIN)
dt = global_reduce(actx.to_numpy(nodal_min_loc(discr, "vol", ts_field)),
op="min")
cfl = current_cfl
else:
ts_field = compute_cfl(state, current_dt)
from grudge.op import nodal_max_loc
cfl = allsync(actx.to_numpy(nodal_max_loc(discr, "vol", ts_field)),
comm=comm, op=MPI.MAX)
cfl = global_reduce(actx.to_numpy(nodal_max_loc(discr, "vol", ts_field)),
op="max")
return ts_field, cfl, min(t_remaining, dt)

def my_pre_step(step, t, dt, state):
Expand Down

0 comments on commit 78ca790

Please sign in to comment.