Impose boundary conditions

Hi everyone!
I want to know how I can impose Dirichlet boundary condition on \Gamma_ {E2} a different value than in the cases !mesh|690x365 Gamma_ {E3} = \Gamma_ {E1} < \Gamma_ {E2}, in FreeFem. Is there an example of how to build my mesh that way?

Best regards,

Dear Emmanuel,

You want to divide the boundary \Gamma_{east} into three in order to impose Dirichlet boundary condition with a different value in each of those sub-boundaries, right? One way to do that is creating three rectangular meshes and then you can glue them. Here is one example with two rectangles:

int m = 2 ; int n = m;
real x0= 0.0 , x1= 2.0 ;
real y0= 0.0 , y1= 0.5 , y2= 1.0;
int[int] l1 = [1,2,3,4] ;
int[int] l2 = [3,2,6,4] ;
mesh Th1 = square(20n,10m,[x0+(x1-x0)x,y0+(y1-y0)y],label=l1,flags=0);
mesh Th2 = square(20
n,10
m,[x0+(x1-x0)*x,y1+(y2-y1)*y],label=l2,flags=0);
mesh Th = Th1+Th2;

Hope it helps you.
Best regards,
Jorge Morvan

Thanks, Jorge
I built it in another way:
border G1 (t=0,1){x=10t; y=0; label=1;}
border G21(t=0,1){x=10; y=4
t; label=2;}
border G22(t=0,1){x=10; y=4+4t; label=3;}
border G23(t=0,1){x=10; y=8+2
t; label=4;}
border G3 (t=0,1){x=10-10t;y=10; label=5;}
border G4 (t=0,1){x=0; y=10-10
t; label=6;}
mesh Th = buildmesh(G1(80)+G21(80)+G22(80)+G23(80)+G3(80)+G4(80));

1 Like