diff --git a/meshmode/mesh/generation.py b/meshmode/mesh/generation.py index ca5ddfb4f5d46f1b1a92c66983ca383129e572e1..4fa520bc4d7a62a4dfb27f55025ff9d906b52a0f 100644 --- a/meshmode/mesh/generation.py +++ b/meshmode/mesh/generation.py @@ -446,7 +446,7 @@ def generate_icosphere(r, order, uniform_refinement_rounds=0): mesh = generate_icosahedron(r, order) if uniform_refinement_rounds: - # These come out conformal, so we're OK to use the faster refiner. + # These come out conforming, so we're OK to use the faster refiner. from meshmode.mesh.refinement import RefinerWithoutAdjacency refiner = RefinerWithoutAdjacency(mesh) for i in range(uniform_refinement_rounds): diff --git a/meshmode/mesh/refinement/no_adjacency.py b/meshmode/mesh/refinement/no_adjacency.py index f37f66215ded63f530db8d5a2cb465d38771b5db..87f843d3ac052ebbb39b20d85deeb76445b2c5db 100644 --- a/meshmode/mesh/refinement/no_adjacency.py +++ b/meshmode/mesh/refinement/no_adjacency.py @@ -238,6 +238,8 @@ class RefinerWithoutAdjacency(object): global_midpoint = inew_vertex additional_vertices.append( midpoints[old_iel][:, imidpoint]) + self.global_vertex_pair_to_midpoint[ + global_v1, global_v2] = global_midpoint inew_vertex += 1 refining_vertices[iref_midpoint] = global_midpoint diff --git a/test/test_refinement.py b/test/test_refinement.py index 5e10a9462ae7b1aa195227a58950ec69482775ff..2bc29e89266f4e7a5ae824335d719cb259412ea6 100644 --- a/test/test_refinement.py +++ b/test/test_refinement.py @@ -294,7 +294,7 @@ def test_refinement_connection( @pytest.mark.parametrize("with_adjacency", [True, False]) -def test_uniform_refinement(ctx_factory, with_adjacency): +def test_uniform_refinement(with_adjacency): make_mesh = partial(generate_box_mesh, ( np.linspace(0.0, 1.0, 2), np.linspace(0.0, 1.0, 3), @@ -305,6 +305,18 @@ def test_uniform_refinement(ctx_factory, with_adjacency): mesh = refine_uniformly(mesh, 1, with_adjacency=with_adjacency) +@pytest.mark.parametrize("refinement_rounds", [0, 1, 2]) +def test_conformity_of_uniform_mesh(refinement_rounds): + from meshmode.mesh.generation import generate_icosphere + mesh = generate_icosphere(r=1.0, order=4, + uniform_refinement_rounds=refinement_rounds) + + assert mesh.is_conforming + + from meshmode.mesh import is_boundary_tag_empty, BTAG_ALL + assert is_boundary_tag_empty(mesh, BTAG_ALL) + + if __name__ == "__main__": import sys if len(sys.argv) > 1: