diff --git a/examples/wave/wave-op-mpi.py b/examples/wave/wave-op-mpi.py index a8db90a5..6f2f1cda 100644 --- a/examples/wave/wave-op-mpi.py +++ b/examples/wave/wave-op-mpi.py @@ -41,9 +41,9 @@ from meshmode.dof_array import DOFArray from meshmode.mesh import BTAG_ALL, BTAG_NONE # noqa -from grudge.dof_desc import as_dofdesc, DOFDesc, DISCR_TAG_BASE, DISCR_TAG_QUAD +from grudge.dof_desc import as_dofdesc, DISCR_TAG_BASE, DISCR_TAG_QUAD from grudge.trace_pair import TracePair -from grudge.discretization import DiscretizationCollection +from grudge.discretization import make_discretization_collection from grudge.shortcuts import make_visualizer, compiled_lsrk45_step import grudge.op as op @@ -92,7 +92,7 @@ def wave_flux(actx, dcoll, c, w_tpair): v=0.5 * v_jump * normal, ) - return op.project(dcoll, dd, dd.with_dtag("all_faces"), c*flux_weak) + return op.project(dcoll, dd, dd.with_domain_tag("all_faces"), c*flux_weak) class _WaveStateTag: @@ -101,8 +101,8 @@ class _WaveStateTag: def wave_operator(actx, dcoll, c, w, quad_tag=None): dd_base = as_dofdesc("vol") - dd_vol = DOFDesc("vol", quad_tag) - dd_faces = DOFDesc("all_faces", quad_tag) + dd_vol = as_dofdesc("vol", quad_tag) + dd_faces = as_dofdesc("all_faces", quad_tag) dd_btag = as_dofdesc(BTAG_ALL).with_discr_tag(quad_tag) def interp_to_surf_quad(utpair): @@ -180,7 +180,8 @@ def bump(actx, dcoll, t=0): def main(ctx_factory, dim=2, order=3, - visualize=False, lazy=False, use_quad=False, use_nonaffine_mesh=False): + visualize=False, lazy=False, use_quad=False, use_nonaffine_mesh=False, + no_diagnostics=False): cl_ctx = ctx_factory() queue = cl.CommandQueue(cl_ctx) @@ -234,7 +235,7 @@ def main(ctx_factory, dim=2, order=3, from meshmode.discretization.poly_element import \ QuadratureSimplexGroupFactory, \ default_simplex_group_factory - dcoll = DiscretizationCollection( + dcoll = make_discretization_collection( actx, local_mesh, discr_tag_to_group_factory={ DISCR_TAG_BASE: default_simplex_group_factory(base_dim=dim, order=order), @@ -282,7 +283,7 @@ def rhs(t, w): if istep % 10 == 0: stop = time.time() - if args.no_diagnostics: + if no_diagnostics: if comm.rank == 0: logger.info(f"step: {istep} t: {t} " f"wall: {stop-start} ") @@ -340,6 +341,7 @@ def rhs(t, w): visualize=args.visualize, lazy=args.lazy, use_quad=args.quad, - use_nonaffine_mesh=args.nonaffine) + use_nonaffine_mesh=args.nonaffine, + no_diagnostics=args.no_diagnostics) # vim: foldmethod=marker diff --git a/grudge/dof_desc.py b/grudge/dof_desc.py index bdcc5fba..ba75f141 100644 --- a/grudge/dof_desc.py +++ b/grudge/dof_desc.py @@ -375,7 +375,7 @@ def as_identifier(self) -> str: raise ValueError(f"unexpected domain tag: '{self.domain_tag}'") if isinstance(self.discretization_tag, str): - discr_id = _to_identifier(name) + discr_id = _to_identifier(self.discretization_tag) elif issubclass(self.discretization_tag, DISCR_TAG_QUAD): discr_id = "_quad" elif self.discretization_tag is DISCR_TAG_BASE: