← Back to team overview

ufl team mailing list archive

Re: [Question #212068]: Reducing a fraction

 

On 23 October 2012 17:31, Jan Blechta
<question212068@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Question #212068 on UFL changed:
> https://answers.launchpad.net/ufl/+question/212068
>
> Jan Blechta posted a new comment:
> Good job, Martin. But general cases like (g*f)/f are of my interest. So
> it would need to recognize associative compound of many products and
> divisions which could be transformed to general fraction like
> f1*f2*f3*.../(g1*g2*g3*...) with fi,gi terminals and then to check for
> possible equalities fi==gj for some i,j to reduce the fraction. So it
> would simply set terminals fi=gj=1 and kept original expression in order
> to avoid need for defining additional operator for fraction. What do you
> think about this design? It of course needs thinking over non-scalar
> case (possibly do nothing).

Something similar to this is implemented in FFC for the quadrature
representation (optimisation).
The difference is that it operates on an intermediate representation
of the code which will be generated meaning that all symbols are
scalar valued.
It is an expensive optimisation to perform, so having something
similar which operates at the higher UFL abstraction level could be
expected to improve performace.

Kristian

> I woud try doing something like that sometimes next week (if not anybody
> else:)) but I'm not much familiar with UFL operation so I can't
> promise...
>
> Jan
>
> --
> You received this question notification because you are a member of UFL
> Team, which is an answer contact for UFL.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ufl
> Post to     : ufl@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ufl
> More help   : https://help.launchpad.net/ListHelp


References