diff --git a/grudge/execution.py b/grudge/execution.py index a651226fa2c5b99bbdf9a3349f21220d7f4b4f04..59276ec05aabfcdc0eaee55f93749be07318086f 100644 --- a/grudge/execution.py +++ b/grudge/execution.py @@ -755,9 +755,7 @@ def process_sym_operator(discrwb, sym_operator, post_bind_mapper=None, dumper=No )(sym_operator) dumper("before-global-to-reference", sym_operator) - sym_operator = mappers.GlobalToReferenceMapper( - discrwb.ambient_dim, - dim=discrwb.dim)(sym_operator) + sym_operator = mappers.GlobalToReferenceMapper(discrwb)(sym_operator) dumper("before-distributed", sym_operator) diff --git a/grudge/symbolic/mappers/__init__.py b/grudge/symbolic/mappers/__init__.py index e8a63c1c697ae964689459ce1a056ef7fc0c8d0e..ebc771f9a82424b8711cd69741f1c265fea84f50 100644 --- a/grudge/symbolic/mappers/__init__.py +++ b/grudge/symbolic/mappers/__init__.py @@ -587,18 +587,15 @@ class GlobalToReferenceMapper(CSECachingMapperMixin, IdentityMapper): reference elements, together with explicit multiplication by geometric factors. """ - def __init__(self, ambient_dim, dim=None): + def __init__(self, discrwb): CSECachingMapperMixin.__init__(self) IdentityMapper.__init__(self) - if dim is None: - dim = ambient_dim + self.ambient_dim = discrwb.ambient_dim + self.dim = discrwb.dim - self.ambient_dim = ambient_dim - self.dim = dim - - # NOTE: only use WADG on surfaces at the moment - self.use_wadg = self.ambient_dim == (self.dim + 1) + volume_discr = discrwb.discr_from_dd(sym.DD_VOLUME) + self.use_wadg = not all(grp.is_affine for grp in volume_discr.groups) map_common_subexpression_uncached = \ IdentityMapper.map_common_subexpression