diff --git a/meshmode/mesh/__init__.py b/meshmode/mesh/__init__.py index 1d2fbfcfa02885681ebc5e189e25dc1dfe91e694..3bbf2c2c8804d3acb05897e9f7f7e46c6fe68daa 100644 --- a/meshmode/mesh/__init__.py +++ b/meshmode/mesh/__init__.py @@ -226,9 +226,8 @@ class MeshElementGroup(Record): return self.unit_nodes.shape[-1] @property - @memoize_method def is_affine(self): - return is_affine_group(self) + raise NotImplementedError() def face_vertex_indices(self): """Return a tuple of tuples indicating which vertices @@ -310,6 +309,11 @@ class SimplexElementGroup(MeshElementGroup): super(SimplexElementGroup, self).__init__(order, vertex_indices, nodes, element_nr_base, node_nr_base, unit_nodes, dim) + @property + @memoize_method + def is_affine(self): + return is_affine_simplex_group(self) + def face_vertex_indices(self): if self.dim == 1: return ( @@ -1361,10 +1365,14 @@ def is_boundary_tag_empty(mesh, boundary_tag): # {{{ -def is_affine_group(group, abs_tol=None): +def is_affine_simplex_group(group, abs_tol=None): if abs_tol is None: abs_tol = 1.0e-13 + if not isinstance(group, SimplexElementGroup): + raise TypeError("expected a 'SimplexElementGroup' not '%s'" % + type(group).__name__) + # get matrices basis = mp.simplex_best_available_basis(group.dim, group.order) grad_basis = mp.grad_simplex_best_available_basis(group.dim, group.order) diff --git a/test/test_meshmode.py b/test/test_meshmode.py index 79c462b9ae6fbd434673c93239fa991fc556bfe0..77a25cd5dd4de07e1207ca137ec5b1510d268a84 100644 --- a/test/test_meshmode.py +++ b/test/test_meshmode.py @@ -1234,7 +1234,7 @@ def test_is_affine_group_check(mesh_name): generate_icosphere, generate_torus) order = 4 - nelements = 32 + nelements = 16 if mesh_name.startswith("box"): dim = int(mesh_name[-2])