Sensitivities added via attached source terms are problematic
We need to be able to propagate sensitivities through source terms attached to expressions. This is important for particle coupling, for example. However, Expression::attach_source_expression()
doesn't work properly for this because if the source term pulls in new dependencies those aren't properly examined. This is because the source terms are not necessarily examined when the graph is analyzed.
Hang provided this patch to expose the issue.