Home > Src > Basis_functions > plot_2dmodal.m

plot_2dmodal

PURPOSE ^

PLOT_2DMODAL plots 2D modal boundary adapted polynomials.

SYNOPSIS ^

function plot_2dmodal

DESCRIPTION ^

 PLOT_2DMODAL  plots 2D modal boundary adapted polynomials.
             Formula (2.3.31), pag. 82, CHQZ2 (tensorial product),
             produces part of Fig. 2.13, pag. 100 CHQZ2

     plot_2dmodal   % 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_2dmodal
0002 % PLOT_2DMODAL  plots 2D modal boundary adapted polynomials.
0003 %             Formula (2.3.31), pag. 82, CHQZ2 (tensorial product),
0004 %             produces part of Fig. 2.13, pag. 100 CHQZ2
0005 %
0006 %     plot_2dmodal   % 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 addpath ../Level_0
0016 nx=6;
0017 lm1='0';
0018 l0='1'; l1='x';
0019 l2=pol_legendre(1,l1,l0);
0020 l3=pol_legendre(2,l2,l1);
0021 l4=pol_legendre(3,l3,l2);
0022 l5=pol_legendre(3,l4,l3);
0023 l6=pol_legendre(3,l5,l4);
0024 eta0='0.5*(1-x)';
0025 eta1=pol_modal(1,l2,l0);
0026 eta2=pol_modal(2,l3,l1);
0027 eta3=pol_modal(3,l4,l2);
0028 eta4=pol_modal(4,l5,l3);
0029 eta5=pol_modal(5,l6,l4);
0030 eta6='0.5*(1+x)';
0031 
0032 nx1=25;
0033 x=linspace(-1,1,nx1)';
0034 y0=eval(eta0); y2=eval(eta2);
0035 
0036 [x,y]=meshgrid(linspace(-1,1,nx1));
0037 fig=figure(...,
0038     'Name','2D Modal (vertex) polynomial',...
0039     'Visible','on');
0040 
0041 graymon
0042 z=y0*y0'; mesh(x,y,z)
0043 xlabel('x'); ylabel('y')
0044 view([116,32])
0045 print(fig,'-deps2','modvertex2d')
0046 
0047 
0048 fig=figure(...,
0049     'Name','2D Modal (edge) polynomial',...
0050     'Visible','on');
0051 graymon
0052 z=y0*y2'; mesh(x,y,z)
0053 xlabel('x'); ylabel('y')
0054 view([116,32])
0055 print(2,'-deps2','modedge2d')
0056 
0057 
0058 fig=figure(...,
0059     'Name','2D Modal (bubble) polynomial',...
0060     'Visible','on');
0061 graymon
0062 z=y2*y2'; mesh(x,y,z)
0063 xlabel('x'); ylabel('y')
0064 view([116,32])
0065 print(3,'-deps2','modbubble2d')
0066 
0067 
0068 
0069 return
0070

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