Mesh problem bad sens

help please ,i cant mesh my space "Meshing error: Bamg
number : 777, " bad sens and i dont know where the problem is i checked in every common poit its verifies that the space is closed
this is my program
//datas
int a=1;
int N=50;
//trace des bordures:

border ommega1(t=0,1){label=1;x=2at;y=-2a(t-1);};
border ommega2(t=0,1){label=1;x=-2a(t-1);y=-2at;};
border ommega3(t=0,1){label=1;x=0;y=at-2a;};
border ommega4(t=0,1){label=2;x=asin(pit);y=acos(pit);};
border ommega5(t=0,1){label=1;x=0;y=a*t+a;};

plot(ommega1(N)+ommega2(N)+ommega3(N)+ommega4(N)+ommega5(N));

mesh Th= buildmesh(ommega1(N)+ommega2(N)+ommega3(N)+ommega4(N)+ommega5(N));

plot(Th);

There is problem with your parametric equations, they are not defined correctly.
Instead you can try this code.

//data for
int a=1;
int n=50;
// trace des borders
border b1(t=0,2){x=t;y=t-2; label=1;}
border b2(t=2,0){x=t;y=-t+2; label=2;}
border b3(t=2,1){x=0;y=t; label=3;}
border b4(t=1,-1){x=sqrt(1-t^2);y=t; label=4;}
border b5(t=1,2){x=0;y=-t; label=5;}

plot(b1(n)+b2(n)+b3(n)+b4(n)+b5(n));

mesh Th=buildmesh(b1(n)+b2(n)+b3(n)+b4(n)+b5(n));
plot(Th);

1 Like

thank you it worked i tried again and made sure the - borders are oriented counter-clockwise
so i got this code //datas
real a=1;
real k=0.05;
real T=100;
real dt=1;
real t=0;
int N=100;
int ue=80;
//trace des bordures:

border ommega1(t=0,1){label=1;x=-2at+2a;y=2at;};
border ommega2(t=0,1){label=2;x=2
at;y=2at-2a;};
border ommega3(t=0,1){label=3;x=0;y=-at-a;};
border ommega4(t=0,1){label=4;x=a
sin(pit);y=acos(pit);};
border ommega5(t=0,1){label=5;x=0;y=-a
t+2*a;};
plot(ommega5(N)+ommega4(N)+ommega3(N)+ommega2(N)+ommega1(N));
mesh Th= buildmesh(ommega5(N)+ommega4(N)+ommega3(N)+ommega2(N)+ommega1(N));
plot(Th);
thank you for the help

Hello,
just one remark, don’t use the variable N in your script,
it’s aFreeFEM variable environnement
Axel

1 Like