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
517 stars 160 forks source link

BUG: Integration on facets fails in hexahedral meshes #3874

Open enricofacca opened 2 days ago

enricofacca commented 2 days ago

Describe the bug If I understood correctly, there was a recent update to the tsfc repository #https://github.com/firedrakeproject/tsfc/commit/1944432ab023e009bf159fe5598ce89091419d19 that should make possible to compate integrals on facets in hexahedral meshes. Before it was not supported.

However, the following MVE produces the error messages shown below. The same error occurs using ds (external facets ) in place of dS.

Enrico

from firedrake import *

mesh = UnitCubeMesh(2,2,2,hexahedral=True)

W = FunctionSpace(mesh, "DQ", 0)
u = Function(W)
v = TestFunction(W)

h = CellSize(W.mesh())
h_avg = (h('+') + h('-'))/2

a_dg = - 4.0/h_avg * jump(u)* jump(v) * dS
A = assemble(a_dg)

Error message

File "/home/firedrake/firedrake/src/tsfc/tsfc/fem.py", line 115, in use_canonical_quadrature_point_ordering
    return isinstance(self.fiat_cell, UFCHexahedron) and self.integral_type in ['exterior_facet', 'interior_facet']
                                                         ^^^^^^^^^^^^^^^^^^
AttributeError: 'PointSetContext' object has no attribute 'integral_type'

Environment:

connorjward commented 2 days ago

@ksagiyam can you take a look?

ksagiyam commented 2 hours ago

Could you check if https://github.com/firedrakeproject/tsfc/pull/331 fixes your issue?