/ concept-collection / numbl-distmesh
Sign in
concept-collection / numbl-distmesh
numbl-distmesh / ex01_unit_circle.m
14 lines · 491 BBlameHistoryRaw
1% ex01_unit_circle.m — Uniform mesh on the unit circle.
2%
3% The geometry is given by a signed distance function fd(p): negative
4% inside the domain, positive outside, zero on the boundary. Here
5% d = r - 1, so the domain is the disk of radius 1. @huniform asks for a
6% uniform element size.
8mip load --install distmesh
10fd=@(p) sqrt(sum(p.^2,2))-1;
11[p,t]=distmesh2d(fd,@huniform,0.2,[-1,-1;1,1],[]);
13title('Unit circle');
14fprintf('mesh: %d nodes, %d triangles\n', size(p,1), size(t,1));
moveopenescclose