from basix.ufl import element
from ufl import (
FunctionSpace,
Mesh,
TestFunction,
TrialFunction,
dx,
grad,
inner,
)
n = 10
e = element("Lagrange", "triangle", 1)
coord_element = element("Lagrange", "triangle", 1, shape=(2,))
mesh = Mesh(coord_element)
V = FunctionSpace(mesh, e)
u = TrialFunction(V)
v = TestFunction(V)
a = inner(grad(u), grad(v)) * dx(tuple(i for i in range(n)))
Running FFCx on the following code
generates
ncopies of the same kernel.