I am trying to calculate the dot product of gradients of TestFunction(u) and TrialFunction(v). And I am working on 2D domain.
When I do;
it works perfectly. But when I customly define the grad function as;
def gradient(u): return dolf.Dx(u, 0) + dolf.Dx(u, 1)
giving completely different results. Could you please explain why?