/ concept-collection / numbl-surfacefun-intro
Sign in
concept-collection / numbl-surfacefun-intro
numbl-surfacefun-intro / pde_helmholtz.m
25 lines · 650 BCodeBlameHistory
12d8453Intro to surfacefun: interactive numbl example projectJeremy Magland 1% pde_helmholtz.m — A variable-coefficient surface Helmholtz problem.
2%
3% surfaceop handles general elliptic operators on surfaces of any genus.
4% Here we solve (Delta_Gamma + c(x)) u = f on a genus-1 stellarator, with
5% a spatially varying coefficient c.
7mip load --install flatironinstitute/flatironinstitute/surfacefun
9p = 16;
10nu = 8;
11nv = 24;
12dom = surfacemesh.stellarator(p + 1, nu, nv);
14% Operator: Laplacian plus a zeroth-order term c(x,y,z).
15pdo = [];
16pdo.lap = 1;
17pdo.c = @(x, y, z) 300*(1 - z);
19f = -1;
20L = surfaceop(dom, pdo, f);
21u = L.solve();
23figure(1);
24plot(u), colorbar
25title('Variable-coefficient Helmholtz on a stellarator');
moveopenescclose