Skip to content

Commit

Permalink
Use subdegree instead of superdegree to check cell bendy-ness
Browse files Browse the repository at this point in the history
The reason subdegree is right is that you care about whether the
edges are straight, not whether there are any quadratic functions
on the interior.

See firedrakeproject/firedrake#3612.
  • Loading branch information
connorjward committed Jun 19, 2024
1 parent ea144b0 commit bcfbf54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ufl/algorithms/apply_geometry_lowering.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def _reduce_cell_edge_length(self, o, reduction_op):

domain = extract_unique_domain(o)

if domain.ufl_coordinate_element().embedded_superdegree > 1:
if domain.ufl_coordinate_element().embedded_subdegree > 1:
# Don't lower bendy cells, instead leave it to form compiler
warnings.warn("Only know how to compute cell edge lengths of P1 or Q1 cell.")
return o
Expand All @@ -329,7 +329,7 @@ def cell_diameter(self, o):

domain = extract_unique_domain(o)

if domain.ufl_coordinate_element().embedded_superdegree > 1:
if domain.ufl_coordinate_element().embedded_subdegree > 1:
# Don't lower bendy cells, instead leave it to form compiler
warnings.warn("Only know how to compute cell diameter of P1 or Q1 cell.")
return o
Expand Down Expand Up @@ -366,7 +366,7 @@ def _reduce_facet_edge_length(self, o, reduction_op):
if domain.ufl_cell().topological_dimension() < 3:
raise ValueError("Facet edge lengths only make sense for topological dimension >= 3.")

elif domain.ufl_coordinate_element().embedded_superdegree > 1:
elif domain.ufl_coordinate_element().embedded_subdegree > 1:
# Don't lower bendy cells, instead leave it to form compiler
warnings.warn("Only know how to compute facet edge lengths of P1 or Q1 cell.")
return o
Expand Down

0 comments on commit bcfbf54

Please sign in to comment.