Hi,
I have a 2D region, on one side I want to impose Dirichlet boundary condition only in one direction. For both direction I do the following(suppose our boundary values are zero):
u1 = constant((0.0,0.0))
bc = DirichletBC(V, u1, boundary)
To only impose zero boundary condition only in one direction(say X direction) I think of the following:
class bound(Expression):
def eval(self, values, x):
value[0] = 0
def value_shape(self):
return(2,)
then I instantiate this class and impose it on the boundary:
u2 = bound()
bc = DirichletBC(V, u2, boundary)
I don't know whether this method is correct in defining such boundary conditions or not? In my case I do not get correct results with my code and I suspect this part of my code.