Home > Src > Elliptic_2d > call_lap_2d.m

call_lap_2d

PURPOSE ^

CALL_LAP_2D Script for pre- and post- processing lap_2d

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 CALL_LAP_2D Script for pre- and post- processing lap_2d

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % CALL_LAP_2D Script for pre- and post- processing lap_2d
0002 %
0003 [uex,uex_x,uex_y,f,g,h,gam]=setfun_lap_2d;  % -Delta u + gam *u =f
0004 %
0005 xa=-2;xb=2;   % Omega=(xa,xb) x (ya,yb)
0006 ya=0;yb=1;
0007 cb=['nndd']; % boundary conditions on the sides of \partial\Omega
0008 for nex=4;%[2,4,8,10,12,14,16,18,20];
0009     ney=nex;  % decomposition of Omega in nex x ney rectangles
0010 for nx=4:10  % polynomial degree in each element along x-direction
0011     ny=nx;     % polynomial degree in each element along y-direction
0012     param=zeros(20,1);  
0013     param(1)=1;    % 1=SEM-NI,  2= Patching
0014     param(2)=2;    % 0=no reordering, 1=CM ordering, 2=AMD ordering
0015     param(3)=1;    % 1= solve linear system by Choleski fact.
0016                    % 2= compute extrema eigenvalues of A
0017                    % 3 solve by Schur complement
0018                    % 4= compute extrema eigenvalues of the Schur complement
0019     param(4)=1;   % computes errors
0020     param(5)=1;    % 0 exact norms, 1= discrete norms
0021     param(6)=nx*2;   % nq for LG quadrature formulas
0022     param(7)=1;    % 0 =absolute errors, 1=relative errors
0023     param(8)=0;    % 0 no plot, 1 mesh, 2 surf, 3 contour
0024     param(9)=(nx+1); % nodes used to plot numerical solution
0025     gammax=[]; gammay=[]; % if SEM decomposition is not uniform:
0026                           % they are the arrays with intefaces positions
0027 
0028                           % call lap_2d
0029 
0030 [xy,un,D,param]=lap_2d(xa,xb,ya,yb,gam,uex,uex_x,uex_y,f,g,h,cb,...
0031     nex,nx,ney,ny,gammax,gammay,param);
0032 
0033 % output
0034 if (param(3)==1 | param(3)==3)
0035 fprintf('nx=%d,nex=%d,err_inf=%11.4e, err_h1=%11.4e,err_l2=%11.4e \n',...
0036     nx,nex,param(29),param(30),param(31))
0037 elseif(param(3)==2)
0038 fprintf('nx=%d,nex=%d,lam_max(A)=%11.4e, lam_min(A)=%11.4e, k(A)=%11.4e \n',...
0039     nx,nex,param(23),param(24),abs(param(23))/abs(param(24)));
0040 elseif(param(3)==4)
0041 fprintf('nx=%d,nex=%d,lam_max(S)=%11.4e, lam_min(S)=%11.4e, k(S)=%11.4e \n',...
0042     nx,nex,param(25),param(26),abs(param(25))/abs(param(26)));
0043 elseif(param(3)==6)
0044 fprintf('nx=%d,nex=%d,lam_max(M^{-1}A)=%11.4e, lam_min(M^{-1}A)=%11.4e, k(M^{-1}A)=%11.4e \n',...
0045     nx,nex,param(27),param(28),abs(param(27))/abs(param(28)));
0046 end
0047 
0048 end
0049 end

Generated on Fri 21-Sep-2007 10:07:00 by m2html © 2003