Subject: [FFC-dev] Quadrature degree=None

From: Anders Logg <[email-masked]>
Date: Tue, 17 Nov 2009 22:23:37 +0100

I've added support in UFL and FFC for letting quadrature degree be
None for a quadrature element.

This lets the form compiler choose the quadrature. What currently
happens is that the degree is counted as 1 (default value controllable
from the form compiler) and the summed with other functions
multiplying the coefficient.

  L = v*f*dx

If v is P2, then the total degree will be 2 + 1 = 3, which means the
quadrature degree chosen by FFC is 3 for that integral and so also
for the element for f.

Then there seems to be some confusion about the difference between
quadrature order and degree. At least I'm confused. What is the
difference?

--
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Tue, 17 Nov 2009 21:28:23 +0000

Anders Logg wrote:
> happens is that the degree is counted as 1 

Polynomial degree or 'quadrature degree' (whatever that is)?

(default value controllable
> quadrature order and degree. At least I'm confused. 

Me too.

Garth

What is the
> difference?
> 
> --
> Anders
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev

---

From: Anders Logg <[email-masked]>
Date: Tue, 17 Nov 2009 22:38:23 +0100

> >quadrature order and degree. At least I'm confused.

ok, let's hear what Kristian says.

Kristian, the repositories are here:

http://bitbucket.org/dolfin/ffc/
http://bitbucket.org/dolfin/ufl/

--
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Tue, 17 Nov 2009 21:59:49 +0000

> http://bitbucket.org/dolfin/ufl/

There are no changes in these repositories since yesterday (16/11). Is 
everything there?

Garth

---

From: Anders Logg <[email-masked]>
Date: Tue, 17 Nov 2009 23:07:06 +0100

On Tue, Nov 17, 2009 at 09:59:49PM +0000, Garth N. Wells wrote:
> There are no changes in these repositories since yesterday (16/11).
> Is everything there?

I thought so, but I had forgotten to give myself write access. I'm
pushing now so it should be there in a few minutes.

--
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Mon, 23 Nov 2009 07:39:24 +0100

> > >quadrature degree chosen by FFC is 3 for that integral and so also

Sounds reasonable.

> > >quadrature order and degree. At least I'm confused.

It should be the same thing, but we could sort out the naming to avoid
confusion. I think this originates from Martin using 'polynomial degree' and I
used 'polynomial order' when first implementing this.

Kristian

---

From: Anders Logg <[email-masked]>
Date: Mon, 23 Nov 2009 09:18:59 +0100

> used 'polynomial order' when first implementing this.

I think degree is better. Quadrature order q can mean either that the error
converges as h^q and polynomials of degree q - 1 are integrated
exactly, or it can (in the case of Gauss quadrature) that it
integrates polynomials of degree 2q - 1 exactly.

We can define degree of a quadrature rule to be the polynomial degree
it integrates exactly. Then there's no confusion.

The problem is the following though. Should the quadrature rule of an
element be an appropriate rule for the entire integrand, or should it
be the polynomial degree approximation of the coefficient?

Currently, if one has w being defined on a quadrature element of
degree q, then the form

  w^n * dx

gets a total degree of n * q and FFC adjusts the quadrature rule to
that total degree.

--
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Mon, 23 Nov 2009 08:50:14 +0100

> it integrates exactly. Then there's no confusion.

That's how I defined it, only I used 'order' instead of 'degree'.
But let's do a search and replace to change order to degree.

> gets a total degree of n * q and FFC adjusts the quadrature rule to

If I compute some field e.g., the strain from the displacement field at
quadrature points and then pass it as a coefficient to some other form, then
the order has to stay the same otherwise this get screwed up.
So if the order is set by the user, it shouldn't change, but if it is set to
None FFC should set it equal to the order needed to evaluate the integrand
exactly.

Kristian

---

From: Anders Logg <[email-masked]>
Date: Mon, 23 Nov 2009 09:54:32 +0100

> But let's do a search and replace to change order to degree.

ok.

> None FFC should set it equal to the order needed to evaluate the integrand

Sounds good, with the following modification:

  if degree is None:
    if quadrature_degree(form) is None:
      degree = polynomial_degree(form)
    else:
      degree = quadrature_degree(form)

quadrature_degree is the degree of any other quadrature elements in
the form (which needs to be the same for all if specified).

polynomial_degree is the total polynomial degree of the form.

--
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Mon, 23 Nov 2009 09:15:26 +0100

Quoting Anders Logg <[email-masked]>:

> > > > confusion. I think this originates from Martin using 'polynomial
> degree'
> > > and I

OK, sounds good.

Kristian