Hi, I try to solve the above steady stokes equation with Dirichlet boundary conditions in the matrix form (Ax = b).

The vector b is implemented as

fespace Xh(Th, [P2, P2, P1]);

fespace Vh(Th, P2), Qh(Th, P1);

Vh u, v, c;

Qh p;

real delta = 0.8;

func rad = sqrt(x^2+y^2);

c = 1/rad - delta*y/rad^2;

macro usx() dx(c)-( dx(c)*N.x+dy(c)*N.y )*N.x //

macro usy() dy(c)-( dx(c)*N.x+dy(c)*N.y )*N.y //

varf bcl( [u, v, p], [uu, vv, pp] ) = on(C1, u=usx, v=usy) + on(C2, u=0, v=0);

real[int] b = bcl(0, Xh);

I can not obtain correct results using the above codes. I also try the following codes:

(1)

macro usx(c) dx(c)-( dx(c)*N.x+dy(c)*N.y )*N.x //

macro usy(c) dy(c)-( dx(c)*N.x+dy(c)*N.y )*N.y //

(2)

func usx = dx(c)-( dx(c)*N.x+dy(c)*N.y )*N.x;

func usy = dy(c)-( dx(c)*N.x+dy(c)*N.y )*N.y;

but none of them can give the desired results.

I would appreciate it if anyone could give me some suggestions on how to implement the Dirichlet boundary conditions. thanks in advance.