CALL_SCHWARZ_2D Script for pre and post processing schwarz_2d.
0001 % CALL_SCHWARZ_2D Script for pre and post processing schwarz_2d. 0002 % 0003 0004 % Written by Paola Gervasio 0005 % $Date: 2007/04/01$ 0006 0007 [uex,uex_x,uex_y,ff,g,h,gam]=setfun_lap_2d; % -Delta u + gam *u =f 0008 % 0009 xa=-1;xb=1; % Omega=(xa,xb) x (ya,yb) 0010 ya=-1;yb=1; 0011 cb='dddd'; % schwarz_2d works only if cb='dddd'; 0012 param=zeros(20,1); 0013 param(1)=2; % 1:P=I, 2: P=P_as 0014 param(2)=2; % number of levels 0015 param(3)=2; % 1=PCG, 2=PBicgstab 0016 param(4)=1; % computes errors 0017 fprintf('nx nex iter res err_inf err_h1 err_l2\n') 0018 for nex=4; 0019 ney=nex; % decomposition of Omega in nex x ney rectangles 0020 for nx=4:16 % polynomial degree in each element along x-direction 0021 ny=nx; % polynomial degree in each element along y-direction 0022 param(5)=1; % 0 exact norms, 1= discrete norms 0023 param(6)=nx*2; % nq for LG quadrature formulas 0024 param(7)=1; % 0 =absolute errors, 1=relative errors 0025 param(8)=0; % 0 no plot, 1 mesh, 2 surf, 3 contour 0026 param(9)=(nx+1); % nodes used to plot numerical solution 0027 param(10)=1.d-12; % tolerance for pcg 0028 param(11)=400; % maxit for pcg 0029 gammax=[]; gammay=[]; % if SEM decomposition is not uniform: 0030 % they are the arrays with intefaces positions 0031 0032 % call schur 0033 0034 [xy,un,param]=schwarz_2d(xa,xb,ya,yb,gam,... 0035 uex,uex_x,uex_y,ff,g,h,cb,nex,nx,ney,ny,gammax,gammay,param); 0036 0037 % output 0038 fprintf('%d %d %d %11.4e %11.4e %11.4e %11.4e \n',... 0039 nx,nex,param(21), param(22), param(25),param(26),param(27)) 0040 0041 end 0042 end