← Back to team overview

ffc team mailing list archive

Inverse bug?

 

I'm observing some strange behaviour when using the inverse of a scalar. Running FFC on

  P1   = FiniteElement("Lagrange", "triangle", 1)
  v    = TestFunction(P1)
  temp = Constant("triangle")
  Tp   = 10
  L    = v*temp*(1*Tp)*dx

is fine, but running

  P1   = FiniteElement("Lagrange", "triangle", 1)
  v    = TestFunction(P1)
  temp = Constant("triangle")
  Tp   = 10
  L    = v*temp*(1/Tp)*dx

leads to the below error. For complex forms, I don't get an error when using 1/a, but the forms expect the wrong number of arguments.

Garth

Traceback (most recent call last):
  File "/usr/bin/ffc", line 180, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ffc", line 107, in main
    execfile(outname, ns)
  File "Test.py", line 18, in <module>
compile([a, L, M, element], "Test", "tensor", "dolfin", {'quadrature_points=': False, 'blas': False, 'precision=': '15', 'optimize': False}) File "/usr/lib/python2.5/site-packages/ffc/compiler/compiler.py", line 67, in compile (form_data, form_representation) = __compile_forms(forms, prefix, representation, language, options) File "/usr/lib/python2.5/site-packages/ffc/compiler/compiler.py", line 94, in __compile_forms
    form_data = analyze_form(form)
File "/usr/lib/python2.5/site-packages/ffc/compiler/compiler.py", line 186, in analyze_form
    form_data = analyze(form)
File "/usr/lib/python2.5/site-packages/ffc/compiler/analysis/analyze.py", line 51, in analyze
    form_data = FormData(form)
File "/usr/lib/python2.5/site-packages/ffc/compiler/analysis/formdata.py", line 60, in __init__ self.elements = self.__extract_elements(form, self.rank, self.num_coefficients) File "/usr/lib/python2.5/site-packages/ffc/compiler/analysis/formdata.py", line 111, in __extract_elements
    monomial = form.monomials[0]
IndexError: list index out of range



Follow ups