/ concept-collection / numbl-distmesh
Sign in
concept-collection / numbl-distmesh
numbl-distmesh / README.md
2.2 KBPreviewCodeBlameHistoryRaw

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)#

Notes#

All examples animate as the mesh relaxes; drag to rotate the surface meshes. ex06_naca_airfoil.m is by far the heaviest and can take up to a minute or so in the browser. 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.

moveopenescclose