firedrakeproject / tsfc

Two-stage form compiler
Other
15 stars 25 forks source link

Tidy up interpolation tsfc<->firedrake interface #232

Closed ReubenHill closed 3 years ago

ReubenHill commented 4 years ago

From slack, @wence- said

the interpolation tsfc<->firedrake interface needs to be cleaned up so that we don't have to send data-carrying objects in. Right now, we generate the list of parloop args from the coefficients that complex_expression_dual_evaluation sends back

So if we mimic the idea for form compilation, what happens is that the initial form provides form.coefficients() in a canonical order and the kernel that tsfc sends back provides indices into that list of which coefficients are needed so you iterate over the indices and get the coefficients it also sends back some extra info like "do I need the cell orientations, etc..." one could imagine doing the same thing for interpolation kernels

So the new return values for compile_expression_dual_evaluation would be

Perhaps one wouldn't need to pass in the element and coordinates at all?

def compile_expression_dual_evaluation(expression, element, coordinates, *,
                                       domain=None, interface=None,
                                       parameters=None, coffee=False):

could become


def compile_expression_dual_evaluation(expression, *,
                                       domain=None, interface=None,
                                       parameters=None, coffee=False):
ReubenHill commented 4 years ago

Correction: we definitely need the element to know who's dual we are evaluating. We don't need coordinates because it's not needed for working out the pullback to the reference to cell - you can either get it from the expression or from the domain kwarg.