Unable to use FErari from FFC

Bug #1105261 reported by Francis Russell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FErari
New
Undecided
Unassigned

Bug Description

Attempting to compile a form using tensor contraction with optimizations enabled leads to the following error. I was unable to do this with either the versions of FFC/FErari currently in precise, nor the versions in the FEniCS development PPAs:

$ ffc --optimize -r tensor --verbose mass_matrix_f1_p1_q1_tensor.ufl
This is FFC, the FEniCS Form Compiler, version 1.0.0+.
For further information, visit http://www.fenics.org/ffc/.

Compiling form mass_matrix_f1_p1_q1_tensor

Compiler stage 1: Analyzing form(s)
-----------------------------------

  Name: 'a'
  Rank: 2
  Cell: <triangle cell in R2>
  Topological dimension: 2
  Geometric dimension: 2
  Number of facets: 3
  Number of coefficients: 1
  Number of cell domains: 1
  Number of exterior facet domains: 0
  Number or interior facet domains: 0
  Number or point domains: 0
  Number of macro cell domains: 0
  Number of surface domains: 0
  Arguments: '[v_0, v_1]'
  Coefficients: '[w_0]'
  Argument names: '[v, u]'
  Coefficient names: '[f]'
  Unique elements: 'CG1(?)'
  Unique sub elements: 'CG1(?)'

  representation: tensor
  Selecting quadrature degree based on total polynomial degree of integrand: 3
  quadrature_degree: auto --> 3
  quadrature_rule: auto --> default

Compiler stage 1 finished in 0.00547409 seconds.

Compiler stage 2: Computing intermediate representation
-------------------------------------------------------
  Computing representation of 1 elements
  Computing representation of 1 dofmaps
  Reusing element from cache
  Computing representation of integrals
  Computing tensor representation
  Extracting monomial form representation from UFL form
  Transforming monomial form to reference element
  Reusing element from cache
  Reusing element from cache
  Reusing element from cache
  Precomputing integrals on reference element
  Reusing element from cache
  27 entries computed in 0.00179 seconds
  Shape of reference tensor: (3, 3, 3)
  Primary multi index: rank = 2 dims = [3, 3] indices = [[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2]]
  Secondary multi index: rank = 1 dims = [3] indices = [[0], [1], [2]]
  Internal multi index: rank = 0 dims = [] indices = [[]]
  Secondary multi index: rank = 1 dims = [3] indices = [[0], [1], [2]]
  External multi index: rank = 0 dims = [] indices = [[]]
  Computing representation of forms

Compiler stage 2 finished in 0.268745 seconds.

Compiler stage 3: Optimizing intermediate representation
--------------------------------------------------------
  Calling FErari to optimize tensor of size 3 x 3 x 3 (27 entries)

Compiler stage 3 finished in 0.0203249 seconds.

Compiler stage 4: Generating code
---------------------------------
  Generating code for 1 element(s)
  Removing unused variable: tmp2
  Removing unused variable: tmp1
  Removing unused variable: tmp7
  Removing unused variable: tmp6
  Removing unused variable: tmp5
  Removing unused variable: tt
  Removing unused variable: ss
  Removing unused variable: rr
  Removing unused variable: tmp2
  Removing unused variable: tmp1
  Removing unused variable: tmp7
  Removing unused variable: tmp6
  Removing unused variable: tmp5
  Removing unused variable: tt
  Removing unused variable: ss
  Removing unused variable: rr
  Removing unused variable: tmp2
  Removing unused variable: tmp1
  Removing unused variable: tmp7
  Removing unused variable: tmp6
  Removing unused variable: tmp5
  Removing unused variable: tt
  Removing unused variable: ss
  Removing unused variable: rr
  Removing unused variable: K_11
  Removing unused variable: K_10
  Removing unused variable: K_01
  Removing unused variable: K_00
  Removing unused variable: tmp2
  Removing unused variable: tmp1
  Removing unused variable: tmp7
  Removing unused variable: tmp6
  Removing unused variable: tmp5
  Removing unused variable: tt
  Removing unused variable: ss
  Removing unused variable: rr
  Removing unused variable: tmp2
  Removing unused variable: tmp1
  Removing unused variable: tmp7
  Removing unused variable: tmp6
  Removing unused variable: tmp5
  Removing unused variable: tt
  Removing unused variable: ss
  Removing unused variable: rr
  Removing unused variable: tmp2
  Removing unused variable: tmp1
  Removing unused variable: tmp7
  Removing unused variable: tmp6
  Removing unused variable: tmp5
  Removing unused variable: tt
  Removing unused variable: ss
  Removing unused variable: rr
  Generating code for 1 dofmap(s)
  Generating code for integrals
Traceback (most recent call last):
  File "/usr/bin/ffc", line 195, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ffc", line 176, in main
    compile_form(ufd.forms, ufd.object_names, prefix, parameters)
  File "/home/fpr02/flopy/ffc/ffc/compiler.py", line 165, in compile_form
    code = generate_code(oir, prefix, parameters)
  File "/home/fpr02/flopy/ffc/ffc/codegeneration.py", line 76, in generate_code
    code_integrals = [_generate_integral_code(ir, prefix, parameters) for ir in ir_integrals]
  File "/home/fpr02/flopy/ffc/ffc/codegeneration.py", line 200, in _generate_integral_code
    code = r.generate_integral_code(ir, prefix, parameters)
  File "/home/fpr02/flopy/ffc/ffc/tensor/tensorgenerator.py", line 55, in generate_integral_code
    code["tabulate_tensor"] = _tabulate_tensor(ir, parameters)
  File "/home/fpr02/flopy/ffc/ffc/tensor/tensorgenerator.py", line 81, in _tabulate_tensor
    t_code = _generate_tensor_contraction(AK, parameters, g_set)
  File "/home/fpr02/flopy/ffc/ffc/tensor/tensorgenerator.py", line 160, in _generate_tensor_contraction
    return _generate_tensor_contraction_optimized(terms, parameters, g_set)
  File "/home/fpr02/flopy/ffc/ffc/tensor/tensorgenerator.py", line 269, in _generate_tensor_contraction_optimized
    name = element_tensor(i, j)
  File "/home/fpr02/flopy/ffc/ffc/tensor/tensorgenerator.py", line 243, in <lambda>
    element_tensor = lambda i, j: format["element tensor"](i)
TypeError: 'dict' object is not callable

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.