ufl team mailing list archive
-
ufl team
-
Mailing list archive
-
Message #01511
Re: Definition of grad
Quoting Anders Logg <logg@xxxxxxxxx>:
> This is something we've discussed before, but I want to discuss it
> again.
>
> Could we change the definition of the gradient of a vector to be the
> "normal" definition:
>
> grad(u) = du_i / dx_j
>
> ?
I think this sounds like an excellent idea.
Kristian
> Then grad would be the derivative of u, and not as today the transpose
> of the derivative of u.
>
> u(x + dx) = u(x) + u' du + h.o.t.
>
> With the current definition, I need to do this in various places:
>
> from ufl import grad as ufl_grad
> def grad(v):
> if v.rank() == 1:
> return ufl_grad(v).T
> else:
> return ufl_grad(v)
>
> --
> Anders
>
Follow ups
References