How to update an UserExpression for the next time step?

This is a Python related question. If you assign a new variable to the Python object f_prev, by equality:

You need to redefine objects using f_prev.

If you use

f_prev.t=t
f_prev.u=u_prev

You do not Need to define the variational forms

1 Like