Hello,
I would like to introduce the function of coordinates that at the initial time step is given by
class f(UserExpression):
def eval(self, values, x):
if x[0] > 0.5:
values[0] = 1.0
else:
values[0] = 0.0
i.e. the theta-function in x-direction .Then each new time step I want
f(x, t+dt) = f (x - v(x,t) * dt)
where v is coming from the solution of the variational problem. Physically, v is velocity field, and f indicates which type of fluid is where, so this update says that the fluid at the point x is one that came there from the point x - v(x)*dt with velocity v. Two fluids have different mechanical parameters, so f will be a parameter in the solving of the variational equation. Any ideas how can I do it? Thank you!