Subject: [UFL-dev] UFL suggestions

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 01 Jan 2009 18:30:36 +0000

Is the wiki the place for posting UFL suggestions?

Garth

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Thu, 1 Jan 2009 22:36:00 +0100

The wiki isn't quite updated, but go ahead. Or you can just send them here.

Martin

On Thu, Jan 1, 2009 at 7:30 PM, Garth N. Wells <[email-masked]> wrote:
> _______________________________________________
> UFL-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufl-dev
>

---

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 01 Jan 2009 22:30:53 +0000

> The wiki isn't quite updated, but go ahead. Or you can just send them here.

It would be useful an integration scheme could be attached to integrals 
(dx0, dx1, etc). This would make selective integration schemes simple to 
implement.

Garth

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Fri, 2 Jan 2009 09:42:52 +0100

> (dx0, dx1, etc). This would make selective integration schemes simple to

Ok, adding any kind of metadata to Integral poses no problems.
How should it look? How general can we make it?

Currently you can do:
  dx0 = dx(0)

We could add something like:
  quad_order = 3
  quad_rule = [
    (1.0/3.0, (0.0, 0.0)),
    (1.0/3.0, (1.0, 0.0))
    (1.0/3.0, (0.0, 1.0))
    ]
  integration_scheme1 = IntegrationScheme(quad_order)
  integration_scheme2 = IntegrationScheme(quad_rule)

  dx0 = dx(0, integration_scheme1)
  dx1 = dx(1, integration_scheme2)

  a = u*v*dx0 + f*v*dx1

where quad_order is the minimum order of the quadrature
scheme wanted. The default integration scheme is
undefined (None) in which case the form compiler decides.
IntegrationScheme can in principle be arbitrarily complex,
even containing known quadrature rules.

Alternatively, we can skip the IntegrationScheme class:
  dx0 = dx(0, 3)
  dx1 = dx(0, quad_rule)

In the case of facet integrals, the points are defined
on a single reference polygon.

How should we handle non-quadrature integration options?

(And using functions on quadrature elements in an
integral with different quadrature rule is an error.)

Martin

---

From: Kent Andre <[email-masked]>
Date: Fri, 02 Jan 2009 11:35:39 +0100

> We could add something like:

Very good! 

> How should we handle non-quadrature integration options?

Don't bother. The compiler should bail out. It should 
correspond to a projection, but I think implementing 
it would smell more than it tastes. 

> integral with different quadrature rule is an error.)

Kent

---

From: "Garth N. Wells" <[email-masked]>
Date: Fri, 02 Jan 2009 10:56:07 +0000

>> Alternatively, we can skip the IntegrationScheme class:

Looks good to me too.

> Don't bother. The compiler should bail out. 

Agree.

Garth

It should

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Fri, 2 Jan 2009 12:01:34 +0100

>> Don't bother. The compiler should bail out.

Ok. What is the natural behaviour of this case then?

myform.ufl:
...
a = u*v*dx(0) + f*v*dx(1, 3)

sfc -isymbolic myform.ufl

I guess the compiler here can apply commandline integration options to
dx(0) which is unspecified, and apply 3rd order quadrature to dx(1)?

Martin

---

From: "Garth N. Wells" <[email-masked]>
Date: Fri, 02 Jan 2009 11:04:15 +0000

> dx(0) which is unspecified, and apply 3rd order quadrature to dx(1)?

That would be good.

I have some forms for which I always want to use quadrature, so it would 
be useful if this can be specified in the input rather than always on 
the command line.

Garth

---

From: Anders Logg <[email-masked]>
Date: Fri, 2 Jan 2009 13:46:18 +0100

> it would smell more than it tastes. 

Why shouldn't non-quadrature options be handled?

The main question is how detailed control of the form compiler one
should have from the form language. Some options make sense only for
some compilers. For example, FIAT uses a special kind of quadrature
that might not make sense to other compilers, and FFC could have
something like

  dx = dx(0, tensor, quad_rule)

meaning use tensor representation but precompute integrals using the
specified quadrature rule.

-- 
Anders