Hi, I'd like to have FEniCS / UFL evaluate the derivative of a function, say
f =2*t**2
at a specific argument, say t=2.
I had thought to find the derivative using diff, and then the 'replace' ufl function, but it seems in declaring 't' as a variable (in order to differentiate), replace fails with:
"This implementation can only replace Terminal objects."
MWE:
from dolfin import *
element = FiniteElement("CG", tetrahedron, 1)
t = Coefficient(element)
f1 = 2*t**2
print replace(f1,{t:2}) # works
t = variable(t)
f2 = 2*t**2
print replace(diff(f2,t),{t:2})
Thanks