1% ex05_square_nonuniform.m — Unit square with point and line size sources.
2%
3% The size function fh refines toward a point (the origin) and a line
4% segment, capped at 0.15. This shows how to drive local resolution with
5% a hand-written size function.
7mip load --install distmesh
9fd=@(p) drectangle(p,0,1,0,1);
10fh=@(p) min(min(0.01+0.3*abs(dcircle(p,0,0,0)), ...
11 0.025+0.3*abs(dpoly(p,[0.3,0.7; 0.7,0.5]))),0.15);
12[p,t]=distmesh2d(fd,fh,0.01,[0,0;1,1],[0,0;1,0;0,1;1,1]);
14title('Square with point and line size sources');
15fprintf('mesh: %d nodes, %d triangles\n', size(p,1), size(t,1));