Add ex11: N-D mesh of the 3-D unit ball (distmeshnd)
1 changed file+11−0
ex11_mesh_nd.madded+11−0View file
@@ -0,0 +1,11 @@
1+% ex11_mesh_nd.m — Uniform tetrahedral mesh of the 3-D unit ball (distmeshnd).
2+%
3+% distmeshnd is the general N-D mesh generator; here it fills the solid unit
4+% ball (signed distance sqrt(sum(p.^2,2))-1) with a uniform mesh at edge
5+% length 0.2. The plot shows a cut-away (p(:,2)>0) of the tetrahedra.
6+
7+mip load --install distmesh
8+
9+disp('3-D Unit ball')
10+fd=@(p) sqrt(sum(p.^2,2))-1;
11+[p,t]=distmeshnd(fd,@huniform,0.2,[-1,-1,-1;1,1,1],[]);