diff --git a/meshmode/discretization/connection/__init__.py b/meshmode/discretization/connection/__init__.py index 4a56722fc99adc7aac5ec661ad904b35b21f6805..bb5a0bf90d07591f27846e9448a0675171833f95 100644 --- a/meshmode/discretization/connection/__init__.py +++ b/meshmode/discretization/connection/__init__.py @@ -32,7 +32,7 @@ from pytools import memoize_method, memoize_in from meshmode.discretization.connection.same_mesh import \ make_same_mesh_connection from meshmode.discretization.connection.face import ( - FRESTR_INTERIOR_FACES, FRESTR_ALL_FACES, + FACE_RESTR_INTERIOR, FACE_RESTR_ALL, make_face_restriction, make_face_to_all_faces_embedding) from meshmode.discretization.connection.opposite_face import \ make_opposite_face_connection @@ -47,7 +47,7 @@ logger = logging.getLogger(__name__) __all__ = [ "DiscretizationConnection", "make_same_mesh_connection", - "FRESTR_INTERIOR_FACES", "FRESTR_ALL_FACES", + "FACE_RESTR_INTERIOR", "FACE_RESTR_ALL", "make_face_restriction", "make_face_to_all_faces_embedding", "make_opposite_face_connection", @@ -60,8 +60,8 @@ __doc__ = """ .. autofunction:: make_same_mesh_connection -.. autodata:: FRESTR_INTERIOR_FACES -.. autodata:: FRESTR_ALL_FACES +.. autofunction:: FACE_RESTR_INTERIOR +.. autofunction:: FACE_RESTR_ALL .. autofunction:: make_face_restriction .. autofunction:: make_face_to_all_faces_embedding diff --git a/meshmode/discretization/connection/face.py b/meshmode/discretization/connection/face.py index fce3972c5a286b88dfe6fb08c407e5b72670833c..6ff6d0ca8a78e1c762af028b7d4976673c03c444 100644 --- a/meshmode/discretization/connection/face.py +++ b/meshmode/discretization/connection/face.py @@ -36,7 +36,7 @@ import logging logger = logging.getLogger(__name__) -class FRESTR_INTERIOR_FACES: # noqa +class FACE_RESTR_INTERIOR: # noqa """A special value to pass to :func:`meshmode.discretization.connection.make_face_restriction` to produce a discretization consisting of all interior faces @@ -44,7 +44,7 @@ class FRESTR_INTERIOR_FACES: # noqa """ -class FRESTR_ALL_FACES: # noqa +class FACE_RESTR_ALL: # noqa """A special value to pass to :func:`meshmode.discretization.connection.make_face_restriction` to produce a discretization consisting of all faces (interior and boundary) @@ -52,6 +52,11 @@ class FRESTR_ALL_FACES: # noqa """ +# deprecated names for compatibility +FRESTR_ALL_FACES = FACE_RESTR_ALL +FRESTR_INTERIOR_FACES = FACE_RESTR_INTERIOR + + # {{{ boundary connection class _ConnectionBatchData(Record): @@ -118,7 +123,7 @@ def _get_face_vertices(mesh, boundary_tag): # a set of volume vertex numbers bdry_vertex_vol_nrs = set() - if boundary_tag not in [FRESTR_INTERIOR_FACES, FRESTR_ALL_FACES]: + if boundary_tag not in [FACE_RESTR_INTERIOR, FACE_RESTR_ALL]: # {{{ boundary faces btag_bit = mesh.boundary_tag_bit(boundary_tag) @@ -191,7 +196,7 @@ def make_face_restriction(discr, group_factory, boundary_tag, """ if boundary_tag is None: - boundary_tag = FRESTR_INTERIOR_FACES + boundary_tag = FACE_RESTR_INTERIOR from warnings import warn warn("passing *None* for boundary_tag is deprecated--pass " "FRESTR_INTERIOR_FACES instead", @@ -233,7 +238,7 @@ def make_face_restriction(discr, group_factory, boundary_tag, group_boundary_faces = [] - if boundary_tag is FRESTR_INTERIOR_FACES: + if boundary_tag is FACE_RESTR_INTERIOR: for fagrp in six.itervalues(fagrp_map): if fagrp.ineighbor_group is None: # boundary faces -> not looking for those @@ -242,7 +247,7 @@ def make_face_restriction(discr, group_factory, boundary_tag, group_boundary_faces.extend( zip(fagrp.elements, fagrp.element_faces)) - elif boundary_tag is FRESTR_ALL_FACES: + elif boundary_tag is FACE_RESTR_ALL: group_boundary_faces.extend( (iel, iface) for iface in range(grp.mesh_el_group.nfaces) @@ -392,12 +397,12 @@ def make_face_to_all_faces_embedding(faces_connection, all_faces_discr): :arg faces_connection: must be the (connection) result of calling :func:`meshmode.discretization.connection.make_face_restriction` with - :class:`meshmode.discretization.connection.FRESTR_INTERIOR_FACES` + :class:`meshmode.discretization.connection.FACE_RESTR_INTERIOR` or a boundary tag. :arg all_faces_discr: must be the (discretization) result of calling :func:`meshmode.discretization.connection.make_face_restriction` with - :class:`meshmode.discretization.connection.FRESTR_ALL_FACES` + :class:`meshmode.discretization.connection.FACE_RESTR_ALL` for the same volume discretization as the one from which *faces_discr* was obtained. """ diff --git a/test/test_meshmode.py b/test/test_meshmode.py index c8e28228fca44e1dfa8de5bd561e083b3ad5c9ab..2cb0470a0656d5d46242efdea2e23c9df2d31f87 100644 --- a/test/test_meshmode.py +++ b/test/test_meshmode.py @@ -40,7 +40,7 @@ from meshmode.discretization.poly_element import ( ) from meshmode.mesh import BTAG_ALL from meshmode.discretization.connection import \ - FRESTR_ALL_FACES, FRESTR_INTERIOR_FACES + FACE_RESTR_ALL, FACE_RESTR_INTERIOR import meshmode.mesh.generation as mgen import pytest @@ -133,8 +133,8 @@ def test_circle_mesh(do_plot=False): ]) @pytest.mark.parametrize("boundary_tag", [ BTAG_ALL, - FRESTR_ALL_FACES, - FRESTR_INTERIOR_FACES, + FACE_RESTR_ALL, + FACE_RESTR_INTERIOR, ]) @pytest.mark.parametrize(("mesh_name", "dim", "mesh_pars"), [ ("blob", 2, [1e-1, 8e-2, 5e-2]), @@ -282,7 +282,7 @@ def test_all_faces_interpolation(ctx_getter, mesh_name, dim, mesh_pars, all_face_bdry_connection = make_face_restriction( vol_discr, PolynomialWarpAndBlendGroupFactory(order), - FRESTR_ALL_FACES, per_face_groups=per_face_groups) + FACE_RESTR_ALL, per_face_groups=per_face_groups) all_face_bdry_discr = all_face_bdry_connection.to_discr for ito_grp, ceg in enumerate(all_face_bdry_connection.groups): @@ -303,7 +303,7 @@ def test_all_faces_interpolation(ctx_getter, mesh_name, dim, mesh_pars, for boundary_tag in [ BTAG_ALL, - FRESTR_INTERIOR_FACES, + FACE_RESTR_INTERIOR, ]: bdry_connection = make_face_restriction( vol_discr, PolynomialWarpAndBlendGroupFactory(order), @@ -396,7 +396,7 @@ def test_opposite_face_interpolation(ctx_getter, group_factory, bdry_connection = make_face_restriction( vol_discr, group_factory(order), - FRESTR_INTERIOR_FACES) + FACE_RESTR_INTERIOR) bdry_discr = bdry_connection.to_discr opp_face = make_opposite_face_connection(bdry_connection)