@@ -605,15 +605,28 @@ def translate_cellorigin(terminal, mt, ctx):
605605 return context .translator (expression )
606606
607607
608+ class CellVerticesKernelInterface (ProxyKernelInterface ):
609+ # Since CellVolume is evaluated as a cell integral, we must ensure
610+ # that the right restriction is applied when it is used in an
611+ # interior facet integral. This proxy diverts coefficient
612+ # translation to use a specified restriction.
613+
614+ def __init__ (self , wrapee ):
615+ ProxyKernelInterface .__init__ (self , wrapee )
616+
617+ def entity_ids (self , domain ):
618+ return (0 ,)
619+
620+
608621@translate .register (CellVertices )
609622def translate_cell_vertices (terminal , mt , ctx ):
610623 coords = SpatialCoordinate (extract_unique_domain (terminal ))
611624 ufl_expr = construct_modified_terminal (mt , coords )
612625 ps = PointSet (numpy .array (ctx .fiat_cell .get_vertices ()))
613-
626+ interface = CellVerticesKernelInterface ( ctx )
614627 config = {name : getattr (ctx , name )
615628 for name in ["ufl_cell" , "index_cache" , "scalar_type" , "domain_integral_type_map" ]}
616- config .update (interface = ctx , point_set = ps , use_canonical_quadrature_point_ordering = False )
629+ config .update (interface = interface , point_set = ps , use_canonical_quadrature_point_ordering = False )
617630 context = PointSetContext (** config )
618631 expr = context .translator (ufl_expr )
619632
0 commit comments