# How do we implement the symmetry condition?

Hello, everyone, I would like to ask a question. I solve the Stokes equation in a channel, the boundary conditions are as follows

There is a symmetry condition on the bottom boundary, how to implement this boundary condition? The symmetry condition looks like a combination of Dirichlet and Neumann boundary conditions.

This problem confuses me a lot, can anyone give me some suggestions on implementing the symmetry condition? I would appreciate any help you give me.

The minimum code

``````mesh Th=square(50,10,[5*x,y]);
plot(Th);
fespace Vh(Th,P2);
fespace Ph(Th,P1);

Vh u1,u2,v1,v2;
Ph p,q;

macro Eps(u,v) [ dx(u),dy(v), (dx(v)+dy(u))*0.5, (dx(v)+dy(u))*0.5 ] //
macro div(u1,u2) (dx(u1)+dy(u2) ) //

func pin=10000.0;
func pout=0.0;

solve Stokes( [u1,u2,p],[v1,v2,q] ) =
int2d(Th) ( 2*Eps(u1,u2)'*Eps(v1,v2) - div(v1,v2)*p -div(u1,u2)*q)
+int1d(Th,4)(pin*(v1*N.x+v2*N.y))+int1d(Th,2)(pout*(v1*N.x+v2*N.y))
+ on(3,u1=0,u2=0)
+ on(1,u2=0, dy(u1)=0;);  //How to implement the symmetry condition ???

plot(p,fill=1);

``````

It should be enforced naturally due to the neglect of the boundary term arising
via integration by parts.

`on(1,u2=0);`

Continuing the discussion from How do we implement the symmetry condition?: