diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..dcbc21d86f9e4b17ea7e8803d538c4c0f0b6276a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,32 @@ +# https://editorconfig.org/ +# https://github.com/editorconfig/editorconfig-vim +# https://github.com/editorconfig/editorconfig-emacs + +root = true + +[*] +indent_style = space +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.py] +indent_size = 4 + +[*.rst] +indent_size = 4 + +[*.cpp] +indent_size = 2 + +[*.hpp] +indent_size = 2 + +# There may be one in doc/ +[Makefile] +indent_style = tab + +# https://github.com/microsoft/vscode/issues/1679 +[*.md] +trim_trailing_whitespace = false 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/setup.py b/setup.py index dd63663dc010dd920acafe5acb9062799e22e795..55a523ca5cf961abd0c8bfb9b70c35f0898b0b5e 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ def main(): ], packages=find_packages(), + python_requires="~=3.6", install_requires=[ "numpy", "modepy", 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: