I have a rectangular domain, divided into two sub domains. I have a time dependent problem to be solved. I would like the second sub domain to act as a sponge layer, damping out the function values in this sub domain. I would like to do this manually by directly assigning in the loop $$u_1 = u$$ in sub domain 0 and $$u_1 = \mu u$$ in sub domain 1 where $$\mu \in (0,1)$$ . Can this be done, and if so, how? I've tried to give the relevant parts of my code below. Any help is greatly appreciated!
# I've defined the function spaces, trial functions,
# test functions and all that here
cf = CellFunction("size_t", mesh, 0)
o2 = AutoSubDomain(lambda x: x[0] > 1)
o2.mark(cf, 1)
# I've defined all initial conditions, functions, boundary
# conditions and the variational forms here
u = Function(V)
t = dt
while t < T+DOLFIN_EPS:
bc.t = t
begin("Computing at time t=%g" %g)
b = assemble(rhs(F))
bc.apply(A, b)
solve(A, u.vector(), b)
end()
# Here, I want u1 to assign u in sub domain 0,
# and I want u to assign mu * u in subdomain 1
u1.assign(u)
t += dt