From bcfbf542abeceb2a2c5a34d01e43ae91fb3807f2 Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Wed, 19 Jun 2024 20:54:41 +0100 Subject: [PATCH] Use subdegree instead of superdegree to check cell bendy-ness 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 https://github.com/firedrakeproject/firedrake/issues/3612. --- ufl/algorithms/apply_geometry_lowering.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ufl/algorithms/apply_geometry_lowering.py b/ufl/algorithms/apply_geometry_lowering.py index 4ef00c1c1..1dbc8e1c0 100644 --- a/ufl/algorithms/apply_geometry_lowering.py +++ b/ufl/algorithms/apply_geometry_lowering.py @@ -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 @@ -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 @@ -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