← Back to team overview

ufl team mailing list archive

Re: Definition of grad

 

+1

On Fri, Nov 6, 2009 at 4:22 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> 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
>
> ?
>
> 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
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkrz+PwACgkQTuwUCDsYZdFemgCbBaM9MKI5aF5Pg/fzu0KW8RzG
> 1icAmwXaV/McdolyaIoLeK76v3WtVVb+
> =YliP
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> UFL-dev mailing list
> UFL-dev@xxxxxxxxxx
> http://fenics.org/mailman/listinfo/ufl-dev
>
>


References