Pass information about which coefficients each integral needs

Issue #27 resolved
Martin Sandve Alnæs created an issue

Through a new function

  const vector<bool> & enabled_coefficients() const = 0;

in each integral class, we can avoid restricting every form coefficient in the dolfin assembler for integrals where a subset of the coefficients are used. This is quite common, e.g. in

  g*v*dx + f*v*ds

the coefficients g and f are only used by one of the two integrals but the assembler will restrict them both before every call to tabulate_tensor.

The branch martinal/topic-add-enabled-coefficients-per-integral in ffc and dolfin contains the dolfin-ufc side of the implementation with a hardcoded hacky implementation of enabled_coefficients(). Benchmarks in dolfin shows no performance regression.

The missing part is just to generate the enabled_coefficients() implementation properly in ffc, which should be easy.

Comments (5)

  1. Martin Sandve Alnæs reporter

    I think it's working now with branches in ufl, ffc and dolfin, all named martinal/topic-add-enabled-coefficients-per-integral

    I'm posting some benchmark results on the list for better response than this issue will have.

  2. Log in to comment