This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

evaluate derivative in UFL

0 votes

Hi,

Let say I have a UFL form

f = Constant(a)+Constant(b)*u

where u is a Function

Can I calculate

df/dx = Constant(b)*du/dx

using f.evaluate?

asked May 10, 2016 by chaffra FEniCS User (1,830 points)

1 Answer

0 votes

Hello,

If I understood your question correctly,you dont need the evaluate function. If you want to find the differentation of f, you can simply call:

dfdx = diff(f, u)

This can be seen in example 5 from tutorial :

f    = 100*c**2*(1-c)**2
dfdc = diff(f, c)
answered May 20, 2016 by lhdamiani FEniCS User (2,580 points)
...