← Back to team overview

ffc team mailing list archive

Factorization of tensor representation

 

FFC now computes signatures (a string uniquely defining a reference
tensor without needing to actually compute it) for all reference
tensors occuring in a form. If the signatures are equal for two or
more terms, these terms are grouped together and the common reference
tensor is factored out. Tested on a couple of problems, but please
try it out and report back the results.

This has a number of consequences:

1. Reduced compile-time, since a repeated reference tensor only has to
be computed one time. For the test problem Elasticity.form, the time
is reduced by a factor 2, since terms 0 and 3 as well as 1 and 2 are
grouped together in two pairs.

2. It's now ok to write operators in terms of constant indices. Thus,

    a = u.dx(i)*v.dx(i)*dx

and

    a = (u.dx(0)*v.dx(0) + u.dx(1)*v.dx(1))*dx

produce the same code (almost --- the determinant is not factored
out).

3. I will add a collection of new standard operators defined in terms
of Python's built-in lists (like Johan already does).

4. There is no longer any need to define ranges for indices (Garth
asked for this), since one can use standard Python slicing on the list
returned by the grad() operator.

/Anders

-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/



Follow ups