FEniCS / ffcx

Next generation FEniCS Form Compiler for finite element forms
https://fenicsproject.org
Other
144 stars 38 forks source link

FFCx can't handle forms with multiple quadrature degrees/rules in single form #394

Closed jorgensd closed 2 years ago

jorgensd commented 2 years ago

Originally reported at: https://fenicsproject.discourse.group/t/help-needed-in-analyzing-a-mindlin-plate-in-fenicsx/6768?u=dokken

Following is a MWE:

import dolfinx
from mpi4py import MPI
import ufl

N = 4
mesh = dolfinx.UnitSquareMesh(MPI.COMM_WORLD,N, N,dolfinx.cpp.mesh.CellType.quadrilateral)

deg = 1
We = ufl.FiniteElement("Lagrange", mesh.ufl_cell(), deg)
V = dolfinx.FunctionSpace(mesh, We)

u = ufl.TestFunction(V)
du = ufl.TrialFunction(V)

dx_shear = ufl.dx(metadata={"quadrature_degree": 2*deg-2})
a = ufl.inner(du, u) * ufl.dx + ufl.inner(du, u) * dx_shear
A = dolfinx.fem.assemble_matrix(a)

with error

libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:897:50: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
        const double J_c0 = coordinate_dofs[0] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C0_D10_Qf81[0][0][iq][3];
                                                 ^~~~~~~~~~~~~~~
                                                 FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
    static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:897:102: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
        const double J_c0 = coordinate_dofs[0] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C0_D10_Qf81[0][0][iq][3];
                                                                                                     ^~~~~~~~~~~~~~~
                                                                                                     FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
    static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:897:154: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
        const double J_c0 = coordinate_dofs[0] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C0_D10_Qf81[0][0][iq][3];
                                                                                                                                                         ^~~~~~~~~~~~~~~
                                                                                                                                                         FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
    static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:897:206: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
        const double J_c0 = coordinate_dofs[0] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C0_D10_Qf81[0][0][iq][3];
                                                                                                                                                                                                             ^~~~~~~~~~~~~~~
                                                                                                                                                                                                             FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
    static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:898:50: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
        const double J_c3 = coordinate_dofs[1] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C1_D01_Qf81[0][0][iq][3];
                                                 ^~~~~~~~~~~~~~~
                                                 FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
    static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:898:102: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
        const double J_c3 = coordinate_dofs[1] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C1_D01_Qf81[0][0][iq][3];
                                                                                                     ^~~~~~~~~~~~~~~
                                                                                                     FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
    static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:898:154: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
        const double J_c3 = coordinate_dofs[1] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C1_D01_Qf81[0][0][iq][3];
                                                                                                                                                         ^~~~~~~~~~~~~~~
                                                                                                                                                         FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
    static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:898:207: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
        const double J_c3 = coordinate_dofs[1] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C1_D01_Qf81[0][0][iq][3];
                                                                                                                                                                                                              ^~~~~~~~~~~~~~~
                                                                                                                                                                                                              FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
    static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:899:50: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
        const double J_c1 = coordinate_dofs[0] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C1_D01_Qf81[0][0][iq][3];
                                                 ^~~~~~~~~~~~~~~
                                                 FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
    static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:899:102: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
        const double J_c1 = coordinate_dofs[0] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C1_D01_Qf81[0][0][iq][3];
                                                                                                     ^~~~~~~~~~~~~~~
                                                                                                     FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
    static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:899:154: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
        const double J_c1 = coordinate_dofs[0] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C1_D01_Qf81[0][0][iq][3];
                                                                                                                                                         ^~~~~~~~~~~~~~~
                                                                                                                                                         FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
    static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:899:206: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
        const double J_c1 = coordinate_dofs[0] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C1_D01_Qf81[0][0][iq][3];
                                                                                                                                                                                                             ^~~~~~~~~~~~~~~
                                                                                                                                                                                                             FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
    static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:900:50: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
        const double J_c2 = coordinate_dofs[1] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C0_D10_Qf81[0][0][iq][3];
                                                 ^~~~~~~~~~~~~~~
                                                 FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
    static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:900:102: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
        const double J_c2 = coordinate_dofs[1] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C0_D10_Qf81[0][0][iq][3];
                                                                                                     ^~~~~~~~~~~~~~~
                                                                                                     FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
    static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:900:154: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
        const double J_c2 = coordinate_dofs[1] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C0_D10_Qf81[0][0][iq][3];
                                                                                                                                                         ^~~~~~~~~~~~~~~
                                                                                                                                                         FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
    static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:900:207: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
        const double J_c2 = coordinate_dofs[1] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C0_D10_Qf81[0][0][iq][3];
                                                                                                                                                                                                              ^~~~~~~~~~~~~~~
                                                                                                                                                                                                              FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
    static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:909:27: error: use of undeclared identifier 'FE3_C0_Qf81'; did you mean 'FE3_C0_Qa2c'?
            t0[i] = fw0 * FE3_C0_Qf81[0][0][iq][i];
                          ^~~~~~~~~~~
                          FE3_C0_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:880:25: note: 'FE3_C0_Qa2c' declared here
    static const double FE3_C0_Qa2c[1][1][1][4] = { { { { 0.25, 0.25, 0.25, 0.25 } } } };
                        ^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:912:33: error: use of undeclared identifier 'FE3_C0_Qf81'; did you mean 'FE3_C0_Qa2c'?
                A[4 * i + j] += FE3_C0_Qf81[0][0][iq][j] * t0[i];
                                ^~~~~~~~~~~
                                FE3_C0_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:880:25: note: 'FE3_C0_Qa2c' declared here
    static const double FE3_C0_Qa2c[1][1][1][4] = { { { { 0.25, 0.25, 0.25, 0.25 } } } };
                        ^
18 errors generated.
Traceback (most recent call last):
  File "/usr/lib/python3.9/distutils/unixccompiler.py", line 117, in _compile
    self.spawn(compiler_so + cc_args + [src, '-o', obj] +
  File "/usr/lib/python3.9/distutils/ccompiler.py", line 910, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/usr/lib/python3.9/distutils/spawn.py", line 87, in spawn
    raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/usr/bin/clang-12' failed with exit code 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/cffi/ffiplatform.py", line 51, in _build
    dist.run_command('build_ext')
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.9/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/usr/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/usr/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "/usr/lib/python3.9/distutils/command/build_ext.py", line 529, in build_extension
    objects = self.compiler.compile(sources,
  File "/usr/lib/python3.9/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/usr/lib/python3.9/distutils/unixccompiler.py", line 120, in _compile
    raise CompileError(msg)
distutils.errors.CompileError: command '/usr/bin/clang-12' failed with exit code 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/shared/debug/mwe.py", line 19, in <module>
    A = dolfinx.fem.assemble_matrix(a)
  File "/usr/lib/python3.9/functools.py", line 877, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/root/shared/dolfinx/python/dolfinx/fem/assemble.py", line 278, in assemble_matrix
    A = cpp.fem.create_matrix(_create_cpp_form(a))
  File "/root/shared/dolfinx/python/dolfinx/fem/assemble.py", line 27, in _create_cpp_form
    return Form(form)._cpp_object
  File "/root/shared/dolfinx/python/dolfinx/fem/form.py", line 42, in __init__
    self._ufc_form, module, self._code = jit.ffcx_jit(
  File "/root/shared/dolfinx/python/dolfinx/jit.py", line 61, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/root/shared/dolfinx/python/dolfinx/jit.py", line 215, in ffcx_jit
    r = ffcx.codegeneration.jit.compile_forms([ufl_object], parameters=p_ffcx, **p_jit)
  File "/root/shared/ffcx/ffcx/codegeneration/jit.py", line 167, in compile_forms
    impl = _compile_objects(decl, forms, form_names, module_name, p, cache_dir,
  File "/root/shared/ffcx/ffcx/codegeneration/jit.py", line 252, in _compile_objects
    ffibuilder.compile(tmpdir=cache_dir, verbose=True, debug=cffi_debug)
  File "/usr/local/lib/python3.9/dist-packages/cffi/api.py", line 725, in compile
    return recompile(self, module_name, source, tmpdir=tmpdir,
  File "/usr/local/lib/python3.9/dist-packages/cffi/recompiler.py", line 1564, in recompile
    outputfilename = ffiplatform.compile('.', ext,
  File "/usr/local/lib/python3.9/dist-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/usr/local/lib/python3.9/dist-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: CompileError: command '/usr/bin/clang-12' failed with exit code 1
IgorBaratta commented 2 years ago

I think we should have two separate kernels, one for each quadrature rule.

michalhabera commented 2 years ago

I think we should have two separate kernels, one for each quadrature rule.

That is not true. FFCx supported multiple quad rules per integral, see https://github.com/FEniCS/ffcx/pull/405

garth-wells commented 2 years ago

Is this fixed by #405?

michalhabera commented 2 years ago

Yes, resolved in #405 .

michalhabera commented 2 years ago

@IgorBaratta I am not sure if this was the only reason for https://github.com/FEniCS/ufl/issues/70, in that case you can close it too.

Please note we have always one generated kernel per one IntegralData, but intermediate representation for this kernel has a dictionary for integrands which maps quadrature_rule --> integrand expression tree. See also https://github.com/FEniCS/ufl/pull/27 for related discussions.

IgorBaratta commented 2 years ago

@IgorBaratta I am not sure if this was the only reason for FEniCS/ufl#70, in that case you can close it too.

Please note we have always one generated kernel per one IntegralData, but intermediate representation for this kernel has a dictionary for integrands which maps quadrature_rule --> integrand expression tree. See also FEniCS/ufl#27 for related discussions.

That's not the only issue that motivated FEniCS/ufl#70. I think a flag would do the trick. And the change would allow tabulating data at quadrature points and some simplification on the input data. I would preferably do it at UFL level than reverse engineer forms/integral data in ffcx.

michalhabera commented 2 years ago

@IgorBaratta I am not sure if this was the only reason for FEniCS/ufl#70, in that case you can close it too. Please note we have always one generated kernel per one IntegralData, but intermediate representation for this kernel has a dictionary for integrands which maps quadrature_rule --> integrand expression tree. See also FEniCS/ufl#27 for related discussions.

That's not the only issue that motivated FEniCS/ufl#70. I think a flag would do the trick. And the change would allow tabulating data at quadrature points and some simplification on the input data. I would preferably do it at UFL level than reverse engineer forms/integral data in ffcx.

I do not see any reverse engineering there, FFCx just generates code for how it was preprocessed in UFL. Arguably, one could wish for better control over what UFL does (especially control grouping of terms, not only for forced quadrature degree but also for the estimated). But compute_form_data UFL interface is just bloated now and already smells, would need redesign.

What simplifications on input data do you mean? Multiple quad rules per kernel has the advantage that temporaries which do not depend on quadrature loop are computed just once. Also, the overhead of packing data for kernel on the caller side is smaller.