problem with ufl function created with discrete function + grid function
This example indicates the problem: error.py i.e. creating a ufl function using a discrete function + ufl expression is fine, whereas creating it with a discrete function + grid function is not. (possibly I'm misunderstanding the cause of the error, but the example demonstrates the problem nonetheless).