Changing the value imposed in the DirichletBC
isn’t what I had in mind. Rather that your initial state:
u_n = interpolate(Constant(800), V)
would benefit from being a smooth transition from your DirichletBC
value of 400, to your maximum value of 800. You could pick any smooth transition function that you like. This transition can even occur over a very small spatial region.