FFC

QuadratureElement crashes mixed formulation

Bug #472942 reported by Kristian B. Ølgaard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FFC
Status tracked in Trunk
Trunk
Invalid
Medium
Kristian B. Ølgaard

Bug Description

The following simple form will crash when compiled:

CG = FiniteElement("CG", triangle, 1)
quad = VectorElement("Quadrature", triangle, 2)
element = CG + quad
v, Q = TestFunctions(element)
P = Function(CG)
L = inner(grad(v), grad(P))*dx

*** FFC: Points must be equal to coordinates of quadrature points

This is because the form is integrated using only 1 integration point, but the 'quad' element is 2nd order.
If I do:

quad = VectorElement("Quadrature", triangle, 2)

or

P = Function(quad)
L = inner(grad(v), P)*dx

the form compiles fine.

In all cases the compiler also issues the following warning:

*** WARNING: Derivatives are not defined on a QuadratureElement,
             returning values of basisfunction.

even though no derivatives of any functions defined on a QE is used in the form.

Changed in ffc:
assignee: nobody → Kristian B. Ølgaard (k.b.oelgaard)
importance: Low → Medium
milestone: none → 0.7.2
Revision history for this message
Marie Rognes (meg-simula) wrote :

The form does no longer crash and appears to compile fine, but the warning is still issued.

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) wrote :

Yes, but note that FFC sets the quadrature_degree=2 which is based on the QE, not the actual degree of the form.
Both 'bugs' in the above example is related to FFC not recognizing that the form does not contain any QuadratureElements.

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) wrote :

Sorry, the warning is of course related to FFC not recognizing that there are no derivatives of QE in the form.

Revision history for this message
Marie Rognes (meg-simula) wrote : Re: [Bug 472942] Re: QuadratureElement crashes mixed formulation

On 04. juni 2010 13:48, Kristian B. Ølgaard wrote:
> Sorry, the warning is of course related to FFC not recognizing that
> there are no derivatives of QE in the form.
>
>

Yes. But there is already a FIXME in the code so I was assuming that
you would get to fixing it in due time? :)

--
Marie

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) wrote :

On 4 June 2010 14:23, Marie Rognes <email address hidden> wrote:
> On 04. juni 2010 13:48, Kristian B. Ølgaard wrote:
>> Sorry, the warning is of course related to FFC not recognizing that
>> there are no derivatives of QE in the form.
>>
>>
>
>
> Yes. But there is already a FIXME in the code so I was assuming that
> you would get to fixing it in due time? :)

That's a bold assumption, if that is what FIXMEs implies, then I'll
avoid adding them in the future. :)
Besides, having a FIXME in the code is only useful if we read the code
from time to time, having a bug report increase the chance of us
remembering it.

> --
> Marie
>
> --
> QuadratureElement crashes mixed formulation
> https://bugs.launchpad.net/bugs/472942
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in FEniCS Form Compiler: New
> Status in FFC trunk series: New
>
> Bug description:
> The following simple form will crash when compiled:
>
> CG = FiniteElement("CG", triangle, 1)
> quad = VectorElement("Quadrature", triangle, 2)
> element = CG + quad
> v, Q = TestFunctions(element)
> P = Function(CG)
> L = inner(grad(v), grad(P))*dx
>
> *** FFC: Points must be equal to coordinates of quadrature points
>
> This is because the form is integrated using only 1 integration point, but the 'quad' element is 2nd order.
> If I do:
>
> quad = VectorElement("Quadrature", triangle, 2)
>
> or
>
> P = Function(quad)
> L = inner(grad(v), P)*dx
>
> the form compiles fine.
>
> In all cases the compiler also issues the following warning:
>
> *** WARNING: Derivatives are not defined on a QuadratureElement,
>             returning values of basisfunction.
>
> even though no derivatives of any functions defined on a QE is used in the form.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/ffc/+bug/472942/+subscribe
>

Revision history for this message
Marie Rognes (meg-simula) wrote :

On 04. juni 2010 14:46, Kristian B. Ølgaard wrote:
> On 4 June 2010 14:23, Marie Rognes <email address hidden> wrote:
>
>> On 04. juni 2010 13:48, Kristian B. Ølgaard wrote:
>>
>>> Sorry, the warning is of course related to FFC not recognizing that
>>> there are no derivatives of QE in the form.
>>>
>>>
>>>
>>
>> Yes. But there is already a FIXME in the code so I was assuming that
>> you would get to fixing it in due time? :)
>>
> That's a bold assumption, if that is what FIXMEs implies, then I'll
> avoid adding them in the future. :)
>

So you want someone else to fix the quadrature element bugs?

> Besides, having a FIXME in the code is only useful if we read the code
> from time to time, having a bug report increase the chance of us
> remembering it.
>
>

Most definitely. And the bug report is here/there :)

--
Marie

>> --
>> Marie
>>
>> --
>> QuadratureElement crashes mixed formulation
>> https://bugs.launchpad.net/bugs/472942
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>> Status in FEniCS Form Compiler: New
>> Status in FFC trunk series: New
>>
>> Bug description:
>> The following simple form will crash when compiled:
>>
>> CG = FiniteElement("CG", triangle, 1)
>> quad = VectorElement("Quadrature", triangle, 2)
>> element = CG + quad
>> v, Q = TestFunctions(element)
>> P = Function(CG)
>> L = inner(grad(v), grad(P))*dx
>>
>> *** FFC: Points must be equal to coordinates of quadrature points
>>
>> This is because the form is integrated using only 1 integration point, but the 'quad' element is 2nd order.
>> If I do:
>>
>> quad = VectorElement("Quadrature", triangle, 2)
>>
>> or
>>
>> P = Function(quad)
>> L = inner(grad(v), P)*dx
>>
>> the form compiles fine.
>>
>> In all cases the compiler also issues the following warning:
>>
>> *** WARNING: Derivatives are not defined on a QuadratureElement,
>> returning values of basisfunction.
>>
>> even though no derivatives of any functions defined on a QE is used in the form.
>>
>> To unsubscribe from this bug, go to:
>> https://bugs.launchpad.net/ffc/+bug/472942/+subscribe
>>
>>
>

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) wrote :
Download full text (4.2 KiB)

On 4 June 2010 15:08, Marie Rognes <email address hidden> wrote:
> On 04. juni 2010 14:46, Kristian B. Ølgaard wrote:
>> On 4 June 2010 14:23, Marie Rognes <email address hidden> wrote:
>>
>>> On 04. juni 2010 13:48, Kristian B. Ølgaard wrote:
>>>
>>>> Sorry, the warning is of course related to FFC not recognizing that
>>>> there are no derivatives of QE in the form.
>>>>
>>>>
>>>>
>>>
>>> Yes. But there is already a FIXME in the code so I was assuming that
>>> you would get to fixing it in due time? :)
>>>
>> That's a bold assumption, if that is what FIXMEs implies, then I'll
>> avoid adding them in the future. :)
>>
>
>
> So you want someone else to fix the quadrature element bugs?

No no, I'll fix it. Just not sure when (or how, the warning probably
requires visiting the entire UFL expression tree). The bug just
doesn't seem that important to me, especially since we no longer allow
forms with different quadrature degree inside the same sub domain.

The forms:

CG = FiniteElement("CG", triangle, 1)
quad = VectorElement("Quadrature", triangle, 2)
v = TestFunction(CG)
P = Coefficient(CG)
F = Coefficient(quad)

L = inner(grad(v), F)*dx(0, {"quadrature_degree":5})
L = inner(grad(v), grad(P))*dx(0, {"quadrature_degree":5}) +
inner(grad(v), F)*dx

both fails with

*** FFC: Points must be equal to coordinates of quadrature points

This is related to the same sort of behaviour where we need the degree
of any QE to take precedence over command line options and meta data.

Kristian

>
>> Besides, having a FIXME in the code is only useful if we read the code
>> from time to time, having a bug report increase the chance of us
>> remembering it.
>>
>>
>
> Most definitely. And the bug report is here/there :)
>
> --
> Marie
>
>>> --
>>> Marie
>>>
>>> --
>>> QuadratureElement crashes mixed formulation
>>> https://bugs.launchpad.net/bugs/472942
>>> You received this bug notification because you are a direct subscriber
>>> of the bug.
>>>
>>> Status in FEniCS Form Compiler: New
>>> Status in FFC trunk series: New
>>>
>>> Bug description:
>>> The following simple form will crash when compiled:
>>>
>>> CG = FiniteElement("CG", triangle, 1)
>>> quad = VectorElement("Quadrature", triangle, 2)
>>> element = CG + quad
>>> v, Q = TestFunctions(element)
>>> P = Function(CG)
>>> L = inner(grad(v), grad(P))*dx
>>>
>>> *** FFC: Points must be equal to coordinates of quadrature points
>>>
>>> This is because the form is integrated using only 1 integration point, but the 'quad' element is 2nd order.
>>> If I do:
>>>
>>> quad = VectorElement("Quadrature", triangle, 2)
>>>
>>> or
>>>
>>> P = Function(quad)
>>> L = inner(grad(v), P)*dx
>>>
>>> the form compiles fine.
>>>
>>> In all cases the compiler also issues the following warning:
>>>
>>> *** WARNING: Derivatives are not defined on a QuadratureElement,
>>>             returning values of basisfunction.
>>>
>>> even though no derivatives of any functions defined on a QE is used in the form.
>>>
>>> To unsubscribe from this bug, go to:
>>> https://bugs.launchpad.net/ffc/+bug/472942/+subscribe
>>>
>>>
>>
>
> --
> QuadratureElement crashes mixed formulation
> https://bugs.launchpad.net/bugs/472942
> You received this bug notification bec...

Read more...

Revision history for this message
Garth Wells (garth-wells) wrote :

Should this report be left open or be closed?

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) wrote :

2011/5/19 Garth Wells <email address hidden>:
> Should this report be left open or be closed?

Closed.
The form compiles now, the warning is still issued but that is not
really related to the original bug report.

Kristian

> --
> You received this bug notification because you are a member of FFC Core
> Team, which is subscribed to FFC.
> https://bugs.launchpad.net/bugs/472942
>
> Title:
>  QuadratureElement crashes mixed formulation
>
> Status in FEniCS Form Compiler:
>  New
> Status in FFC trunk series:
>  New
>
> Bug description:
>  The following simple form will crash when compiled:
>
>  CG = FiniteElement("CG", triangle, 1)
>  quad = VectorElement("Quadrature", triangle, 2)
>  element = CG + quad
>  v, Q = TestFunctions(element)
>  P = Function(CG)
>  L = inner(grad(v), grad(P))*dx
>
>  *** FFC: Points must be equal to coordinates of quadrature points
>
>  This is because the form is integrated using only 1 integration point, but the 'quad' element is 2nd order.
>  If I do:
>
>  quad = VectorElement("Quadrature", triangle, 2)
>
>  or
>
>  P = Function(quad)
>  L = inner(grad(v), P)*dx
>
>  the form compiles fine.
>
>  In all cases the compiler also issues the following warning:
>
>  *** WARNING: Derivatives are not defined on a QuadratureElement,
>               returning values of basisfunction.
>
>  even though no derivatives of any functions defined on a QE is used in
>  the form.
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.