FFC

Comment 5 for bug 883202

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) wrote : Re: [Bug 883202] [NEW] Undeclared variables in optimised quadrature code

On 31 October 2011 18:38, Garth Wells <email address hidden> wrote:
> 2011/10/29 Kristian B. Ølgaard <email address hidden>:
>> On 28 October 2011 22:23, Garth Wells <email address hidden> wrote:
>>> 2011/10/28 Kristian B. Ølgaard <email address hidden>:
>>>> On 28 October 2011 19:37, Launchpad Bug Tracker
>>>> <email address hidden> wrote:
>>>>> Garth Wells (garth-wells) has assigned this bug to you for FFC:
>>>>>
>>>>> The below code fails to run due to undeclared variables:
>>>>>
>>>>> from dolfin import *
>>>>> # Below line causes failure
>>>>> parameters["form_compiler"]["optimize"]       = True
>>>>> parameters["form_compiler"]["representation"] = "quadrature"
>>>>> mesh = UnitSquare(2, 2)
>>>>> P1 = VectorFunctionSpace(mesh, "Lagrange", 2)
>>>>> B  = VectorFunctionSpace(mesh, "Bubble", 3)
>>>>> Mini = (P1 + B)
>>>>
>>>> I don't understand where the form is coming from (the error is in a
>>>> tabulate_tensor() function).
>>>> What does adding two function spaces mean?
>>>>
>>>
>>> It's an 'enriched' space. The code is a cut-down version of the
>>> stokes-mini demo.
>>
>> Sure, I just don't understand why:
>>
>> Mini = (P1 + B)
>>
>> results in a form.
>>
>> It should just be an element, and if the code read (in a UFL file):
>>
>> element = (P1 + B)
>>
>> FFC would generate a header for one element without the
>> tabulate_tensor() function.
>>
>
> Have you tested if this is a problem with plain UFL + FFC
> complilation? I can try it later if you haven't already.

This is not a problem with plain UFL + FFC, since

P1 = VectorElement("Lagrange", triangle, 2)
B = VectorElement("Bubble", triangle, 3)
Mini = (P1 + B)

does nothing, and changing the last line to:

element = (P1 + B)

produces code only for the enriched element, no forms involved.
After some trial and error I found the following simple form which
will result in code with equivalent missing variables:

B = VectorElement("Bubble", triangle, 3)

#v = TestFunction(B)
v = Coefficient(B)

L = (v[0] + v[1])*dx

I'm debugging this, now and a fix should be on the way.

Why your simple PyDOLFIN script results in a header file involving a
tabulate_tensor() function is beyond me.

Kristian

> Garth
>
>> Kristian
>>
>>> Garth
>>>
>>>>
>>>>>
>>>>> The Instant output is:
>>>>>
>>>>>
>>>>> In file included from instant_module_c57922f6eccdd3bfa89632e935c27d66b0c22e0b_wrap.cxx:3085:0:
>>>>> ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h: In member function ‘virtual void ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9_cell_integral_0_0::tabulate_tensor(double*, const double* const*, const ufc::cell&) const’:
>>>>> ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h:1231:9: error: ‘nzc0’ was not declared in this scope
>>>>> ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h:1231:14: error: ‘j’ was not declared in this scope
>>>>> error: command 'gcc' failed with exit status 1
>>>>>
>>>>> ** Affects: ffc
>>>>>     Importance: Critical
>>>>>     Assignee: Kristian B. Ølgaard (k.b.oelgaard)
>>>>>         Status: Confirmed
>>>>>
>>>>> --
>>>>> Undeclared variables in optimised quadrature code
>>>>> https://bugs.launchpad.net/bugs/883202
>>>>> You received this bug notification because you are a bug assignee.
>>>>>
>>>>
>>>> --
>>>> You received this bug notification because you are a member of FFC Core
>>>> Team, which is subscribed to FFC.
>>>> https://bugs.launchpad.net/bugs/883202
>>>>
>>>> Title:
>>>>  Undeclared variables in optimised quadrature code
>>>>
>>>> To manage notifications about this bug go to:
>>>> https://bugs.launchpad.net/ffc/+bug/883202/+subscriptions
>>>>
>>>
>>> --
>>> You received this bug notification because you are a member of FFC Core
>>> Team, which is subscribed to FFC.
>>> https://bugs.launchpad.net/bugs/883202
>>>
>>> Title:
>>>  Undeclared variables in optimised quadrature code
>>>
>>> Status in FEniCS Form Compiler:
>>>  Confirmed
>>>
>>> Bug description:
>>>  The below code fails to run due to undeclared variables:
>>>
>>>  from dolfin import *
>>>  # Below line causes failure
>>>  parameters["form_compiler"]["optimize"]       = True
>>>  parameters["form_compiler"]["representation"] = "quadrature"
>>>  mesh = UnitSquare(2, 2)
>>>  P1 = VectorFunctionSpace(mesh, "Lagrange", 2)
>>>  B  = VectorFunctionSpace(mesh, "Bubble", 3)
>>>  Mini = (P1 + B)
>>>
>>>
>>>  The Instant output is:
>>>
>>>
>>>  In file included from instant_module_c57922f6eccdd3bfa89632e935c27d66b0c22e0b_wrap.cxx:3085:0:
>>>  ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h: In member function ‘virtual void ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9_cell_integral_0_0::tabulate_tensor(double*, const double* const*, const ufc::cell&) const’:
>>>  ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h:1231:9: error: ‘nzc0’ was not declared in this scope
>>>  ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h:1231:14: error: ‘j’ was not declared in this scope
>>>  error: command 'gcc' failed with exit status 1
>>>
>>> To manage notifications about this bug go to:
>>> https://bugs.launchpad.net/ffc/+bug/883202/+subscriptions
>>>
>>
>> --
>> You received this bug notification because you are a member of FFC Core
>> Team, which is subscribed to FFC.
>> https://bugs.launchpad.net/bugs/883202
>>
>> Title:
>>  Undeclared variables in optimised quadrature code
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/ffc/+bug/883202/+subscriptions
>>
>
> --
> You received this bug notification because you are a member of FFC Core
> Team, which is subscribed to FFC.
> https://bugs.launchpad.net/bugs/883202
>
> Title:
>  Undeclared variables in optimised quadrature code
>
> Status in FEniCS Form Compiler:
>  Confirmed
>
> Bug description:
>  The below code fails to run due to undeclared variables:
>
>  from dolfin import *
>  # Below line causes failure
>  parameters["form_compiler"]["optimize"]       = True
>  parameters["form_compiler"]["representation"] = "quadrature"
>  mesh = UnitSquare(2, 2)
>  P1 = VectorFunctionSpace(mesh, "Lagrange", 2)
>  B  = VectorFunctionSpace(mesh, "Bubble", 3)
>  Mini = (P1 + B)
>
>
>  The Instant output is:
>
>
>  In file included from instant_module_c57922f6eccdd3bfa89632e935c27d66b0c22e0b_wrap.cxx:3085:0:
>  ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h: In member function ‘virtual void ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9_cell_integral_0_0::tabulate_tensor(double*, const double* const*, const ufc::cell&) const’:
>  ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h:1231:9: error: ‘nzc0’ was not declared in this scope
>  ffc_form_5ca75cda2f9ef647eacfccf50055f2967e691cf9.h:1231:14: error: ‘j’ was not declared in this scope
>  error: command 'gcc' failed with exit status 1
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ffc/+bug/883202/+subscriptions
>