On Thu, May 14, 2009 at 9:43 AM, Anders Logg <logg@xxxxxxxxx> wrote:
On Thu, May 14, 2009 at 08:40:41AM +0100, Garth N. Wells wrote:
Martin Sandve Alnæs wrote:
Is there a mathematical difference?
Splitting hairs, I would say yes and that grad(u('+')) is correct and
grad(u)('+') is not because grad(u) is not defined in a classical sense.
I prefer grad(u('+')), but FFC used to use grad(u)('+'). My preference
is however not strong.
My immediate question is will the generated code differ for grad(u('+'))
and grad(u)('+')?
Garth
No, since the restriction will be propagated to the leaves... :-)
The leaves are terminal expressions, that is literal constants,
geometric quantities, functions and basis functions.
"Propagating to the leaves" means modifying for example
(grad(f) + grad(g))('+')
to
(grad(f('+')) + grad(g('+')))
such that the restrictions apply directly to the terminal expressions.
That will simplify the work of the form compilers, and allow
for example taking the jump of anything.
Basically, I think the canonical representation after some algorithms should be
u('+').dx(i)
and with indexing either
u('+').dx(i)[j]
or
u('+')[j].dx(i)
If restrictions, (indexing) and derivatives are applied to a
(non-scalar) function (terminal).
Currently, both
u.dx(i)[j]
and
u[j].dx(i)
can occur, and restrictions are not handled.
Martin
_______________________________________________
UFL-dev mailing list
UFL-dev@xxxxxxxxxx
http://fenics.org/mailman/listinfo/ufl-dev