If I have the solution to my PDE, what is the best method to get it's derivative?

After solving for my function, u, I can evaluate the solution at a point Point(x,y,z) using the line of code
u(Point(x,y,z)). If I want to evaluate the gradient operator of my solution at Point (x,y,z) what is the best way to do so?

In legacy dolfin:
Project the gradient into a suitable space and use point evaluation.
See:

In Dolfinx you can use the Expression class.

1 Like

Great, thanks for your help once again it is really appreciated!