include "ffmatlib.idp" real Zm = 100; real Rm = 100; real e = 1; //épaisseur des disques real R = 25; // rayon des disques real e2 = e/2; real z1 = -5-e2; // position du premier disque real z2 = 5+e2; // position du second disque int C = 10; border Ca(t=0,1){x=-Zm+2*Zm*t;y=-Rm; label=C;} border Cb(t=0,1){x=Zm;y=-Rm+2*Rm*t; label=C;} border Cc(t=0,1){x=Zm-2*Zm*t;y=Rm; label=C;} border Cd(t=0,1){x=-Zm;y=Rm-2*Rm*t; label=C;} int C1=11; border C1a(t=0, 1){ x=z1+e2; y=R-t*2*R; label=C1;} border C1b(t=0, 1){ x=z1+e2-e*t; y=-R; label=C1;} border C1c(t=0, 1){ x=z1-e2; y=-R+t*2*R; label=C1;} border C1d(t=0, 1){ x=z1-e2+e*t; y=R; label=C1;} int C2=12; border C2a(t=0, 1){ x=z2+e2; y=R-t*2*R; label=C2;} border C2b(t=0, 1){ x=z2+e2-e*t; y=-R; label=C2;} border C2c(t=0, 1){ x=z2-e2; y=-R+t*2*R; label=C2;} border C2d(t=0, 1){ x=z2-e2+e*t; y=R; label=C2;} int N=20; mesh Th = buildmesh(Ca(N)+Cb(N)+Cc(N)+Cd(N)+C1a(10)+C1b(3)+C1c(10)+C1d(3)+C2a(10)+C2b(3)+C2c(10)+C2d(3)); plot(Th, wait=1); fespace Vh(Th,P1); Vh u,v; // x : variable z, y : variable r problem Laplace(u,v,eps=1.0e-6) = int2d(Th) ((dx(u)*dx(v)+dy(u)*dy(v))*abs(y)) +on(C,u=0) +on(C1,u=0.5) +on(C2,u=-0.5); Laplace; int i; real error = 0.01; for (i = 0; i < 4; i++) { Laplace; cout << u[].min << " " << u[].max << endl; plot(u,wait=1); Th = adaptmesh(Th, u, err=error); plot(Th, wait=1); u = u; error = error/2; } Vh Ex,Ey; Ex = -dx(u); Ey = -dy(u); plot(Th,wait=true); plot(u,wait=true); plot(u,[Ex,Ey]); savemesh(Th,"conducteursAxial.msh"); ffSaveVh(Th,Vh,"conducteursAxial_vh.txt"); ffSaveData3(u,Ex,Ey,"conducteursAxial_data.txt");