Home > Src > Elliptic_2d > plot_mesh.m

plot_mesh

PURPOSE ^

PLOT_MESH Script for plotting SEM mesh on a rectangle

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 PLOT_MESH Script for plotting SEM mesh  on a rectangle

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % PLOT_MESH Script for plotting SEM mesh  on a rectangle
0002 %
0003 xa=-1;xb=1;   % Omega=(xa,xb) x (ya,yb)
0004 ya=-1;yb=1;
0005 cb='dddd';
0006 nex=1;
0007     ney=nex;  % decomposition of Omega in nex x ney rectangles
0008 nx=12;
0009     ny=nx;     % polynomial degree in each element along y-direction
0010 gammax=[]; gammay=[]; 
0011 xy=[]; 
0012 
0013 npdx=nx+1; npdy=ny+1; ldnov=npdx*npdy; mn=ldnov; ne=nex*ney;
0014 
0015 [x,wx]=xwlgl(npdx);
0016 [y,wy]=xwlgl(npdy);
0017 %
0018 % nov construction
0019 %
0020 [nov]=cosnov_2d(npdx,nex,npdy,ney);
0021 noe=nov(ldnov,ne);
0022 
0023 % Mesh generation
0024 
0025 [xx,yy,jacx,jacy,xy,ww,ifro]=mesh_2d(xa,xb,ya,yb,cb,nex,ney,npdx,npdy,...
0026 nov,x,wx,y,wy,gammax,gammay);
0027 nm=npdx*(npdy-1);
0028 plot(xy(:,1),xy(:,2),'ko','markerfacecolor','k','markersize',4);hold on
0029 for j=1:npdy
0030     plot([xy((j-1)*npdx+1,1),xy(j*npdx,1)],[y(j),y(j)],'k');
0031 end
0032 for i=1:npdx
0033     plot([x(i),x(i)],[xy(1,2),xy(nm+i,2)],'k');
0034 end
0035 axis equal
0036 axis off
0037 text(-0.14,0.16,'h','Fontsize',16)
0038 plot([xy(85,1),xy(97,1)],[xy(85,2),xy(97,2)],'r','Linewidth',2);
0039 hold off
0040 print(1,'-deps2','mesh2d')

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