Subject: Re: [Ufl] [Question #212068]: Reducing a fraction

From: Jan Blechta <[email-masked]>
Date: Tue, 23 Oct 2012 15:31:11 -0000

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).

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.

---

From: Kristian Ølgaard <[email-masked]>
Date: Wed, 24 Oct 2012 07:46:50 +0200

> 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

> _______________________________________________
> Mailing list: https://launchpad.net/~ufl
> Post to     : [email-masked]
> Unsubscribe : https://launchpad.net/~ufl
> More help   : https://help.launchpad.net/ListHelp