Subject: Re: [Ufl] [Branch ~ufl-core/ufl/main] Rev 1088: Implemented improvements to estimate_total_polynomial_degree

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 06 Jun 2011 10:47:16 +0100

On 06/06/11 10:39, [email-masked] wrote:
> ------------------------------------------------------------
> revno: 1088
> committer: Martin Sandve Alnæs <[email-masked]>
> branch nick: work
> timestamp: Mon 2011-06-06 11:33:42 +0200
> message:
>   Implemented improvements to estimate_total_polynomial_degree
>   to take into account spatial_coordinate, as well as some
>   heuristic rules for degrees of division and math functions
>   which at least result in increased degree.
>   
>   AFAIK this function is not in use by anyone at the moment,
>   but scream out if this breaks any expected behaviour.

FFC uses this function. It shouldn't break anything fundamental, but the
FFC references might need re-generating.

Garth

>   Tests look good anyway.
> modified:
>   test/test_algorithms.py
>   ufl/algorithms/transformations.py
> 
> 
> --
> lp:ufl
> https://code.launchpad.net/~ufl-core/ufl/main
> 
> Your team UFL Core Team is subscribed to branch lp:ufl.
> To unsubscribe from this branch go to https://code.launchpad.net/~ufl-core/ufl/main/+edit-subscription

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Mon, 6 Jun 2011 11:53:32 +0200

> FFC references might need re-generating.

Ok. Do you want the new behaviour where you use it,
or should I make a copy with another name?

Martin

---

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 06 Jun 2011 10:56:51 +0100

> or should I make a copy with another name?

I think that the new behaviour is OK.

What would be helpful is a function that returns the polynomial order of
the product of all test and trial functions. A user may often want to
use a quadrature scheme that integrates that degree exactly.

Garth

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Mon, 6 Jun 2011 12:01:18 +0200

On 6 June 2011 11:56, Garth N. Wells <[email-masked]> wrote:
>
>
> On 06/06/11 10:53, Martin Sandve Alnęs wrote:
>>>> committer: Martin Sandve Alnęs <[email-masked]>
>>>> branch nick: work

There is this one:

def estimate_quadrature_degree(integral):
    "Estimate the necessary quadrature order for integral using the
sum of argument degrees."
    arguments = extract_arguments(integral)
    degrees = [v.element().degree() for v in arguments]
    if len(arguments) == 0:
        return None
    if len(arguments) == 1:
        return 2*degrees[0]
    return sum(degrees)

Martin