In order to impose two different boundary conditions on some sides of a square I would like to set two different functions on two different boundaries. However, when trying to call
GridFunction.Set twice, I find that the second call overwrites values computed by the first one. Is there a way to have GridFunction.Set only change the degrees of freedom associated to the boundary passed as definedon kwarg?
Other related thoughts:
a) I am aware that on a square I could probably come up with a simple myfunc12 that is a combination of myfunc1 and myfunc2 and features the correct expression on both boundaries. However, I would not like to do so because the square is just the first step towards more complex domains where finding the correct combination would be cumbersome.
b) I had also thought of defining two different functions and summing them, but that would give a boundary value of 2 on the top-right corner, wouldn’t it? Please find a simple example in the code below:
[code]from time import sleep
from ngsolve import *
from netgen.geom2d import SplineGeometry
ngsglobals.msg_level = 0
geo = SplineGeometry()
geo.AddRectangle((0., 0.), (1, 1), leftdomain=1, rightdomain=0, bcs=[“Bottom”, “Right”, “Top”, “Left”])
mesh = Mesh(geo.GenerateMesh(maxh=0.1))
V = H1(mesh, order=1)
u = GridFunction(V)
myfunc1 = y
myfunc2 = x