diff --git a/meshmode/discretization/connection/opposite_face.py b/meshmode/discretization/connection/opposite_face.py index 0df3521f8a8632d8275761be5804a9f391f39de1..ebb51526e2fb77d2d3a4036693078a08f1e3c5b1 100644 --- a/meshmode/discretization/connection/opposite_face.py +++ b/meshmode/discretization/connection/opposite_face.py @@ -235,8 +235,7 @@ def _make_cross_face_batches(queue, tgt_bdry_discr, src_bdry_discr, unit_node_dist = np.max(np.max(np.abs( src_unit_nodes[:, todo_elements, :] - - - template_unit_nodes.reshape(dim, 1, -1)), + - template_unit_nodes.reshape(dim, 1, -1)), axis=2), axis=0) close_els = todo_elements[unit_node_dist < tol] @@ -244,8 +243,7 @@ def _make_cross_face_batches(queue, tgt_bdry_discr, src_bdry_discr, unit_node_dist = np.max(np.max(np.abs( src_unit_nodes[:, todo_elements, :] - - - template_unit_nodes.reshape(dim, 1, -1)), + - template_unit_nodes.reshape(dim, 1, -1)), axis=2), axis=0) from meshmode.discretization.connection import InterpolationBatch diff --git a/meshmode/mesh/processing.py b/meshmode/mesh/processing.py index ea72facf2fea4718d496d2e617a9aff2f6a9cb32..2094c99bd9dbe0f0db29b2fe7253c8796eedc149 100644 --- a/meshmode/mesh/processing.py +++ b/meshmode/mesh/processing.py @@ -190,8 +190,8 @@ def partition_mesh(mesh, part_per_element, part_num): for parent_facial_group in parent_adj.values(): indices, = np.nonzero(parent_facial_group.elements == parent_elem) for idx in indices: - if (parent_facial_group.neighbors[idx] >= 0 and - parent_facial_group.element_faces[idx] == face): + if (parent_facial_group.neighbors[idx] >= 0 + and parent_facial_group.element_faces[idx] == face): rank_neighbor = (parent_facial_group.neighbors[idx] + parent_elem_base) n_face = parent_facial_group.neighbor_faces[idx] diff --git a/meshmode/mesh/refinement/utils.py b/meshmode/mesh/refinement/utils.py index 08b71f8755f4f270756c904d8d5a592e753cb30c..2811d3ac155595751c742198ccccaad6cc9fcb60 100644 --- a/meshmode/mesh/refinement/utils.py +++ b/meshmode/mesh/refinement/utils.py @@ -126,10 +126,10 @@ def check_nodal_adj_against_geometry(mesh, tol=1e-12): np.linalg.lstsq(transformation, vertex_transformed)[0:2] is_in_element_span = ( - residual.size == 0 or - np.linalg.norm(vertex_transformed) == 0 or - (np.linalg.norm(residual) / - np.linalg.norm(vertex_transformed)) <= tol) + residual.size == 0 + or np.linalg.norm(vertex_transformed) == 0 + or (np.linalg.norm(residual) + / np.linalg.norm(vertex_transformed)) <= tol) is_connected = ( is_in_element_span diff --git a/meshmode/mesh/visualization.py b/meshmode/mesh/visualization.py index 53da2663ca76b5499456279a4cabb45cc963141c..afee1b3419103909ac790b78d83d58348a104e45 100644 --- a/meshmode/mesh/visualization.py +++ b/meshmode/mesh/visualization.py @@ -130,8 +130,7 @@ def draw_2d_mesh(mesh, draw_vertex_numbers=True, draw_element_numbers=True, for iface, fvi in enumerate(grp.face_vertex_indices()): face_center = ( 0.3*el_center - + - 0.7*np.mean(elverts[:, fvi], axis=-1)) + + 0.7*np.mean(elverts[:, fvi], axis=-1)) pt.text(face_center[0], face_center[1], str(iface), fontsize=12, ha="center", va="center", color="purple", diff --git a/test/test_meshmode.py b/test/test_meshmode.py index d90f1a49359943c656ee24c15a41bd0c4b285333..e14da4e5d091ff8e8567def836b999688b89b273 100644 --- a/test/test_meshmode.py +++ b/test/test_meshmode.py @@ -88,7 +88,7 @@ def test_circle_mesh(do_plot=False): FACE_RESTR_INTERIOR, ]) @pytest.mark.parametrize(("mesh_name", "dim", "mesh_pars"), [ - ("blob", 2, [8e-2, 4e-2, 2e-2]), + ("blob", 2, [8e-2, 4e-2, 1e-2]), ("warp", 2, [10, 20, 30]), ("warp", 3, [10, 20, 30]), ]) @@ -165,9 +165,10 @@ def test_boundary_interpolation(ctx_factory, group_factory, boundary_tag, err = la.norm((bdry_f-bdry_f_2).get(), np.inf) eoc_rec.add_data_point(h, err) + order_slack = 0.75 if mesh_name == "blob" else 0.5 print(eoc_rec) assert ( - eoc_rec.order_estimate() >= order-0.5 + eoc_rec.order_estimate() >= order-order_slack or eoc_rec.max_error() < 1e-14) # }}} diff --git a/test/test_partition.py b/test/test_partition.py index 8ff25caa8e4a80c14c927a851de70d14d98c576a..54b9d88923249b553c334a278744e2f51ab14c44 100644 --- a/test/test_partition.py +++ b/test/test_partition.py @@ -299,8 +299,8 @@ def test_partition_mesh(num_parts, num_meshes, dim, scramble_partitions): f_groups = mesh.facial_adjacency_groups[p_grp_num] for p_bnd_adj in f_groups.values(): for idx in range(len(p_bnd_adj.elements)): - if (p_elem == p_bnd_adj.elements[idx] and - face == p_bnd_adj.element_faces[idx]): + if (p_elem == p_bnd_adj.elements[idx] + and face == p_bnd_adj.element_faces[idx]): assert p_n_elem == p_bnd_adj.neighbors[idx],\ "Tag does not give correct neighbor" assert n_face == p_bnd_adj.neighbor_faces[idx],\