Skip to content

Commit

Permalink
Clean up mesh.py
Browse files Browse the repository at this point in the history
  • Loading branch information
indiamai committed Jan 17, 2025
1 parent 6aa685c commit 361d81a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions firedrake/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import rtree
from textwrap import dedent
from pathlib import Path
from firedrake.petsc import PETSc

from pyop2 import op2
from pyop2.mpi import (
Expand Down Expand Up @@ -1263,6 +1264,7 @@ def cell_closure(self):

cell = self.ufl_cell()
assert tdim == cell.topological_dimension()

Check failure on line 1267 in firedrake/mesh.py

View workflow job for this annotation

GitHub Actions / Run linter

W293

firedrake/mesh.py:1267:1: W293 blank line contains whitespace
if self.submesh_parent is not None:
return dmcommon.submesh_create_cell_closure_cell_submesh(plex,
self.submesh_parent.topology_dm,
Expand All @@ -1274,10 +1276,16 @@ def cell_closure(self):
entity_per_cell = np.zeros(len(topology), dtype=IntType)
for d, ents in topology.items():
entity_per_cell[d] = len(ents)

return dmcommon.closure_ordering(plex, vertex_numbering,
cell_numbering, entity_per_cell)

# elif hasattr(cell, "to_fiat"):
# TODO
# topology = cell.to_fiat().topology
# entity_per_cell = np.zeros(len(topology), dtype=IntType)
# for d, ents in topology.items():
# entity_per_cell[d] = len(ents)
# return dmcommon.closure_ordering(plex, vertex_numbering,
# cell_numbering, entity_per_cell)
elif cell.cellname() == "quadrilateral":
from firedrake_citations import Citations
Citations().register("Homolya2016")
Expand Down Expand Up @@ -1308,6 +1316,7 @@ def cell_closure(self):

@utils.cached_property
def entity_orientations(self):
plex = self.topology_dm

Check failure on line 1319 in firedrake/mesh.py

View workflow job for this annotation

GitHub Actions / Run linter

F841

firedrake/mesh.py:1319:9: F841 local variable 'plex' is assigned to but never used
return dmcommon.entity_orientations(self, self.cell_closure)

@PETSc.Log.EventDecorator()
Expand All @@ -1333,7 +1342,6 @@ def merge_ids(x, y, datatype):
op.Free()
else:
unique_markers = None

local_facet_number, facet_cell = \
dmcommon.facet_numbering(dm, kind, facets,
self._cell_numbering,
Expand Down

0 comments on commit 361d81a

Please sign in to comment.