Add the composition operator
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.OperatorSpa
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Low
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Martin Sandve Alnæs