Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -24901,22 +24901,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 4,
"endColumn": 16,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 4,
"endColumn": 16,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
Expand Down
2 changes: 1 addition & 1 deletion meshmode/interop/firedrake/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def __init__(self, discr, fdrake_fspace, mm2fd_node_mapping, group_nr=None):

@memoize_method
def firedrake_fspace(self, shape=None):
"""
r"""
Return a firedrake function space that
*self.discr.groups[self.group_nr]* is connected to
of the appropriate vector dimension
Expand Down
2 changes: 1 addition & 1 deletion meshmode/interop/firedrake/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def _get_firedrake_orientations(fdrake_mesh, unflipped_group, vertices,

def import_firedrake_mesh(fdrake_mesh, cells_to_use=None,
normals=None, no_normals_warn=None):
"""
r"""
Create a :class:`meshmode.mesh.Mesh`
from a `firedrake.mesh.MeshGeometry`
with the same cells/elements, vertices, nodes,
Expand Down
4 changes: 2 additions & 2 deletions meshmode/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ def nodal_adjacency(self) -> NodalAdjacency:
)

nodal_adjacency = _compute_nodal_adjacency_from_vertices(self)
object.__setattr__(self, "_nodal_adjacency", nodal_adjacency)
object.__setattr__(self, "_nodal_adjacency", nodal_adjacency) # ruff: ignore[unnecessary-dunder-call]

return nodal_adjacency

Expand Down Expand Up @@ -1485,7 +1485,7 @@ def facial_adjacency_groups(

facial_adjacency_groups = _compute_facial_adjacency_from_vertices(
self.groups, self.element_id_dtype, self.face_id_dtype)
object.__setattr__(self, "_facial_adjacency_groups",
object.__setattr__(self, "_facial_adjacency_groups", # ruff: ignore[unnecessary-dunder-call]
facial_adjacency_groups)
else:
facial_adjacency_groups = fagrps_in
Expand Down
14 changes: 8 additions & 6 deletions meshmode/mesh/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,11 @@ def generate_icosahedron(
tris: list[list[int]] = []
m = len(top_ring)
for i in range(m):
tris.append([top_ring[i], top_ring[(i+1) % m], top_point])
tris.append([bottom_ring[i], bottom_point, bottom_ring[(i+1) % m], ])
tris.append([bottom_ring[i], bottom_ring[(i+1) % m], top_ring[i]])
tris.append([top_ring[i], bottom_ring[(i+1) % m], top_ring[(i+1) % m]])
tris.extend((
[top_ring[i], top_ring[(i + 1) % m], top_point],
[bottom_ring[i], bottom_point, bottom_ring[(i + 1) % m]],
[bottom_ring[i], bottom_ring[(i + 1) % m], top_ring[i]],
[top_ring[i], bottom_ring[(i + 1) % m], top_ring[(i + 1) % m]]))

vertices *= r/la.norm(vertices[:, 0])

Expand Down Expand Up @@ -770,8 +771,9 @@ def generate_surface_of_revolution(
tris: list[list[int]] = []
for i in range(m-1):
for j in range(n):
tris.append([i*n + j, (i + 1)*n + j, (i + 1)*n + (j + 1) % n])
tris.append([i*n + j, i*n + (j + 1) % n, (i + 1)*n + (j + 1) % n])
tris.extend((
[i * n + j, (i + 1) * n + j, (i + 1) * n + (j + 1) % n],
[i * n + j, i * n + (j + 1) % n, (i + 1) * n + (j + 1) % n]))

vertex_indices = np.array(tris, dtype=np.int32)

Expand Down
7 changes: 4 additions & 3 deletions meshmode/mesh/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,10 @@ def write_vertex_vtk_file(
def mesh_to_tikz(mesh: Mesh) -> str:
lines = []

lines.append(fr"\def\nelements{{{mesh.nelements}}}")
lines.append(fr"\def\nvertices{{{mesh.nvertices}}}")
lines.append("")
lines.extend((
rf"\def\nelements{{{mesh.nelements}}}",
rf"\def\nvertices{{{mesh.nvertices}}}",
""))

drawel_lines = []
drawel_lines.append(r"\def\drawelements#1{")
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ extend-ignore = [
"non-empty-init-module",
"type-check-without-type-error",
"collapsible-if",
"pytest-parameter-with-default-argument",
]

[tool.ruff.lint.flake8-quotes]
Expand Down
6 changes: 3 additions & 3 deletions test/test_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1412,10 +1412,10 @@ def gen_rect_mesh_with_perturbed_vertices(
actx, vol_discr, group_factory, FACE_RESTR_ALL, per_face_groups=False)

# Element vertex indices rotated
vol_mesh_unrotated = mgen.generate_regular_rect_mesh(
a=(-1,)*2, b=(1,)*2,
nelements_per_axis=(8,)*2)
with pytest.raises(InconsistentVerticesError):
vol_mesh_unrotated = mgen.generate_regular_rect_mesh(
a=(-1,)*2, b=(1,)*2,
nelements_per_axis=(8,)*2)
vol_mesh = vol_mesh_unrotated.copy(
groups=[
replace(
Expand Down
2 changes: 1 addition & 1 deletion test/test_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def f(x):
w_diag = np.diag(quad.weights)

modal_data = []
for _, nodal_data in enumerate(nodal_f_data):
for nodal_data in nodal_f_data:
# Compute modal data in each element: V.T * W * nodal_data
elem_modal_f = np.dot(vdm.T, np.dot(w_diag, nodal_data))
modal_data.append(elem_modal_f)
Expand Down
8 changes: 4 additions & 4 deletions test/test_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def f(x):
for i_local_part, part_mesh in part_meshes.items():
from meshmode.distributed import get_connected_parts
neighbors = get_connected_parts(part_mesh)
for i_remote_part in neighbors:
connected_parts.add((i_local_part, i_remote_part))
connected_parts.update((i_local_part, i_remote_part)
for i_remote_part in neighbors)

from meshmode.discretization import Discretization
vol_discrs = [Discretization(actx, part_mesh, group_factory)
Expand Down Expand Up @@ -259,8 +259,8 @@ def test_partition_mesh(mesh_size, num_parts, num_groups, dim, scramble_parts):
for i_local_part in range(num_parts):
from meshmode.distributed import get_connected_parts
neighbors = get_connected_parts(part_meshes[i_local_part])
for i_remote_part in neighbors:
connected_parts.add((i_local_part, i_remote_part))
connected_parts.update((i_local_part, i_remote_part)
for i_remote_part in neighbors)

from meshmode.mesh import BTAG_PARTITION
from meshmode.mesh.processing import find_group_indices
Expand Down
Loading