gmarkall / manycore_form_compiler

MCFC is deprecated. See https://code.launchpad.net/~grm08/ffc/pyop2
https://code.launchpad.net/~grm08/ffc/pyop2
GNU General Public License v3.0
3 stars 1 forks source link

Turn off relabeling of Coefficients and Arguments #69

Open gmarkall opened 12 years ago

gmarkall commented 12 years ago

Martin Alnaes says:

I'm considering another possible change to compute_form_data/preprocess behaviour. Today all Coefficient and Argument objects are relabeled to have contiguous counts. This requires rebuilding almost the entire integrand expression (a call to replace in preprocess). An optimization would be to remove that call and only store the mapping {original:renumbered} in the form data. Then form compilers need to apply that mapping whenever you access an original form argument in the integrand expression but want the renumbered version.

In fact, you can get this behaviour already by passing replace_functions=True to compute_form_data/preprocess, and I made it possible to make the transition gradually. I think it's easiest to just search for "replace_functions" and read the code to understand in detail.

We should try passing replace_functions=False to compute_form_data, and removing the code that undoes this relabeling in MCFC. It should simplify our code somewhat since at present, UFL relabels everything then we have to figure out the mapping back to the original labels.