firedrakeproject / firedrake

Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)
https://firedrakeproject.org
Other
498 stars 157 forks source link

Failure to assemble surface integrals of a FacetElement #2551

Open pbrubeck opened 2 years ago

pbrubeck commented 2 years ago

I have this code:

from firedrake import *

mesh = ExtrudedMesh(UnitSquareMesh(1, 1, quadrilateral=True), 1)
element = FiniteElement("Lagrange", cell=mesh.ufl_cell(), degree=3)
element = FacetElement(element)
V = FunctionSpace(mesh, element)
u = Function(V)

assemble(u*ds_v)

which produces the following error: NotImplementedError: No rule for factorising expressions of this kind.

The code just works if I change ds_v to ds_t or ds_b

pbrubeck commented 2 years ago

The bug is also present in 2D:

from firedrake import *
mesh = UnitSquareMesh(1, 1, quadrilateral=True)
element = FiniteElement("Lagrange", cell=mesh.ufl_cell(), degree=3)
element = FacetElement(element)
V = FunctionSpace(mesh, element)
u = Function(V)
assemble(u*ds)
ksagiyam commented 2 years ago

I think https://github.com/firedrakeproject/tsfc/pull/282 will fix this.

pbrubeck commented 2 years ago

I think firedrakeproject/tsfc#282 will fix this.

@ksagiyam I just tested on your branch, and it seems to work, thanks!