Skip to content

Commit

Permalink
Merge branch 'build-production' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
MTCam committed Aug 16, 2024
2 parents 773f048 + c58d093 commit cf52d8e
Show file tree
Hide file tree
Showing 51 changed files with 251 additions and 264 deletions.
4 changes: 2 additions & 2 deletions examples/advdiff-tpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ def main(actx_class, use_overintegration=False, use_esdg=False,
tensor_product_elements=use_tpe)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

def _limit_fluid_cv(cv, temperature_seed=None, gas_model=None, dd=None):
actx = cv.array_context
Expand Down
2 changes: 1 addition & 1 deletion examples/advection_diffusion_reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def main(actx_class, use_overintegration=False, casename=None, rst_filename=None
kappa = 0.01

from grudge.dt_utils import characteristic_lengthscales
dx = np.min(actx.to_numpy(characteristic_lengthscales(actx, dcoll)))
dx = actx.to_numpy(actx.np.min(characteristic_lengthscales(actx, dcoll)))
inv_dt = dx / wave_speed
visc_dt = dx**2 / kappa

Expand Down
4 changes: 2 additions & 2 deletions examples/blasius.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _get_fluid_state(cv):
current_t = restart_data["t"]
current_step = restart_step
if np.isscalar(current_t) is False:
current_t = np.min(actx.to_numpy(current_t))
current_t = actx.to_numpy(actx.np.min(current_t))

current_cv = restart_data["state"]

Expand Down Expand Up @@ -441,7 +441,7 @@ def my_rhs(t, state):
quadrature_tag=quadrature_tag)

def my_post_step(step, t, dt, state):
min_dt = np.min(actx.to_numpy(dt)) if local_dt else dt
min_dt = actx.to_numpy(actx.np.min(dt)) if local_dt else dt
if logmgr:
set_dt(logmgr, min_dt)
logmgr.tick_after()
Expand Down
4 changes: 2 additions & 2 deletions examples/combozzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from meshmode.mesh import BTAG_ALL, BTAG_NONE # noqa
from grudge.shortcuts import make_visualizer
from grudge.dof_desc import BoundaryDomainTag, DISCR_TAG_QUAD
from grudge.dof_desc import BoundaryDomainTag, DISCR_TAG_BASE, DISCR_TAG_QUAD
from mirgecom.discretization import create_discretization_collection


Expand Down Expand Up @@ -653,7 +653,7 @@ def vol_max(x):
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

ones = dcoll.zeros(actx) + 1.0

Expand Down
4 changes: 2 additions & 2 deletions examples/doublemach.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ def main(actx_class, use_esdg=False,
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None # noqa
quadrature_tag = DISCR_TAG_BASE

dim = 2
if logmgr:
Expand Down
4 changes: 2 additions & 2 deletions examples/doublemach_physical_av.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ def _compiled_stepper_wrapper(state, t, dt, rhs):
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None # noqa
quadrature_tag = DISCR_TAG_BASE

dim = 2
if logmgr:
Expand Down
4 changes: 2 additions & 2 deletions examples/heat-source.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ def main(actx_class, use_esdg=False,

dcoll = create_discretization_collection(actx, local_mesh, order=order)

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None # noqa
quadrature_tag = DISCR_TAG_BASE

if dim == 2:
# no deep meaning here, just a fudge factor
Expand Down
4 changes: 2 additions & 2 deletions examples/hotplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ def main(actx_class, use_esdg=False, use_leap=False, casename=None,
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

if logmgr:
logmgr_add_cl_device_info(logmgr, queue)
Expand Down
4 changes: 2 additions & 2 deletions examples/lump.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import numpy as np
from functools import partial

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
from meshmode.mesh import BTAG_ALL, BTAG_NONE # noqa
from grudge.shortcuts import make_visualizer

Expand Down Expand Up @@ -141,7 +141,7 @@ def main(actx_class, use_esdg=False,
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

vis_timer = None

Expand Down
4 changes: 2 additions & 2 deletions examples/mixture-tpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from meshmode.mesh import BTAG_ALL
from grudge.shortcuts import make_visualizer
from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD

from mirgecom.discretization import create_discretization_collection
from mirgecom.euler import euler_operator
Expand Down Expand Up @@ -151,7 +151,7 @@ def main(actx_class, use_esdg=False,
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

vis_timer = None

Expand Down
4 changes: 2 additions & 2 deletions examples/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from meshmode.mesh import BTAG_ALL
from grudge.shortcuts import make_visualizer
from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD

from mirgecom.discretization import create_discretization_collection
from mirgecom.euler import euler_operator
Expand Down Expand Up @@ -145,7 +145,7 @@ def main(actx_class, use_esdg=False,
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

vis_timer = None

Expand Down
2 changes: 1 addition & 1 deletion examples/multiple-volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def main(actx_class, use_esdg=False,
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

vis_timer = None

Expand Down
29 changes: 10 additions & 19 deletions examples/poiseuille-multispecies.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@

from mirgecom.fluid import make_conserved
from mirgecom.navierstokes import ns_operator
from mirgecom.simutil import get_sim_timestep

from mirgecom.simutil import (
get_sim_timestep,
get_box_mesh
)
from mirgecom.io import make_init_message
from mirgecom.mpi import mpi_entry_point
from mirgecom.integrators import rk4_step
Expand Down Expand Up @@ -69,17 +71,6 @@ class MyRuntimeError(RuntimeError):
pass


# Box grid generator widget lifted from @majosm and slightly bent
def _get_box_mesh(dim, a, b, n, t=None):
dim_names = ["x", "y", "z"]
bttf = {}
for i in range(dim):
bttf["-"+str(i+1)] = ["-"+dim_names[i]]
bttf["+"+str(i+1)] = ["+"+dim_names[i]]
from meshmode.mesh.generation import generate_regular_rect_mesh as gen
return gen(a=a, b=b, n=n, boundary_tag_to_face=bttf, mesh_type=t)


@mpi_entry_point
def main(actx_class, use_overintegration=False, use_leap=False, casename=None,
rst_filename=None, use_esdg=False):
Expand Down Expand Up @@ -130,8 +121,8 @@ def main(actx_class, use_overintegration=False, use_leap=False, casename=None,
xlen = right_boundary_location - left_boundary_location
ylen = ytop - ybottom
n_refine = 1
npts_x = n_refine*int(xlen / x_ch)
npts_y = n_refine*int(ylen / x_ch)
nels_x = n_refine*int(xlen / x_ch)
nels_y = n_refine*int(ylen / x_ch)

rst_path = "restart_data/"
rst_pattern = (
Expand All @@ -147,10 +138,10 @@ def main(actx_class, use_overintegration=False, use_leap=False, casename=None,
global_nelements = restart_data["global_nelements"]
assert restart_data["nparts"] == nparts
else: # generate the grid from scratch
npts_axis = (npts_x, npts_y)
nels_axis = (nels_x, nels_y)
box_ll = (left_boundary_location, ybottom)
box_ur = (right_boundary_location, ytop)
generate_mesh = partial(_get_box_mesh, 2, a=box_ll, b=box_ur, n=npts_axis)
generate_mesh = partial(get_box_mesh, 2, a=box_ll, b=box_ur, n=nels_axis)
from mirgecom.simutil import generate_and_distribute_mesh
local_mesh, global_nelements = generate_and_distribute_mesh(comm,
generate_mesh)
Expand All @@ -160,11 +151,11 @@ def main(actx_class, use_overintegration=False, use_leap=False, casename=None,
dcoll = create_discretization_collection(actx, local_mesh, order)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

if logmgr:
logmgr_add_device_name(logmgr, queue)
Expand Down
4 changes: 2 additions & 2 deletions examples/poiseuille-tpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from meshmode.mesh import BTAG_ALL, BTAG_NONE # noqa

from grudge.shortcuts import make_visualizer
from grudge.dof_desc import BoundaryDomainTag, DISCR_TAG_QUAD
from grudge.dof_desc import BoundaryDomainTag, DISCR_TAG_BASE, DISCR_TAG_QUAD

from mirgecom.discretization import create_discretization_collection
from mirgecom.fluid import make_conserved
Expand Down Expand Up @@ -157,7 +157,7 @@ def main(actx_class, use_esdg=False, use_overintegration=False,
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

if logmgr:
logmgr_add_cl_device_info(logmgr, queue)
Expand Down
4 changes: 2 additions & 2 deletions examples/poiseuille.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from meshmode.mesh import BTAG_ALL, BTAG_NONE # noqa

from grudge.shortcuts import make_visualizer
from grudge.dof_desc import BoundaryDomainTag, DISCR_TAG_QUAD
from grudge.dof_desc import BoundaryDomainTag, DISCR_TAG_BASE, DISCR_TAG_QUAD

from mirgecom.discretization import create_discretization_collection
from mirgecom.fluid import make_conserved
Expand Down Expand Up @@ -153,7 +153,7 @@ def main(actx_class, use_esdg=False, use_overintegration=False,
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

if logmgr:
logmgr_add_cl_device_info(logmgr, queue)
Expand Down
4 changes: 2 additions & 2 deletions examples/scalar-advdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ def main(actx_class, use_overintegration=False, use_esdg=False,
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

def _limit_fluid_cv(cv, temperature_seed=None, gas_model=None, dd=None):
actx = cv.array_context
Expand Down
4 changes: 2 additions & 2 deletions examples/scalar-lump.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from functools import partial
from pytools.obj_array import make_obj_array

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
from meshmode.mesh import BTAG_ALL, BTAG_NONE # noqa
from grudge.shortcuts import make_visualizer

Expand Down Expand Up @@ -141,7 +141,7 @@ def main(actx_class, use_leap=False, casename=None,
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

vis_timer = None

Expand Down
4 changes: 2 additions & 2 deletions examples/sod.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ def main(actx_class, use_overintegration=False, use_esdg=False,
current_dt = actx.to_numpy(
current_cfl * op.nodal_min(dcoll, "vol", nodal_h))[()]

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

vis_timer = None

Expand Down
5 changes: 2 additions & 3 deletions examples/taylor-green.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,14 @@ def main(actx_class, order=1, t_final=1, resolution=4,
generate_mesh)
local_nelements = local_mesh.nelements

from grudge.dof_desc import DISCR_TAG_QUAD

dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

vis_timer = None

Expand Down
4 changes: 2 additions & 2 deletions examples/vortex.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ def main(actx_class, use_overintegration=False, use_esdg=False,
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_QUAD
from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
if use_overintegration:
quadrature_tag = DISCR_TAG_QUAD
else:
quadrature_tag = None
quadrature_tag = DISCR_TAG_BASE

vis_timer = None

Expand Down
Loading

0 comments on commit cf52d8e

Please sign in to comment.