Add the composition operator

Issue #18 new
Martin Sandve Alnæs created an issue

Given a Coefficient or other spatially dependent expression

f = f(x)

allow taking the composition of f and an expression e = e(x):

g = g(x) = (f o e)(x) = f(e(x))

possible syntax:

g = f(e)

possible representation type:

Composition(f, e)

differentiation is easy:

d/dv [f(e)] = d/de[f] : d/dv [e]

free indices in arguments can be disallowed if that's hard to define properly.

The call operator is used for several purposes already, but I think it's not used with a UFL expression as argument.

I think this is quite easy to implement in UFL. The problem is that evaluating a coefficient at an arbitrary point in the generated code is not a local-to-cell operation and thus does not fit into the existing UFC based framework. As such this feature requires callbacks from generated ufc code to (dolfin) functions. This can be made possible by adding a ufc::real_operator interface (a generalization of ufc::function) and a suitable passing of ufc::real_operator pointers to tabulate_tensor signatures. UFL Coefficients mapping to the ufc::real_operator arguments must live in a suitable space, e.g. a new ufl.OperatorSpace(domain, range, regularity).

Comments (1)

  1. Log in to comment