From e69de178c883b6db186cc21ebbdd4d75ca825b69 Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Thu, 4 Jul 2024 09:08:35 +0100 Subject: [PATCH] Use subdegree instead of superdegree to check cell bendy-ness (#295) 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. Co-authored-by: Matthew Scroggs --- 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