FEniCS / ufl

UFL - Unified Form Language
https://fenicsproject.org
GNU Lesser General Public License v3.0
97 stars 64 forks source link

Override is_cellwise_constant for CellNormal #119

Closed michalhabera closed 2 years ago

michalhabera commented 2 years ago

Following MWE produces True,

import ufl

coord_el = ufl.VectorElement("CG", ufl.triangle, 2, dim=3)
mesh = ufl.Mesh(coord_el)

n = ufl.CellNormal(mesh)
print(n.is_cellwise_constant())

which results in terms like grad(CellNormal) being incorrectly simplified to Zero.