Home > Src > Elliptic_1d > call_lap_1d.m

call_lap_1d

PURPOSE ^

CALL_LAP_1D Script for calling lap_1d

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 CALL_LAP_1D Script for calling lap_1d

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % CALL_LAP_1D Script for calling lap_1d
0002 
0003 xa=-1;xb=1; 
0004 
0005 % set functions
0006 
0007 [uex,uexx,ff,nu,gam]=setfun_lap_1d;
0008 
0009 nomefile=['out.dat'];
0010 cb='nd'; % c.b.: the first character specifies boundary condition in xa
0011         % the second character specifies boundary condition in xb
0012 fid=fopen(nomefile,'w');
0013 fprintf(fid,'1D Laplace problem, SEM\n');
0014 fprintf(fid,'nx, ne   e_inf  e_l2   e_h1 \n');
0015 param=zeros(10,1);
0016 
0017 nnx=4:4:24;
0018 for ne=10; %[10,20,40,80,160] % number of spectral elements
0019 for nx=nnx % spectral polynomial degree (the same in every element)
0020     H=(xb-xa)/ne;
0021 param(1:6)=[1,1,nx*2,1,1,64]; % see help adr_1d
0022 [xy,un,err_inf,err_l2,err_h1]=lap_1d(xa,xb,nu,gam,uex,uexx,ff,cb,ne,nx,param);
0023 noe=length(xy);
0024 fprintf('nx=%d, ne=%d, e_inf=%8.2e, e_l2=%8.2e, e_h1=%8.2e \n',...
0025     nx,ne,err_inf,err_l2,err_h1);
0026 fprintf(fid,'%d   %d   %8.2e   %8.2e    %8.2e \n',...
0027     nx, ne,err_inf,err_l2,err_h1);
0028 end
0029 end
0030 fclose(fid);
0031

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