Subject: [FFC-dev] [Bug 459473] Re: Problems compiling forms with inv(tensor)*tensor

From: oelgaard <[email-masked]>
Date: Sat, 24 Oct 2009 13:42:37 -0000

** Changed in: ffc
       Status: New => Confirmed

** Changed in: ffc
     Assignee: (unassigned) => oelgaard (k-b-oelgaard)

-- 
Problems compiling forms with inv(tensor)*tensor
https://bugs.launchpad.net/bugs/459473
You received this bug notification because you are subscribed to FFC.

Status in FEniCS Form Compiler: Confirmed

Bug description:
Making the following trivial modification to the Poisson demo (in DOLFIN),

...
I = Identity(v.cell().d)
a = inner(inv(I)*grad(v), grad(u))*dx
L = v*f*dx - v*g*ds
...

causes ffc to fail with:

raceback (most recent call last):
  File "demo.py", line 44, in <module>
    problem = VariationalProblem(a, L, bc)
  File "pythonfoo/dolfin/variationalproblem.py", line 32, in __init__
    self.a = Form(a)
  File "pythonfoo/dolfin/form.py", line 30, in __init__
    (self._compiled_form, module, self.form_data) = jit(form, options)
  File "pythonfoo/dolfin/jit.py", line 44, in mpi_jit
    return local_jit(*args, **kwargs)
  File "pythonfoo/dolfin/jit.py", line 108, in jit
    return jit_compile(form, options)
  File "pythonfoo/ffc/jit/jit.py", line 58, in jit
    return jit_form(object, options)
  File "pythonfoo/ffc/jit/jit.py", line 91, in jit_form
    compile(form, signature, options)
  File "pythonfoo/ffc/compiler/compiler.py", line 90, in compile
    form_code = generate_form_code(form_data, representations, prefix, format.format, options)
  File "pythonfoo/ffc/compiler/compiler.py", line 177, in generate_form_code
    codes.append(code_generator.generate_integrals(representations[i], format))
  File "pythonfoo/ffc/compiler/quadrature/quadraturegenerator.py", line 73, in generate_integrals
    code.update(self.generate_cell_integrals(form_representation, format))
  File "pythonfoo/ffc/compiler/quadrature/quadraturegenerator.py", line 101, in generate_cell_integrals
    self.generate_cell_integral(form_representation, transformer, integrals, format)
  File "pythonfoo/ffc/compiler/quadrature/quadraturegenerator.py", line 161, in generate_cell_integral
    integrals, Indent, format)
  File "pythonfoo/ffc/compiler/quadrature/quadraturegenerator.py", line 342, in __generate_element_tensor
    integral_code, num_ops = transformer.generate_code(integral.integrand(), Indent, interior)
  File "pythonfoo/ffc/compiler/quadrature/quadraturetransformerbase.py", line 696, in generate_code
    loop_code = self.visit(integrand)
  File "pythonfoo/ufl/algorithms/transformations.py", line 132, in visit
    r = h(o)
  File "pythonfoo/ffc/compiler/quadrature/quadraturetransformerbase.py", line 528, in index_sum
    ops.append(self.visit(summand))
  File "pythonfoo/ufl/algorithms/transformations.py", line 128, in visit
    r = h(o, *map(self.visit, o.operands()))
  File "pythonfoo/ufl/algorithms/transformations.py", line 132, in visit
    r = h(o)
  File "pythonfoo/ffc/compiler/quadrature/quadraturetransformerbase.py", line 491, in indexed
    code = self.visit(indexed_expr)
  File "pythonfoo/ufl/algorithms/transformations.py", line 132, in visit
    r = h(o)
  File "pythonfoo/ffc/compiler/quadrature/quadraturetransformerbase.py", line 616, in component_tensor
    code = self.visit(component_expr)
  File "pythonfoo/ufl/algorithms/transformations.py", line 132, in visit
    r = h(o)
  File "pythonfoo/ffc/compiler/quadrature/quadraturetransformerbase.py", line 528, in index_sum
    ops.append(self.visit(summand))
  File "pythonfoo/ufl/algorithms/transformations.py", line 128, in visit
    r = h(o, *map(self.visit, o.operands()))
  File "pythonfoo/ufl/algorithms/transformations.py", line 132, in visit
    r = h(o)
  File "pythonfoo/ffc/compiler/quadrature/quadraturetransformerbase.py", line 491, in indexed
    code = self.visit(indexed_expr)
  File "pythonfoo/ufl/algorithms/transformations.py", line 132, in visit
    r = h(o)
  File "pythonfoo/ffc/compiler/quadrature/quadraturetransformerbase.py", line 616, in component_tensor
    code = self.visit(component_expr)
  File "pythonfoo/ufl/algorithms/transformations.py", line 128, in visit
    r = h(o, *map(self.visit, o.operands()))
  File "pythonfoo/ffc/compiler/quadrature/quadraturetransformer.py", line 210, in division
    code[key] = val + format_div + format_grouping(denominator)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

---

From: oelgaard <[email-masked]>
Date: Sat, 24 Oct 2009 14:39:19 -0000

** Changed in: ffc
       Status: Confirmed => Fix Committed

Status in FEniCS Form Compiler: Fix Committed

Bug description:

...
I = Identity(v.cell().d)

causes ffc to fail with:

---

From: oelgaard <[email-masked]>
Date: Sat, 24 Oct 2009 13:42:45 -0000

Quoting Harish Narayanan <[email-masked]>:

> Public bug reported:

This should be fixed now.

Kristian

> ** Affects: ffc
>      Importance: Undecided
>          Status: New
> You received this bug notification because you are a member of FEniCS
> Team, which is subscribed to FFC.
>
> Status in FEniCS Form Compiler: New
>
> Bug description:

Bug description:

...
I = Identity(v.cell().d)

causes ffc to fail with:

---

From: Harish Narayanan <[email-masked]>
Date: Sat, 24 Oct 2009 16:52:12 +0200

> This should be fixed now.

Thanks again!

Harish