Hello everyone,
I wanted to solve the Laplace problem on part of the mesh domain. After defining the region that interests me, the problem does not resolve.
<<catch an erreur in solve => set sol = 0 !!! >>
load “msh3”
load “medit”
load “UMFPACK64”
int gam0 = 95;
int gamin = 96;
int gamout = 97;
int Sminus = 98;
int Splus = 99 ;
real [int] A(2), B(2), C(2), D(2), E(2), a(2), b(2), c(2), d(2);
real [int] F(2), G(2), H(2), I(2), J(2);
real [int] K(2), L(2), M(2), Ng(2), AA(2) , BB(2), CC(2), DD(2);
A = [6,1.5]; B = [6, 2.5]; C = [12, 1.5]; D = [21,0];
F = [15, 2]; I = [12, 2.5]; J = [21, 4]; M = [21, 1]; Ng = [21, 3];
AA = [6,-1]; BB=[6,5]; CC=[21,-1]; DD=[21,5];
a=[8,1.8]; b=[10,1.8]; c=[10,2.2]; d=[8,2.2];
border c1(t=0,1){x=(1-t)A[0]+tC[0]; y=(1-t)A[1]+tC[1];label=gam0;}
border c3(t=0,1){x=(1-t)C[0]+tD[0]; y=(1-t)C[1]+tD[1];label=gam0;}
border c8(t=0,1){x=(1-t)D[0]+tM[0]; y=(1-t)D[1]+tM[1];label=gamout;}
border c9(t=0,1){x=(1-t)M[0]+tF[0]; y=(1-t)M[1]+tF[1];label=gam0;}
border c10(t=0,1){x=(1-t)F[0]+tNg[0]; y=(1-t)F[1]+tNg[1];label=gam0;}
border c11(t=0,1){x=(1-t)Ng[0]+tJ[0]; y=(1-t)Ng[1]+tJ[1];label=gamout;}
border c12(t=0,1){x=(1-t)J[0]+tI[0]; y=(1-t)J[1]+tI[1];label=gam0;}
border c13(t=0,1){x=(1-t)I[0]+tB[0]; y=(1-t)I[1]+tB[1];label=gam0;}
border c14(t=0,1){x=(1-t)B[0]+tA[0]; y=(1-t)B[1]+tA[1];label=gamin;}
border c001(t=0,1){x=(1-t)a[0]+td[0]; y=(1-t)a[1]+td[1];gam0;}
border c002(t=0,1){x=(1-t)d[0]+tc[0]; y=(1-t)d[1]+tc[1];gam0;}
border c003(t=0,1){x=(1-t)c[0]+tb[0]; y=(1-t)c[1]+tb[1];gam0;}
border c004(t=0,1){x=(1-t)b[0]+ta[0]; y=(1-t)b[1]+ta[1];gam0;}
border c01(t=0,1){x=(1-t)AA[0]+tCC[0]; y=(1-t)AA[1]+tCC[1];Splus;}
border c01b(t=0,1){x=(1-t)CC[0]+tD[0]; y=(1-t)CC[1]+tD[1];Splus;}
border c02(t=0,1){x=(1-t)M[0]+tNg[0]; y=(1-t)M[1]+tNg[1];Splus;}
border c02b(t=0,1){x=(1-t)J[0]+tDD[0]; y=(1-t)J[1]+tDD[1];Splus;}
border c03(t=0,1){x=(1-t)DD[0]+tBB[0]; y=(1-t)DD[1]+tBB[1];Sminus;}
border c04(t=0,1){x=(1-t)BB[0]+tB[0]; y=(1-t)BB[1]+tB[1]; Splus;}
border c05(t=0,1){x=(1-t)A[0]+tAA[0]; y=(1-t)A[1]+tAA[1];Splus;}
plot(c001(1) +c01b(1)+c002(1)+c02b(1)+c003(1)+c004(1) +c1(1)+c3(1)+c8(1)+c9(9)+c10(1)+c11(1)
+ c12(1)+c13(1)+c14(1)+c01(1)+c02(1)+c03(1)+c04(1)+c05(1)) ;
mesh Th = buildmesh(c1(50)+c3(60)+ c8(10) +c9(50)+ c10(50)+c11(10)+c12(60)+c13(50)+c14(10)
+ c01(110)+c01b(10)+c02(15)+c02b(10)+c03(110)+c04(20)+c05(20)
+ c001(-7)+c002(-30)+c003(-7)+c004(-30)) ;
plot(Th, wait=true) ;
fespace Vh(Th, P2) ;
int road = Th(12., 2.).region ;
int air1 = Th(9., 2.).region ;
int air2 = Th(9., 1.).region ;
int air3 = Th(9., 4.).region ;
int air4 = Th(19., 2.).region ;
cout << "--------- Label number for road region = " << road << endl;
cout << "--------- Label number for air1 region = " << air1 << endl;
cout << "--------- Label number for air2 region = " << air2 << endl;
cout << "--------- Label number for air3 region = " << air3 << endl;
cout << "--------- Label number for air4 region = " << air4 << endl;
real U0 = 10. ;
real U00 = 0. ;
Vh U = U0*(region==road ? 1 : 0) + U00*(region==air1 ? 1 : 0) + U00*(region==air2 ? 1 : 0) + U00*(region==air3 ? 1 : 0) + U00*(region==air4 ? 1 : 0) ;
plot(U, fill=true, value = true);
Vh vv, vvh ;
problem Laplace(vv, vvh, solver=UMFPACK) = int2d(Th)(U*(dx(vv)*dx(vvh) + dy(vv)*dy(vvh)))
+ int1d(Th, gamin)(vvh)
+ on(gamout, vv=0)
;
Laplace ;
plot(vv, nbiso=50, fill=1, value=1);
Could you help me please?
Thanks