From ca94f9fc4e855b7e4a0929c5a981fdd79910fc06 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl <alexfikl@gmail.com> Date: Sun, 17 May 2020 15:49:19 -0500 Subject: [PATCH] specialize is_affine_check for simplex meshes for now --- meshmode/mesh/__init__.py | 14 +++++++++++--- test/test_meshmode.py | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/meshmode/mesh/__init__.py b/meshmode/mesh/__init__.py index 1d2fbfcf..3bbf2c2c 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 79c462b9..77a25cd5 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]) -- GitLab