From 9809d2acc7d64bda11d84aab7f4b5577099491db Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 6 Oct 2015 15:23:33 -0500 Subject: [PATCH] TAG_{ALL,NONE} replaces --- examples/wave/wave-min.py | 2 +- grudge/models/em.py | 10 +++++----- grudge/models/wave.py | 14 +++++++------- grudge/symbolic/primitives.py | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/wave/wave-min.py b/examples/wave/wave-min.py index d6dd94ff..28b19110 100644 --- a/examples/wave/wave-min.py +++ b/examples/wave/wave-min.py @@ -47,7 +47,7 @@ def main(write_output=True): sym_source_center_dist = sym_x - source_center from grudge.models.wave import StrongWaveOperator - from grudge.mesh import TAG_ALL, TAG_NONE + from meshmode.mesh import BTAG_ALL, BTAG_NONE op = StrongWaveOperator(-0.1, discr.dimensions, source_f=( sym.CFunction("sin")(source_omega*sym.ScalarParameter("t")) diff --git a/grudge/models/em.py b/grudge/models/em.py index 3929c6ac..3575e425 100644 --- a/grudge/models/em.py +++ b/grudge/models/em.py @@ -49,10 +49,10 @@ class MaxwellOperator(HyperbolicOperator): def __init__(self, epsilon, mu, flux_type, bdry_flux_type=None, - pec_tag=grudge.mesh.TAG_ALL, - pmc_tag=grudge.mesh.TAG_NONE, - absorb_tag=grudge.mesh.TAG_NONE, - incident_tag=grudge.mesh.TAG_NONE, + pec_tag=BTAG_ALL, + pmc_tag=BTAG_NONE, + absorb_tag=BTAG_NONE, + incident_tag=BTAG_NONE, incident_bc=lambda maxwell_op, e, h: 0, current=0, dimensions=None): """ :arg flux_type: can be in [0,1] for anything between central and upwind, @@ -294,7 +294,7 @@ class MaxwellOperator(HyperbolicOperator): e, h = self.split_eh(self.field_placeholder(w)) if not self.fixed_material: from warnings import warn - if self.incident_tag != grudge.mesh.TAG_NONE: + if self.incident_tag != BTAG_NONE: warn("Incident boundary conditions assume homogeneous" " background material, results may be unphysical") diff --git a/grudge/models/wave.py b/grudge/models/wave.py index 5c0f3a32..f483e921 100644 --- a/grudge/models/wave.py +++ b/grudge/models/wave.py @@ -28,9 +28,9 @@ THE SOFTWARE. import numpy as np -import grudge.mesh from grudge.models import HyperbolicOperator from grudge.second_order import CentralSecondDerivative +from meshmode.mesh import BTAG_ALL, BTAG_NONE # {{{ constant-velocity @@ -55,10 +55,10 @@ class StrongWaveOperator(HyperbolicOperator): def __init__(self, c, dimensions, source_f=0, flux_type="upwind", - dirichlet_tag=grudge.mesh.TAG_ALL, + dirichlet_tag=BTAG_ALL, dirichlet_bc_f=0, - neumann_tag=grudge.mesh.TAG_NONE, - radiation_tag=grudge.mesh.TAG_NONE): + neumann_tag=BTAG_NONE, + radiation_tag=BTAG_NONE): assert isinstance(dimensions, int) self.c = c @@ -218,9 +218,9 @@ class VariableVelocityStrongWaveOperator(HyperbolicOperator): def __init__( self, c, dimensions, source=0, flux_type="upwind", - dirichlet_tag=grudge.mesh.TAG_ALL, - neumann_tag=grudge.mesh.TAG_NONE, - radiation_tag=grudge.mesh.TAG_NONE, + dirichlet_tag=BTAG_ALL, + neumann_tag=BTAG_NONE, + radiation_tag=BTAG_NONE, time_sign=1, diffusion_coeff=None, diffusion_scheme=CentralSecondDerivative() diff --git a/grudge/symbolic/primitives.py b/grudge/symbolic/primitives.py index aba3c746..8ce50cc8 100644 --- a/grudge/symbolic/primitives.py +++ b/grudge/symbolic/primitives.py @@ -136,7 +136,7 @@ class BoundaryPair(LeafBase): application of boundary fluxes. """ - def __init__(self, field, bfield, tag=grudge.mesh.TAG_ALL): + def __init__(self, field, bfield, tag=BTAG_ALL): self.field = field self.bfield = bfield self.tag = tag -- GitLab