From d4fd239f643d6d15d232d987fac3fd7d9d760aab Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 5 Nov 2017 07:54:11 -0600 Subject: [PATCH] Rename FRESTR symbols to something more self-explanatory (thanks @eshoag2) --- grudge/discretization.py | 8 ++++---- grudge/execution.py | 14 +++++++------- grudge/symbolic/mappers/__init__.py | 8 ++++---- grudge/symbolic/operators.py | 8 ++++---- grudge/symbolic/primitives.py | 18 +++++++++--------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/grudge/discretization.py b/grudge/discretization.py index 50e112de..3df2fb30 100644 --- a/grudge/discretization.py +++ b/grudge/discretization.py @@ -116,11 +116,11 @@ class Discretization(DiscretizationBase): raise NotImplementedError("quadrature") from meshmode.discretization.connection import ( - make_face_restriction, FRESTR_INTERIOR_FACES) + make_face_restriction, FACE_RESTR_INTERIOR) return make_face_restriction( self.volume_discr, PolynomialWarpAndBlendGroupFactory(order=self.order), - FRESTR_INTERIOR_FACES, + FACE_RESTR_INTERIOR, # FIXME: This will need to change as soon as we support # pyramids or other elements with non-identical face @@ -155,11 +155,11 @@ class Discretization(DiscretizationBase): from meshmode.discretization.poly_element import \ PolynomialWarpAndBlendGroupFactory from meshmode.discretization.connection import ( - make_face_restriction, FRESTR_ALL_FACES) + make_face_restriction, FACE_RESTR_ALL) return make_face_restriction( self.volume_discr, PolynomialWarpAndBlendGroupFactory(order=self.order), - FRESTR_ALL_FACES, + FACE_RESTR_ALL, # FIXME: This will need to change as soon as we support # pyramids or other elements with non-identical face diff --git a/grudge/execution.py b/grudge/execution.py index ace2dc8b..84fb24c5 100644 --- a/grudge/execution.py +++ b/grudge/execution.py @@ -59,9 +59,9 @@ class ExecutionMapper(mappers.Evaluator, raise NotImplementedError("quadrature") return self.discr.volume_discr - elif dd.domain_tag is sym.FRESTR_ALL_FACES: + elif dd.domain_tag is sym.FACE_RESTR_ALL: return self.discr.all_faces_discr(qtag) - elif dd.domain_tag is sym.FRESTR_INTERIOR_FACES: + elif dd.domain_tag is sym.FACE_RESTR_INTERIOR: return self.discr.interior_faces_discr(qtag) elif dd.is_boundary(): return self.discr.boundary_discr(dd.domain_tag, qtag) @@ -249,17 +249,17 @@ class ExecutionMapper(mappers.Evaluator, qtag = sym.QTAG_NONE if dd_in.is_volume(): - if dd_out.domain_tag is sym.FRESTR_ALL_FACES: + if dd_out.domain_tag is sym.FACE_RESTR_ALL: conn = self.discr.all_faces_connection(qtag) - elif dd_out.domain_tag is sym.FRESTR_INTERIOR_FACES: + elif dd_out.domain_tag is sym.FACE_RESTR_INTERIOR: conn = self.discr.interior_faces_connection(qtag) elif dd_out.is_boundary(): conn = self.discr.boundary_connection(dd_out.domain_tag, qtag) else: raise ValueError("cannot interpolate from volume to: " + str(dd_out)) - elif dd_in.domain_tag is sym.FRESTR_INTERIOR_FACES: - if dd_out.domain_tag is sym.FRESTR_ALL_FACES: + elif dd_in.domain_tag is sym.FACE_RESTR_INTERIOR: + if dd_out.domain_tag is sym.FACE_RESTR_ALL: conn = self.discr.all_faces_connection(None, qtag) else: raise ValueError( @@ -267,7 +267,7 @@ class ExecutionMapper(mappers.Evaluator, + str(dd_out)) elif dd_in.is_boundary(): - if dd_out.domain_tag is sym.FRESTR_ALL_FACES: + if dd_out.domain_tag is sym.FACE_RESTR_ALL: conn = self.discr.all_faces_connection(dd_in.domain_tag, qtag) else: raise ValueError( diff --git a/grudge/symbolic/mappers/__init__.py b/grudge/symbolic/mappers/__init__.py index 60b489ce..0fd8fbd1 100644 --- a/grudge/symbolic/mappers/__init__.py +++ b/grudge/symbolic/mappers/__init__.py @@ -572,16 +572,16 @@ class StringifyMapper(pymbolic.mapper.stringifier.StringifyMapper): return repr(s) from meshmode.discretization.connection import ( - FRESTR_ALL_FACES, FRESTR_INTERIOR_FACES) + FACE_RESTR_ALL, FACE_RESTR_INTERIOR) if dd.domain_tag is None: result = "?" elif dd.domain_tag is sym.DTAG_VOLUME_ALL: result = "vol" elif dd.domain_tag is sym.DTAG_SCALAR: result = "scalar" - elif dd.domain_tag is FRESTR_ALL_FACES: + elif dd.domain_tag is FACE_RESTR_ALL: result = "all_faces" - elif dd.domain_tag is FRESTR_INTERIOR_FACES: + elif dd.domain_tag is FACE_RESTR_INTERIOR: result = "int_faces" else: result = fmt(dd.domain_tag) @@ -847,7 +847,7 @@ class EmptyFluxKiller(CSECachingMapperMixin, IdentityMapper): if (isinstance(expr.op, sym.InterpolationOperator) and expr.op.dd_out.is_boundary() and expr.op.dd_out.domain_tag not in [ - sym.FRESTR_ALL_FACES, sym.FRESTR_INTERIOR_FACES] + sym.FACE_RESTR_ALL, sym.FACE_RESTR_INTERIOR] and is_boundary_tag_empty(self.mesh, expr.op.dd_out.domain_tag)): return 0 diff --git a/grudge/symbolic/operators.py b/grudge/symbolic/operators.py index dc2e4fa1..34ec47aa 100644 --- a/grudge/symbolic/operators.py +++ b/grudge/symbolic/operators.py @@ -384,11 +384,11 @@ class OppositeInteriorFaceSwap(Operator): sym = _sym() if dd_in is None: - dd_in = sym.DOFDesc(sym.FRESTR_INTERIOR_FACES, None) + dd_in = sym.DOFDesc(sym.FACE_RESTR_INTERIOR, None) if dd_out is None: dd_out = dd_in - if dd_in.domain_tag is not sym.FRESTR_INTERIOR_FACES: + if dd_in.domain_tag is not sym.FACE_RESTR_INTERIOR: raise ValueError("dd_in must be an interior faces domain") if dd_out != dd_in: raise ValueError("dd_out and dd_in must be identical") @@ -403,7 +403,7 @@ class FaceMassOperatorBase(ElementwiseLinearOperator): sym = _sym() if dd_in is None: - dd_in = sym.DOFDesc(sym.FRESTR_ALL_FACES, None) + dd_in = sym.DOFDesc(sym.FACE_RESTR_ALL, None) if dd_out is None: dd_out = sym.DOFDesc("vol", sym.QTAG_NONE) @@ -413,7 +413,7 @@ class FaceMassOperatorBase(ElementwiseLinearOperator): if not dd_out.is_volume(): raise ValueError("dd_out must be a volume domain") - if dd_in.domain_tag is not sym.FRESTR_ALL_FACES: + if dd_in.domain_tag is not sym.FACE_RESTR_ALL: raise ValueError("dd_in must be an interior faces domain") super(FaceMassOperatorBase, self).__init__(dd_in, dd_out) diff --git a/grudge/symbolic/primitives.py b/grudge/symbolic/primitives.py index 11d5ae8a..2f3e8787 100644 --- a/grudge/symbolic/primitives.py +++ b/grudge/symbolic/primitives.py @@ -30,7 +30,7 @@ import numpy as np import pymbolic.primitives from meshmode.mesh import BTAG_ALL, BTAG_REALLY_ALL, BTAG_NONE # noqa from meshmode.discretization.connection import ( # noqa - FRESTR_ALL_FACES, FRESTR_INTERIOR_FACES) + FACE_RESTR_ALL, FACE_RESTR_INTERIOR) from pymbolic.primitives import ( # noqa cse_scope as cse_scope_base, @@ -145,10 +145,10 @@ class DOFDesc(object): :class:`grudge.sym.DTAG_SCALAR` (or the string ``"scalar"``), :class:`grudge.sym.DTAG_VOLUME_ALL` (or the string ``"vol"``) for the default volume discretization, - :class:`meshmode.discretization.connection.FRESTR_ALL_FACES` + :class:`meshmode.discretization.connection.FACE_RESTR_ALL` (or the string ``"all_faces"``), or - :class:`meshmode.discretization.connection.FRESTR_INTERIOR_FACES` + :class:`meshmode.discretization.connection.FACE_RESTR_INTERIOR` (or the string ``"int_faces"``), or one of :class:`meshmode.discretization.BTAG_ALL`, @@ -172,12 +172,12 @@ class DOFDesc(object): elif domain_tag is DTAG_VOLUME_ALL: pass elif domain_tag == "all_faces": - domain_tag = FRESTR_ALL_FACES - elif domain_tag is FRESTR_ALL_FACES: + domain_tag = FACE_RESTR_ALL + elif domain_tag is FACE_RESTR_ALL: pass elif domain_tag == "int_faces": - domain_tag = FRESTR_INTERIOR_FACES - elif domain_tag is FRESTR_INTERIOR_FACES: + domain_tag = FACE_RESTR_INTERIOR + elif domain_tag is FACE_RESTR_INTERIOR: pass elif domain_tag is None: pass @@ -215,8 +215,8 @@ class DOFDesc(object): def is_trace(self): return (self.is_boundary() or self.domain_tag in [ - FRESTR_ALL_FACES, - FRESTR_INTERIOR_FACES]) + FACE_RESTR_ALL, + FACE_RESTR_INTERIOR]) def uses_quadrature(self): if self.quadrature_tag is None: -- GitLab