Changing only boundary dofs of gridfunction

I’ve been hvaing issues with my Navier-Stokes solver where I have time dependent dirichlet boundaries. Hence, I’ve been using the Set(u_n, BND) method to update these boundaries, however I discovered that the internal nodes are set to zero when this is done, which breaks my time integration. Is there an easy way to circumvent this problem? The only other post I’ve found on the matter (Imposing two different boundary conditions on some sides of a square - #4 by christopher) is rather old, so I hope there is some easier way to resolve this now.


u.Interpolate(cf, definedon=...)

should do the trick

Worked like a charm, thank you!