generate mesh, 2 possible calls 1 aux arg. hmax: max triangle side lenght hmax 2 aux arg. nx,ny: regular nx x ny mesh, only for rectangles
0001 function p=stanmesh(p,varargin) 0002 % generate mesh, 2 possible calls 0003 % 1 aux arg. hmax: max triangle side lenght hmax 0004 % 2 aux arg. nx,ny: regular nx x ny mesh, only for rectangles 0005 if(nargin<3) 0006 hmax=varargin{1};[p.points,p.edges,p.tria]=initmesh(p.geo,'Hmax',hmax); 0007 p.points=jigglemesh(p.points,p.edges,p.tria,'opt','off','iter',10); 0008 else nx=varargin{1};ny=varargin{2}; 0009 [p.points,p.edges,p.tria]=poimesh(p.geo,nx,ny); 0010 end 0011 figure(p.ifig);pdemesh(p.points,p.edges,p.tria); axis tight; % plot mesh 0012 p.np=size(p.points,2); p.nt=size(p.tria,2); p.maxt=2*p.nt;