← Back to team overview

ufl team mailing list archive

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

 

On 6 June 2011 11:56, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>
>
> On 06/06/11 10:53, Martin Sandve Alnęs wrote:
>> On 6 June 2011 11:47, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>>>
>>>
>>> On 06/06/11 10:39, noreply@xxxxxxxxxxxxx wrote:
>>>> ------------------------------------------------------------
>>>> revno: 1088
>>>> committer: Martin Sandve Alnęs <martinal@xxxxxxxxx>
>>>> 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.
>>
>> Ok. Do you want the new behaviour where you use it,
>> 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.

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


References