Skip to content
Snippets Groups Projects
Commit ded892a0 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Ensure CSE of integration factor

parent 3923568e
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@ from pymbolic.primitives import Variable
import pymbolic.primitives as prim
from pytools import Record
import ufl.classes as uc
import loopy as lp
import cgen
......@@ -420,6 +421,13 @@ def visit_integrals(integrals):
if name.startswith("cse"):
subst_rule(name, expr, visitor)
# Ensure CSE on detjac * quadrature weight
domain = term.argument.argexpr.ufl_domain()
if term.argument.restriction:
subst_rule("integration_factor", uc.FacetJacobianDeterminant(domain)*uc.QuadratureWeight(domain), visitor)
else:
subst_rule("integration_factor", uc.JacobianDeterminant(domain)*uc.QuadratureWeight(domain), visitor)
get_backend(interface="accum_insn")(visitor, term, measure, subdomain_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment