Consider a simple expression:
expr = a*u*v*dx + b*w*z*dx
Is there a function in ufl which will return the coefficients of a terminal in expr? E.g:
ufl
expr
expr.as_coefficient(a) >>> u*v*dx expr.as_coefficient(b) >>> w*z*dx