/ concept-collection / numbl-surfacefun-intro
Sign in
concept-collection / numbl-surfacefun-intro
numbl-surfacefun-intro
Go to fileHistoryFork
.githubIntro to surfacefun: interactive numbl example project
.gitignoreIntro to surfacefun: interactive numbl example project
ex_hodge.mIntro to surfacefun: interactive numbl example project
ex_reaction_diffusion.mIntro to surfacefun: interactive numbl example project
fun_arithmetic.mIntro to surfacefun: interactive numbl example project
fun_contour.mIntro to surfacefun: interactive numbl example project
fun_gradient.mIntro to surfacefun: interactive numbl example project
fun_integral_norm.mIntro to surfacefun: interactive numbl example project
fun_laplacian.mIntro to surfacefun: interactive numbl example project
fun_plot.mIntro to surfacefun: interactive numbl example project
mesh_blob.mIntro to surfacefun: interactive numbl example project
mesh_mobius.mIntro to surfacefun: interactive numbl example project
mesh_refine.mIntro to surfacefun: interactive numbl example project
mesh_single_patch.mIntro to surfacefun: interactive numbl example project
mesh_sphere.mIntro to surfacefun: interactive numbl example project
mesh_torus.mIntro to surfacefun: interactive numbl example project
mesh_twisted_torus.mIntro to surfacefun: interactive numbl example project
numbl-project.jsonIntro to surfacefun: interactive numbl example project
pde_helmholtz.mIntro to surfacefun: interactive numbl example project
pde_laplace_beltrami.mIntro to surfacefun: interactive numbl example project
pde_open_surface.mIntro to surfacefun: interactive numbl example project
README.mdIntro to surfacefun: interactive numbl example project
vec_curl.mIntro to surfacefun: interactive numbl example project
vec_gradient.mIntro to surfacefun: interactive numbl example project
vec_mean_curvature.mIntro to surfacefun: interactive numbl example project
vec_normals.mIntro to surfacefun: interactive numbl example project

Intro to surfacefun#

An interactive introduction to surfacefun — a package for numerically computing with functions on surfaces, and solving PDEs on them, with high-order accuracy. Everything here runs in your browser through numbl: pick a script on the left and click Run. Each script is self-contained and draws one or more figures (use the figure tabs).

Every script begins with

mip load --install flatironinstitute/flatironinstitute/surfacefun

which fetches surfacefun (and its dependency, Chebfun) on first use.

1. Surface meshes#

A surfacemesh is a collection of high-order quadrilateral patches whose union defines a surface in 3-D.

2. Scalar functions#

A surfacefun is a scalar field on a surfacemesh, built from a handle of the Cartesian coordinates (x,y,z).

3. Vector fields#

A surfacefunv is a three-component vector field over a surfacemesh.

4. Solving PDEs#

surfaceop is a fast direct solver for second-order linear elliptic PDEs on surfaces.

  • pde_laplace_beltrami.m — a Laplace-Beltrami problem on the sphere, checked against an exact spherical-harmonic solution.
  • pde_helmholtz.m — a variable-coefficient Helmholtz problem on a stellarator.
  • pde_open_surface.m — an open surface with Dirichlet boundary data, reusing one factorization for several right-hand sides.

5. Worked examples#

  • ex_hodge.m — the Hodge decomposition of a tangential vector field into curl-free, divergence-free, and harmonic parts.
  • ex_reaction_diffusion.m — the complex Ginzburg-Landau equation, integrated in time with a reused implicit solver.

Notes#

The scripts keep the polynomial order and refinement modest so they run quickly in the browser. Raise p and nref for higher accuracy and smoother pictures. The numerics follow the surfacefun documentation at https://surfacefun.readthedocs.io.

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