Subject: [Ffc] Bug for quadrature representation (or element_map)

From: Anders Logg <[email-masked]>
Date: Thu, 21 Jan 2010 23:26:47 +0100

The MetaData.ufl example is failing in the quadrature representation.

Kristian, could you have a look and see what goes wrong. Then I can
continue to make the incremental/combined integral stuff work.

--
Anders

---

From: Anders Logg <[email-masked]>
Date: Fri, 22 Jan 2010 00:04:02 +0100

> continue to make the incremental/combined integral stuff work.

On second thought, maybe we should skip the whole thing with having
different representations inside the same tabulate_tensor function
for the following reasons:

1. It leads to complications in the code generation.

2. It probably doesn't make much difference since if quadrature is
required for one part of an integral, then it is likely the cost is
low for including the other terms inside the existing quadrature loop.

3. The situation will not arise often since UFL will anyway group
terms with the same dx inside the same integral and then all will have
the same representation.

So the cases where this is useful are rare (because of the UFL
grouping), it won't give any speedup and it's complicated to
implement...

We will still have the possibility of different representations for
integrals on different subdomains and for cell, interior and exterior
facet integrals.

If this sounds ok, I can add some checks in analysis.py that force all
UFL integrals that will be grouped as part of the same UFC integral to
use the same representation.

Btw, does quadrature handle different quadrature degree for different
integrals that become part of the same tabulate_tensor? If not, we can
force metadata to be the same for all integrals that belong together.

--
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Fri, 22 Jan 2010 09:25:25 +0100 (CET)

> The MetaData.ufl example is failing in the quadrature representation.

Fixed.

Kristian

> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAktY1KcACgkQTuwUCDsYZdHfjQCfce9g7IgU5XRtEjoT0GyGDJCs
> 6kQAnRxRElyVAH1edJShWMUFDww499Nq
> =WRSO
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ffc
> Post to     : [email-masked]
> Unsubscribe : https://launchpad.net/~ffc
> More help   : https://help.launchpad.net/ListHelp
>
>

---

From: Kristian Oelgaard <[email-masked]>
Date: Fri, 22 Jan 2010 09:35:23 +0100 (CET)

> 1. It leads to complications in the code generation.

Very true.

> low for including the other terms inside the existing quadrature loop.

True.

> terms with the same dx inside the same integral and then all will have

I'm not sure this is correct, if the metadata is different the integrals will not be grouped.

> integrals on different subdomains and for cell, interior and exterior

Yes, and this is probably the case where one will use it the most anyway.

> use the same representation.

Yes, such that if any quadrature is present they will all be quadrature.

> force metadata to be the same for all integrals that belong together.

I don't know how the meta data is set up now, but it used to be able to do:

a = v*u*dx + inner(grad(v), grad(u))*dx -->

loop ip range(4):
  ....

loop ip range(9):
  ....

Inside one tabulate_tensor() funtion.

Kristian

> iEYEARECAAYFAktY3WIACgkQTuwUCDsYZdHUhQCfSy428yCjD75g97uNnHyXhls+
> B+4AoJDo24YSs1llE5PSjSOUnibcAKeM
> =Ofl7

---

From: Anders Logg <[email-masked]>
Date: Fri, 22 Jan 2010 10:29:43 +0100

> I'm not sure this is correct, if the metadata is different the integrals will not be grouped.

That's correct. So it has an effect when someone explicitly wants to
treat a term with a specific representation, but not when FFC tries to
auto-select the representation for each term since then all the terms
will have metadata "auto" and be grouped together.

I still think we have a strong case for a simplification. Agree?

> Inside one tabulate_tensor() funtion.

ok, if there are no objections, I can have a go at adding some checks
for having the same metadata in all terms UFL integrals that
correspond to the same UFC integral (same domain type and domain number).

--
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Fri, 22 Jan 2010 10:40:20 +0100 (CET)

> I still think we have a strong case for a simplification. Agree?

Yes, totally.

> correspond to the same UFC integral (same domain type and domain number).

OK.

Kristian

> iEYEARECAAYFAktZcAcACgkQTuwUCDsYZdETZgCeLp9ApVtM1D+Orq7/wzQCWva5
> qbUAnRXqnDW71xTBqgnmv5oRSmSwGsNX
> =xcFl