Skip to content
Snippets Groups Projects
Commit 3eb5d7fb authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Merge branch 'test-fix-refiner-vertex-duplication' into 'master'

Test, fix that no-adjacency refiner produces a properly conformal mesh when it promises it will

See merge request !86
parents f733bb4d 6b839db8
No related branches found
No related tags found
1 merge request!86Test, fix that no-adjacency refiner produces a properly conformal mesh when it promises it will
Pipeline #37799 passed
......@@ -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):
......
......@@ -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
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment