Home > Src > Basis_functions > plot_2dlagrange.m

plot_2dlagrange

PURPOSE ^

PLOT_2DLAGRANGE plots 2D Lagrange polynomials.

SYNOPSIS ^

function plot_2dlagrange

DESCRIPTION ^

 PLOT_2DLAGRANGE  plots 2D Lagrange polynomials.
             Formula (1.2.55), pag. 17, CHQZ2 (tensorial product),
             produces part of Fig. 2.13, pag. 100 CHQZ2

     plot_2dlagrange   % no input, no output

 Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang,
                    "Spectral Methods. Fundamentals in Single Domains"
                    Springer Verlag, Berlin Heidelberg New York, 2006.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function plot_2dlagrange
0002 % PLOT_2DLAGRANGE  plots 2D Lagrange polynomials.
0003 %             Formula (1.2.55), pag. 17, CHQZ2 (tensorial product),
0004 %             produces part of Fig. 2.13, pag. 100 CHQZ2
0005 %
0006 %     plot_2dlagrange   % no input, no output
0007 %
0008 % Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang,
0009 %                    "Spectral Methods. Fundamentals in Single Domains"
0010 %                    Springer Verlag, Berlin Heidelberg New York, 2006.
0011 
0012 %   Written by Paola Gervasio
0013 %   $Date: 2007/04/01$
0014 %
0015 
0016 addpath ../Level_0
0017 nx=6;
0018 xga=-1; xgb=1.;
0019 npdx=nx+1; 
0020 [xgl,wx]=xwlgl(npdx); 
0021 nx1=25;
0022 x=linspace(-1,1,nx1)';
0023 a=intlag_lgl(xgl, x);
0024 ygl=zeros(npdx,1); ygl(1)=1;
0025 y0=a*ygl;
0026 ygl=zeros(npdx,1); ygl(3)=1;
0027 y2=a*ygl;
0028 [x,y]=meshgrid(linspace(-1,1,nx1));
0029 
0030 
0031 fig=figure(...,
0032     'Name','2D Lagrange (vertex) polynomial',...
0033     'Visible','on');
0034 graymon
0035 z=y0*y0'; mesh(x,y,z);
0036 xlabel('x'); ylabel('y');
0037 view([116,32])
0038 % print(fig,'-deps2','lagvertex2d')
0039 
0040 fig=figure(...,
0041     'Name','2D Lagrange (edge) polynomial',...
0042     'Visible','on');
0043 graymon
0044 z=y0*y2'; mesh(x,y,z)
0045 xlabel('x'); ylabel('y');
0046 view([116,32])
0047 %print(fig,'-deps2','lagedge2d')
0048 %
0049 fig=figure(...,
0050     'Name','2D Lagrange (bubble) polynomial',...
0051     'Visible','on');
0052 graymon
0053 z=y2*y2'; mesh(x,y,z)
0054 xlabel('x'); ylabel('y');
0055 view([116,32])
0056 %print(fig,'-deps2','lagbubble2d')
0057 
0058 
0059 
0060 return
0061

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