// 
xbasc() 
getf('laplace.sci','c'); 
d=evstr(x_dialog('nombre de points interieurs?','12')); 
npt= d+2; h=1.0/(npt-1);Lapl=(1/h^2)*laplace(d); 
zone=ceil(d/2); 
Smm=zeros(d,d); 
Smm(zone-3:zone+3,zone-2:zone+2)=4*(1/(h^2))*ones(7,5); 
Smcol=Smm(:); 
D=diag(diag(Lapl)); 
L=tril(-Lapl)+D; 
U=triu(-Lapl)+D; 
omega=1.58;niter=5; 
RL=inv(D-omega.*L)*(((1-omega).* D) +(omega.* U) ); 
smi=omega.*(inv(D-omega.*L)*Smcol); 
D=[];L=[];U=[]; 
// 
Solcol=zeros(d*d,1);	// point de depart 
// 
for iter=1:niter 
	Solcol=RL*Solcol+smi; 
end 
Solm=zeros(d,d); 
Solm(:)=Solcol; 
Solm=[zeros(1,d);Solm;zeros(1,d)]; 
Solm=[zeros(d+2,1) Solm zeros(d+2,1)]; 
t=1:d+2; 
xsetech([0,0,0.5,1]) 
plot3d(t,t,Solm); 
xsetech([0.5,0.,0.5,1]) 
contour(t,t,Solm,5); 
write(%io(2),'temps de calcul');disp(timer()); 
// 
// 
