← Back to team overview

ufl team mailing list archive

Re: [FFC-dev] [HG FFC] Use new UFL function estimate_max_polynomial_degree to estimate quadrature

 

Try applying this to the form after expand_compounds etc has been applied.

In [20]: estimate_max_polynomial_degree(L.form_data().form)
Out[20]: 2

In [21]: estimate_max_polynomial_degree(L.form_data().original_form)
Out[21]: 1

This is because rules have not been defined for all types.

In SFC I don't look at the original form at all,
using form.form_data().form from the start.

Martin



On Mon, Apr 20, 2009 at 10:59 AM, Kristian Oelgaard
<k.b.oelgaard@xxxxxxxxxx> wrote:
> Quoting Anders Logg <logg@xxxxxxxxx>:
>
>> I tried to use the new UFL function estimate_max_polynomial_degree
>> but the results seem to be incorrect for quadrature representation.
>> (Or the references are wrong which I doubt.)
>>
>> Kristian, can you take a look at this?
>>
>> Try running the test in simple_verify_tensors. It reports the
>> following errors:
>>
>> FunctionOperatorsBilinearForm_cell_integral_0:      *** (diff = 0.010098)
>> MassBilinearForm_cell_integral_0:                   *** (diff = 1e-09)
>> NeumannProblemLinearForm_cell_integral_0:           *** (diff = 0.0029685)
>
> This difference is because:
> element = VectorElement("Lagrange", triangle, 1)
>
> v = TestFunction(element)
> f = Function(element)
> L = inner(v, f)*dx
>
> results in:
> Input form: { sum_{i_0} ((v_0)[i_0]) * ((w_0)[i_0])  } *
> dx0<{'ffc_representation': 'tensor', 'quadrature_order': 1}>
>
> where the quadrature order should be 2.
>
> The tensor representation computes the degree elsewhere (which is 2) as far as I
> can tell from using the -d1 option.
>
> Kristian
>
>> NeumannProblemLinearForm_exterior_facet_integral_0: *** (diff = 0.00292)
>> OptimizationBilinearForm_cell_integral_0:           *** (diff = 2.19169)
>> PoissonDGBilinearForm_interior_facet_integral_0:    *** (diff = 0.3504)
>> PoissonSystemLinearForm_cell_integral_0:            *** (diff = 0.0029685)
>> QuadratureElementBilinearForm_cell_integral_0:      *** (diff = 0.249892)
>> QuadratureElementLinearForm_cell_integral_0:        *** (diff = 0.10106)
>> StokesLinearForm_cell_integral_0:                   *** (diff = 0.00140453)
>>
>> --
>> Anders
>>
>>
>> On Sun, Apr 19, 2009 at 06:23:03PM +0200, FFC wrote:
>> > One or more new changesets pushed to the primary ffc repository.
>> > A short summary of the last three changesets is included below.
>> >
>> > changeset:   1497:38268dcd85de2bfcae1094ed96ea584293320491
>> > tag:         tip
>> > user:        Anders Logg <logg@xxxxxxxxx>
>> > date:        Sun Apr 19 18:23:00 2009 +0200
>> > files:       ffc/compiler/uflcompiler.py
>> > description:
>> > Use new UFL function estimate_max_polynomial_degree to estimate quadrature
>> > degree. Seems to give wrong results for quadrature representation.
>> >
>> >
>> > changeset:   1496:2eaeb80e1d1fdf45208005bd1cc23016ca872919
>> > user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
>> > date:        Sun Apr 19 14:26:22 2009 +0800
>> > files:       ffc/compiler/uflcompiler.py
>> > description:
>> > Fix silly error.
>> >
>> >
>> > changeset:   1495:4710241c0954645d8150ec6fcd1eb3bff4f6d333
>> > user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
>> > date:        Sun Apr 19 13:47:10 2009 +0800
>> > files:       ffc/compiler/uflcompiler.py
>> > description:
>> > Small fix.
>> >
>> > ----------------------------------------------------------------------
>> > For more details, visit http://www.fenics.org/hg/ffc
>> > _______________________________________________
>> > FFC-dev mailing list
>> > FFC-dev@xxxxxxxxxx
>> > http://www.fenics.org/mailman/listinfo/ffc-dev
>>
>
>
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/ffc-dev
>


Follow ups

References