concept-collection / numbl-distmesh
numbl-distmesh
Go to fileHistoryFork
.githubDistMesh examples: interactive numbl companion
.gitignoreDistMesh examples: interactive numbl companion
ex01_unit_circle.mDistMesh examples: interactive numbl companion
ex02_rectangle_hole.mDistMesh examples: interactive numbl companion
ex03_polygon.mDistMesh examples: interactive numbl companion
ex04_ellipse.mDistMesh examples: interactive numbl companion
ex05_square_nonuniform.mDistMesh examples: interactive numbl companion
ex06_naca_airfoil.mDistMesh examples: interactive numbl companion
ex07_sphere.mDistMesh examples: interactive numbl companion
ex08_sphere_graded.mDistMesh examples: interactive numbl companion
ex09_torus.mDistMesh examples: interactive numbl companion
ex10_ellipsoid.mDistMesh examples: interactive numbl companion
ex11_unit_ball.mRename ex11 to ex11_unit_ball.m
numbl-project.jsonDistMesh examples: interactive numbl companion
README.mdREADME: add ex11 volume mesh, drop airfoil timing note

DistMesh examples#

An interactive companion to DistMesh — Per-Olof Persson and Gilbert Strang's simple mesh generator in MATLAB. Every example from the DistMesh README, runnable in your browser through numbl: pick a script on the left and click Run.

DistMesh describes a domain by a signed distance function (negative inside, positive outside) and grows a well-shaped triangular mesh by Delaunay retriangulation plus force-based smoothing of the node positions.

Each script begins with

mip load --install distmesh

which fetches DistMesh on first use.

2-D meshes (distmesh2d)#

Surface meshes (distmeshsurface)#

Volume meshes (distmeshnd)#

  • ex11_unit_ball.m — uniform tetrahedral mesh filling the solid 3-D unit ball, using the general N-D generator.

Notes#

All examples animate as the mesh relaxes; drag to rotate the surface meshes. The geometries use the helper distance functions dcircle, drectangle, dpoly, dsphere, ddiff, ... that ship with DistMesh.

Reference#

P.-O. Persson, G. Strang, A Simple Mesh Generator in MATLAB, SIAM Review 46(2), 329–345, 2004.

How it's deployed#

On every push to main, the workflow in .github/workflows/deploy.yml bundles these files with the numbl browser IDE and publishes the result to GitHub Pages. Edit numbl-project.json to change the title or which file opens first.