Subject: [FFC-dev] Factorization of tensor representation

From: Anders Logg <[email-masked]>
Date: Wed, 7 Sep 2005 16:14:45 -0500

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/

---

From: Johan Jansson <[email-masked]>
Date: Sun, 11 Sep 2005 13:36:29 +0200

> try it out and report back the results.

Hi!

I've verified that the assembly is correct for the Elasticity form in
DOLFIN (compared against a reference) and I'm using the
signature-enabled FFC when working on the updated elasticity module,
and the output seems fine (just eyeball verification). So the
signature factorization seems to be working fine, great job. I haven't
gotten to the operators yet.

  Johan

---

From: Anders Logg <[email-masked]>
Date: Sun, 11 Sep 2005 07:50:14 -0500

> gotten to the operators yet.

Good to hear!

/Anders